Module: xenomai-3
Branch: next
Commit: cc9029a25411eca65c4a82db64f8bc9ea8a9e4c1
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=cc9029a25411eca65c4a82db64f8bc9ea8a9e4c1

Author: Philippe Gerum <r...@xenomai.org>
Date:   Fri Sep  4 11:53:56 2015 +0200

boilerplate/debug: add __bterrno() helper for backtracing

---

 include/boilerplate/debug.h |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/boilerplate/debug.h b/include/boilerplate/debug.h
index eae510c..f3eb687 100644
--- a/include/boilerplate/debug.h
+++ b/include/boilerplate/debug.h
@@ -82,6 +82,15 @@ void debug_init(void);
                __ret;                                          \
        })
 
+#define __bterrno(__exp)                                       \
+       ({                                                      \
+               typeof(__exp) __ret = (__exp);                  \
+               if (unlikely(__ret < 0))                        \
+                       backtrace_log(-errno, __FUNCTION__,     \
+                                     __FILE__, __LINE__);      \
+               __ret;                                          \
+       })
+
 #else /* !CONFIG_XENO_DEBUG */
 
 static inline int must_check(void)
@@ -94,6 +103,8 @@ struct backtrace_data {
 
 #define __bt(__exp)                    (__exp)
 
+#define __bterrno(__exp)               (__exp)
+
 #define backtrace_init_context(btd, name)      \
        do { (void)(btd); (void)(name); } while (0)
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to