xrootd
Loading...
Searching...
No Matches
XrdOfsTrace.hh
Go to the documentation of this file.
1#ifndef ___OFS_TRACE_H___
2#define ___OFS_TRACE_H___
3/******************************************************************************/
4/* */
5/* X r d O f s T r a c e . h h */
6/* */
7/* (C) 2003 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
36#include "XrdSys/XrdSysTrace.hh"
37#include "XrdOfs/XrdOfs.hh"
38
39#define GTRACE(act) OfsTrace.What & TRACE_ ## act
40
41#define TRACES(x) {SYSTRACE(OfsTrace.,tident,epname,0,x)}
42
43#define FTRACE(act, x) \
44 if (GTRACE(act)) \
45 TRACES(x <<" fn=" << (oh->Name()))
46
47#define XTRACE(act, target, x) \
48 if (GTRACE(act)) TRACES(x <<" fn=" <<target)
49
50#define ZTRACE(act, x) if (GTRACE(act)) TRACES(x)
51
52#define DEBUG(x) if (GTRACE(debug)) TRACES(x)
53
54#define EPNAME(x) static const char *epname = x;
55
56#else
57
58#define FTRACE(x, y)
59#define GTRACE(x) 0
60#define TRACES(x)
61#define XTRACE(x, y, a1)
62#define YTRACE(x, y, a1, a2, a3, a4, a5)
63#define ZTRACE(x, y)
64#define DEBUG(x)
65#define EPNAME(x)
66
67#endif
68
69// Trace flags
70//
71#define TRACE_MOST 0x3fcd
72#define TRACE_ALL 0xffff
73#define TRACE_opendir 0x0001
74#define TRACE_readdir 0x0002
75#define TRACE_closedir TRACE_opendir
76#define TRACE_delay 0x0400
77#define TRACE_dir TRACE_opendir | TRACE_readdir | TRACE_closedir
78#define TRACE_open 0x0004
79#define TRACE_qscan 0x0008
80#define TRACE_close TRACE_open
81#define TRACE_read 0x0010
82#define TRACE_redirect 0x0800
83#define TRACE_write 0x0020
84#define TRACE_IO TRACE_read | TRACE_write | TRACE_aio
85#define TRACE_exists 0x0040
86#define TRACE_chmod TRACE_exists
87#define TRACE_getmode TRACE_exists
88#define TRACE_getsize TRACE_exists
89#define TRACE_remove 0x0080
90#define TRACE_rename TRACE_remove
91#define TRACE_sync 0x0100
92#define TRACE_truncate 0x0200
93#define TRACE_fsctl 0x0400
94#define TRACE_getstats 0x0800
95#define TRACE_mkdir 0x1000
96#define TRACE_stat 0x2000
97#define TRACE_aio 0x4000
98#define TRACE_debug 0x008000
99#define TRACE_chkpnt 0x010000
100
101#endif