~ubuntu-branches/ubuntu/utopic/haproxy/utopic-proposed

« back to all changes in this revision

Viewing changes to include/common/debug.h

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Cornet
  • Date: 2009-06-26 00:11:01 UTC
  • mfrom: (1.1.6 upstream) (2.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090626001101-qo261ke2mjh3d8cn
* New Upstream Version (Closes: #534583).
* Add contrib directory in docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#define FSM_PRINTF(x...)
37
37
#endif
38
38
 
 
39
/* This abort is more efficient than abort() because it does not mangle the
 
40
 * stack and stops at the exact location we need.
 
41
 */
 
42
#define ABORT_NOW() (*(int*)0=0)
 
43
 
 
44
/* this one is provided for easy code tracing.
 
45
 * Usage: TRACE(sess||0, fmt, args...);
 
46
 *        TRACE(sess, "");
 
47
 */
 
48
#define TRACE(sess, fmt, args...) do {                            \
 
49
        fprintf(stderr,                                           \
 
50
                "%d.%06d [%s:%d %s] [sess %p(%x)] " fmt "\n",      \
 
51
                (int)now.tv_sec, (int)now.tv_usec,                \
 
52
                __FILE__, __LINE__, __FUNCTION__,                 \
 
53
                sess, sess?((struct session *)sess)->uniq_id:~0U, \
 
54
                ##args);                                           \
 
55
        } while (0)
 
56
 
 
57
 
39
58
#endif /* _COMMON_DEBUG_H */