mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-26 08:11:21 +02:00
MINOR: trace: Add a set of macros to trace events if HA is compiled with debug
The macros DBG_TRACE_*() can be used instead of existing trace macros to emit trace messages in debug mode only, ie, when HAProxy is compiled with DEBUG_FULL or DEBUG_DEV. Otherwise, these macros do nothing. So it is possible to add traces for development purpose without impacting performance of production instances.
This commit is contained in:
parent
a3ed271ed4
commit
db703b1918
@ -77,6 +77,28 @@
|
|||||||
#define TRACE_POINT(mask, ...) \
|
#define TRACE_POINT(mask, ...) \
|
||||||
trace(TRACE_LEVEL_DEVELOPER, (mask), TRACE_SOURCE, ist(TRC_LOC), __FUNCTION__, TRC_5ARGS(__VA_ARGS__,,,,,), ist("in"))
|
trace(TRACE_LEVEL_DEVELOPER, (mask), TRACE_SOURCE, ist(TRC_LOC), __FUNCTION__, TRC_5ARGS(__VA_ARGS__,,,,,), ist("in"))
|
||||||
|
|
||||||
|
#if defined(DEBUG_DEV) || defined(DEBUG_FULL)
|
||||||
|
# define DBG_TRACE(msg, mask, ...) TRACE(msg, mask, __VA_ARGS__)
|
||||||
|
# define DBG_TRACE_USER(msg, mask, ...) TRACE_USER(msg, mask, __VA_ARGS__)
|
||||||
|
# define DBG_TRACE_DATA(msg, mask, ...) TRACE_DATA(msg, mask, __VA_ARGS__)
|
||||||
|
# define DBG_TRACE_PROTO(msg, mask, ...) TRACE_PROTO(msg, mask, __VA_ARGS__)
|
||||||
|
# define DBG_TRACE_STATE(msg, mask, ...) TRACE_STATE(msg, mask, __VA_ARGS__)
|
||||||
|
# define DBG_TRACE_DEVEL(msg, mask, ...) TRACE_DEVEL(msg, mask, __VA_ARGS__)
|
||||||
|
# define DBG_TRACE_ENTER(mask, ...) TRACE_ENTER(mask, __VA_ARGS__)
|
||||||
|
# define DBG_TRACE_LEAVE(mask, ...) TRACE_LEAVE(mask, __VA_ARGS__)
|
||||||
|
# define DBG_TRACE_POINT(mask, ...) TRACE_POINT(mask, __VA_ARGS__)
|
||||||
|
#else
|
||||||
|
# define DBG_TRACE(msg, mask, ...) do { /* do nothing */ } while(0)
|
||||||
|
# define DBG_TRACE_USER(msg, mask, ...) do { /* do nothing */ } while(0)
|
||||||
|
# define DBG_TRACE_DATA(msg, mask, ...) do { /* do nothing */ } while(0)
|
||||||
|
# define DBG_TRACE_PROTO(msg, mask, ...) do { /* do nothing */ } while(0)
|
||||||
|
# define DBG_TRACE_STATE(msg, mask, ...) do { /* do nothing */ } while(0)
|
||||||
|
# define DBG_TRACE_DEVEL(msg, mask, ...) do { /* do nothing */ } while(0)
|
||||||
|
# define DBG_TRACE_ENTER(mask, ...) do { /* do nothing */ } while(0)
|
||||||
|
# define DBG_TRACE_LEAVE(mask, ...) do { /* do nothing */ } while(0)
|
||||||
|
# define DBG_TRACE_POINT(mask, ...) do { /* do nothing */ } while(0)
|
||||||
|
#endif
|
||||||
|
|
||||||
extern struct list trace_sources;
|
extern struct list trace_sources;
|
||||||
extern THREAD_LOCAL struct buffer trace_buf;
|
extern THREAD_LOCAL struct buffer trace_buf;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user