xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 /* This file is part of the XRootD software suite. */
13 /* */
14 /* XRootD is free software: you can redistribute it and/or modify it under */
15 /* the terms of the GNU Lesser General Public License as published by the */
16 /* Free Software Foundation, either version 3 of the License, or (at your */
17 /* option) any later version. */
18 /* */
19 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22 /* License for more details. */
23 /* */
24 /* You should have received a copy of the GNU Lesser General Public License */
25 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27 /* */
28 /* The copyright holder's institutional names and contributor's names may not */
29 /* be used to endorse or promote products derived from this software without */
30 /* specific prior written permission of the institution or contributor. */
31 /******************************************************************************/
32 
33 #ifndef NODEBUG
34 
35 #include "XrdSys/XrdSysHeaders.hh"
36 #include "XrdOuc/XrdOucTrace.hh"
37 
38 extern XrdOucTrace BwmTrace;
39 
40 #define GTRACE(act) BwmTrace.What & TRACE_ ## act
41 
42 #define TRACES(x) \
43  {BwmTrace.Beg(epname,tident); cerr <<x; BwmTrace.End();}
44 
45 #define FTRACE(act, x) \
46  if (GTRACE(act)) \
47  TRACES(x <<" fn=" << (oh->Name()))
48 
49 #define XTRACE(act, target, x) \
50  if (GTRACE(act)) TRACES(x <<" fn=" <<target)
51 
52 #define ZTRACE(act, x) if (GTRACE(act)) TRACES(x)
53 
54 #define DEBUG(x) if (GTRACE(debug)) TRACES(x)
55 
56 #define EPNAME(x) static const char *epname = x;
57 
58 #else
59 
60 #define FTRACE(x, y)
61 #define GTRACE(x) 0
62 #define TRACES(x)
63 #define XTRACE(x, y, a1)
64 #define YTRACE(x, y, a1, a2, a3, a4, a5)
65 #define ZTRACE(x, y)
66 #define DEBUG(x)
67 #define EPNAME(x)
68 
69 #endif
70 
71 // Trace flags
72 //
73 #define TRACE_ALL 0xffff
74 #define TRACE_calls 0x0001
75 #define TRACE_delay 0x0002
76 #define TRACE_sched 0x0004
77 #define TRACE_tokens 0x0008
78 #define TRACE_debug 0x8000
79 
80 #endif
Definition: XrdOucTrace.hh:35
XrdOucTrace BwmTrace