xrootd
XrdBwmTrace.hh
Go to the documentation of this file.
1 #ifndef ___BWM_TRACE_H___
2 #define ___BWM_TRACE_H___
3 /******************************************************************************/
4 /* */
5 /* X r d B w m T r a c e . h h */
6 /* */
7 /* (C) 2008 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC02-76-SFO0515 with the Deprtment of Energy */
11 /******************************************************************************/
12 
13 // $Id$
14 
15 #ifndef NODEBUG
16 
17 #include "XrdSys/XrdSysHeaders.hh"
18 #include "XrdOuc/XrdOucTrace.hh"
19 
20 extern XrdOucTrace BwmTrace;
21 
22 #define GTRACE(act) BwmTrace.What & TRACE_ ## act
23 
24 #define TRACES(x) \
25  {BwmTrace.Beg(epname,tident); cerr <<x; BwmTrace.End();}
26 
27 #define FTRACE(act, x) \
28  if (GTRACE(act)) \
29  TRACES(x <<" fn=" << (oh->Name()))
30 
31 #define XTRACE(act, target, x) \
32  if (GTRACE(act)) TRACES(x <<" fn=" <<target)
33 
34 #define ZTRACE(act, x) if (GTRACE(act)) TRACES(x)
35 
36 #define DEBUG(x) if (GTRACE(debug)) TRACES(x)
37 
38 #define EPNAME(x) static const char *epname = x;
39 
40 #else
41 
42 #define FTRACE(x, y)
43 #define GTRACE(x) 0
44 #define TRACES(x)
45 #define XTRACE(x, y, a1)
46 #define YTRACE(x, y, a1, a2, a3, a4, a5)
47 #define ZTRACE(x, y)
48 #define DEBUG(x)
49 #define EPNAME(x)
50 
51 #endif
52 
53 // Trace flags
54 //
55 #define TRACE_ALL 0xffff
56 #define TRACE_calls 0x0001
57 #define TRACE_delay 0x0002
58 #define TRACE_sched 0x0004
59 #define TRACE_tokens 0x0008
60 #define TRACE_debug 0x8000
61 
62 #endif