diff options
author | Sebastian Geerken <devnull@localhost> | 2016-04-23 14:17:23 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2016-04-23 14:17:23 +0200 |
commit | 03a906f7726e7496239ddf74369e9d1f1a5f8c63 (patch) | |
tree | 659be5829f90755f63e3deb7dff0294b09aa75a1 /lout/debug.hh | |
parent | cd616fc93a5adb072d282f7afbdbe4b057f9d6fc (diff) |
RTFL.
Diffstat (limited to 'lout/debug.hh')
-rw-r--r-- | lout/debug.hh | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/lout/debug.hh b/lout/debug.hh index 5c0169e3..86b45c7f 100644 --- a/lout/debug.hh +++ b/lout/debug.hh @@ -31,6 +31,56 @@ #include "debug_rtfl.hh" +/* Some extensions for RTFL dealing with static stuff. */ + +#ifdef DBG_RTFL + +#define DBG_OBJ_MSG_S(aspect, prio, msg) \ + RTFL_OBJ_PRINT ("msg", "s:s:d:s", "<static>", aspect, prio, msg) + +#define DBG_OBJ_MSGF_S(aspect, prio, fmt, ...) \ + STMT_START { \ + char msg[256]; \ + snprintf (msg, sizeof (msg), fmt, __VA_ARGS__); \ + RTFL_OBJ_PRINT ("msg", "s:s:d:s", "<static>", aspect, prio, msg) \ + } STMT_END + +#define DBG_OBJ_ENTER0_S(aspect, prio, funname) \ + RTFL_OBJ_PRINT ("enter", "s:s:d:s:", "<static>", aspect, prio, funname); + +#define DBG_OBJ_ENTER_S(aspect, prio, funname, fmt, ...) \ + STMT_START { \ + char args[256]; \ + snprintf (args, sizeof (args), fmt, __VA_ARGS__); \ + RTFL_OBJ_PRINT ("enter", "s:s:d:s:s", "<static>", aspect, prio, funname, \ + args); \ + } STMT_END + +#define DBG_OBJ_LEAVE_S() \ + RTFL_OBJ_PRINT ("leave", "s", "<static>"); + +#define DBG_OBJ_LEAVE_VAL_S(fmt, ...) \ + STMT_START { \ + char vals[256]; \ + snprintf (vals, sizeof (vals), fmt, __VA_ARGS__); \ + RTFL_OBJ_PRINT ("leave", "s:s", "<static>", vals); \ + } STMT_END + +#else /* DBG_RTFL */ + +#define STMT_NOP do { } while (0) + +#define DBG_IF_RTFL if(0) + +#define DBG_OBJ_MSG_S(aspect, prio, msg) STMT_NOP +#define DBG_OBJ_MSGF_S(aspect, prio, fmt, ...) STMT_NOP +#define DBG_OBJ_ENTER0_S(aspect, prio, funname) STMT_NOP +#define DBG_OBJ_ENTER_S(aspect, prio, funname, fmt, ...) STMT_NOP +#define DBG_OBJ_LEAVE_S() STMT_NOP +#define DBG_OBJ_LEAVE_VAL_S(fmt, ...) STMT_NOP + +#endif /* DBG_RTFL */ + #endif /* __LOUT_DEBUG_H__ */ |