mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-25 06:02:08 +00:00
[DEBUG] add a TRACE macro to facilitate runtime data extraction
The new TRACE macro is used almost like fprintf, except that a session has to be passed instead of the file descriptor. It displays infos about where it is called, session ptr and id, etc...
This commit is contained in:
parent
e9bc01e39b
commit
5c6f58fe87
@ -36,4 +36,18 @@
|
||||
#define FSM_PRINTF(x...)
|
||||
#endif
|
||||
|
||||
/* this one is provided for easy code tracing.
|
||||
* Usage: TRACE(sess||0, fmt, args...);
|
||||
* TRACE(sess, "");
|
||||
*/
|
||||
#define TRACE(sess, fmt, args...) do { \
|
||||
fprintf(stderr, \
|
||||
"%d.%06d [%s:%d %s] [sess %p(%x)] " fmt "\n", \
|
||||
(int)now.tv_sec, (int)now.tv_usec, \
|
||||
__FILE__, __LINE__, __FUNCTION__, \
|
||||
sess, sess?((struct session *)sess)->uniq_id:~0U, \
|
||||
##args); \
|
||||
} while (0)
|
||||
|
||||
|
||||
#endif /* _COMMON_DEBUG_H */
|
||||
|
Loading…
Reference in New Issue
Block a user