root/trunk/include/pvfs2-debug.h @ 8216

Revision 8216, 11.1 KB (checked in by bligon, 3 years ago)

Added functionality to the kernel module and client-core allowing the gossip debug
masks for either the client or the kernel to be modified AFTER the client-core is started.
Modified Files:

include/pvfs2-debug.h
src/apps/kernel/linux/pvfs2-client-core.c
src/common/misc/pvfs2-debug.c src/io/dev/pint-dev.c
src/io/dev/pint-dev.h src/kernel/linux-2.6/dcache.c
src/kernel/linux-2.6/devpvfs2-req.c
src/kernel/linux-2.6/pvfs2-dev-proto.h
src/kernel/linux-2.6/pvfs2-mod.c
src/kernel/linux-2.6/pvfs2-proc.c
src/kernel/linux-2.6/pvfs2-utils.c
src/kernel/linux-2.6/upcall.h

Line 
1/*
2 * (C) 2001 Clemson University and The University of Chicago
3 *
4 * See COPYING in top-level directory.
5 */
6
7/* This file just defines debugging masks to be used with the gossip
8 * logging utility.  All debugging masks for PVFS2 are kept here to make
9 * sure we don't have collisions.
10 */
11
12#ifndef __PVFS2_DEBUG_H
13#define __PVFS2_DEBUG_H
14
15#ifdef __KERNEL__
16#include <linux/types.h>
17#else
18#include <stdint.h>
19#endif
20
21#define GOSSIP_NO_DEBUG                (uint64_t)0
22#define GOSSIP_BMI_DEBUG_TCP           ((uint64_t)1 << 0)
23#define GOSSIP_BMI_DEBUG_CONTROL       ((uint64_t)1 << 1)
24#define GOSSIP_BMI_DEBUG_OFFSETS       ((uint64_t)1 << 2)
25#define GOSSIP_BMI_DEBUG_GM            ((uint64_t)1 << 3)
26#define GOSSIP_JOB_DEBUG               ((uint64_t)1 << 4)
27#define GOSSIP_SERVER_DEBUG            ((uint64_t)1 << 5)
28#define GOSSIP_STO_DEBUG_CTRL          ((uint64_t)1 << 6)
29#define GOSSIP_STO_DEBUG_DEFAULT       ((uint64_t)1 << 7)
30#define GOSSIP_FLOW_DEBUG              ((uint64_t)1 << 8)
31#define GOSSIP_BMI_DEBUG_GM_MEM        ((uint64_t)1 << 9)
32#define GOSSIP_REQUEST_DEBUG           ((uint64_t)1 << 10)
33#define GOSSIP_FLOW_PROTO_DEBUG        ((uint64_t)1 << 11)
34#define GOSSIP_NCACHE_DEBUG            ((uint64_t)1 << 12)
35#define GOSSIP_CLIENT_DEBUG            ((uint64_t)1 << 13)
36#define GOSSIP_REQ_SCHED_DEBUG         ((uint64_t)1 << 14)
37#define GOSSIP_ACACHE_DEBUG            ((uint64_t)1 << 15)
38#define GOSSIP_TROVE_DEBUG             ((uint64_t)1 << 16)
39#define GOSSIP_TROVE_OP_DEBUG          ((uint64_t)1 << 17)
40#define GOSSIP_DIST_DEBUG              ((uint64_t)1 << 18)
41#define GOSSIP_BMI_DEBUG_IB            ((uint64_t)1 << 19)
42#define GOSSIP_DBPF_ATTRCACHE_DEBUG    ((uint64_t)1 << 20)
43#define GOSSIP_MMAP_RCACHE_DEBUG       ((uint64_t)1 << 21)
44#define GOSSIP_LOOKUP_DEBUG            ((uint64_t)1 << 22)
45#define GOSSIP_REMOVE_DEBUG            ((uint64_t)1 << 23)
46#define GOSSIP_GETATTR_DEBUG           ((uint64_t)1 << 24)
47#define GOSSIP_READDIR_DEBUG           ((uint64_t)1 << 25)
48#define GOSSIP_IO_DEBUG                ((uint64_t)1 << 26)
49#define GOSSIP_DBPF_OPEN_CACHE_DEBUG   ((uint64_t)1 << 27)
50#define GOSSIP_PERMISSIONS_DEBUG       ((uint64_t)1 << 28)
51#define GOSSIP_CANCEL_DEBUG            ((uint64_t)1 << 29)
52#define GOSSIP_MSGPAIR_DEBUG           ((uint64_t)1 << 30)
53#define GOSSIP_CLIENTCORE_DEBUG        ((uint64_t)1 << 31)
54#define GOSSIP_CLIENTCORE_TIMING_DEBUG ((uint64_t)1 << 32)
55#define GOSSIP_SETATTR_DEBUG           ((uint64_t)1 << 33)
56#define GOSSIP_MKDIR_DEBUG             ((uint64_t)1 << 34)
57#define GOSSIP_VARSTRIP_DEBUG          ((uint64_t)1 << 35)
58#define GOSSIP_GETEATTR_DEBUG          ((uint64_t)1 << 36)
59#define GOSSIP_SETEATTR_DEBUG          ((uint64_t)1 << 37)
60#define GOSSIP_ENDECODE_DEBUG          ((uint64_t)1 << 38)
61#define GOSSIP_DELEATTR_DEBUG          ((uint64_t)1 << 39)
62#define GOSSIP_ACCESS_DEBUG            ((uint64_t)1 << 40)
63#define GOSSIP_ACCESS_DETAIL_DEBUG     ((uint64_t)1 << 41)
64#define GOSSIP_LISTEATTR_DEBUG         ((uint64_t)1 << 42)
65#define GOSSIP_PERFCOUNTER_DEBUG       ((uint64_t)1 << 43)
66#define GOSSIP_STATE_MACHINE_DEBUG     ((uint64_t)1 << 44)
67#define GOSSIP_DBPF_KEYVAL_DEBUG       ((uint64_t)1 << 45)
68#define GOSSIP_LISTATTR_DEBUG          ((uint64_t)1 << 46)
69#define GOSSIP_DBPF_COALESCE_DEBUG     ((uint64_t)1 << 47)
70#define GOSSIP_ACCESS_HOSTNAMES        ((uint64_t)1 << 48)
71#define GOSSIP_FSCK_DEBUG              ((uint64_t)1 << 49)
72#define GOSSIP_BMI_DEBUG_MX            ((uint64_t)1 << 50)
73#define GOSSIP_BSTREAM_DEBUG           ((uint64_t)1 << 51)
74#define GOSSIP_BMI_DEBUG_PORTALS       ((uint64_t)1 << 52)
75#define GOSSIP_USER_DEV_DEBUG          ((uint64_t)1 << 53)
76#define GOSSIP_DIRECTIO_DEBUG          ((uint64_t)1 << 54)
77#define GOSSIP_MGMT_DEBUG              ((uint64_t)1 << 55)
78
79#define GOSSIP_BMI_DEBUG_ALL (uint64_t)                               \
80(GOSSIP_BMI_DEBUG_TCP + GOSSIP_BMI_DEBUG_CONTROL +                    \
81 GOSSIP_BMI_DEBUG_GM + GOSSIP_BMI_DEBUG_OFFSETS + GOSSIP_BMI_DEBUG_IB \
82 + GOSSIP_BMI_DEBUG_MX + GOSSIP_BMI_DEBUG_PORTALS)
83
84uint64_t PVFS_debug_eventlog_to_mask(
85    const char *event_logging);
86
87const char *PVFS_debug_get_next_debug_keyword(
88    int position);
89
90#define GOSSIP_SUPER_DEBUG            ((uint64_t)1 << 0)
91#define GOSSIP_INODE_DEBUG            ((uint64_t)1 << 1)
92#define GOSSIP_FILE_DEBUG             ((uint64_t)1 << 2)
93#define GOSSIP_DIR_DEBUG              ((uint64_t)1 << 3)
94#define GOSSIP_UTILS_DEBUG            ((uint64_t)1 << 4)
95#define GOSSIP_WAIT_DEBUG             ((uint64_t)1 << 5)
96#define GOSSIP_ACL_DEBUG              ((uint64_t)1 << 6)
97#define GOSSIP_DCACHE_DEBUG           ((uint64_t)1 << 7)
98#define GOSSIP_DEV_DEBUG              ((uint64_t)1 << 8)
99#define GOSSIP_NAME_DEBUG             ((uint64_t)1 << 9)
100#define GOSSIP_BUFMAP_DEBUG           ((uint64_t)1 << 10)
101#define GOSSIP_CACHE_DEBUG            ((uint64_t)1 << 11)
102#define GOSSIP_PROC_DEBUG             ((uint64_t)1 << 12)
103#define GOSSIP_XATTR_DEBUG            ((uint64_t)1 << 13)
104#define GOSSIP_INIT_DEBUG             ((uint64_t)1 << 14)
105
106#define GOSSIP_MAX_NR                 15
107#define GOSSIP_MAX_DEBUG              (((uint64_t)1 << GOSSIP_MAX_NR) - 1)
108
109
110/*function prototypes*/
111uint64_t PVFS_kmod_eventlog_to_mask(const char *event_logging);
112uint64_t PVFS_debug_eventlog_to_mask(const char *event_logging);
113char * PVFS_debug_mask_to_eventlog(uint64_t mask);
114char * PVFS_kmod_mask_to_eventlog(uint64_t mask);
115
116/* a private internal type */
117typedef struct
118{
119    const char *keyword;
120    uint64_t mask_val;
121} __keyword_mask_t;
122
123#define __DEBUG_ALL ((uint64_t) -1)
124
125/* map all config keywords to pvfs2 debug masks here */
126static __keyword_mask_t s_keyword_mask_map[] =
127{
128    /* Log trove debugging info.  Same as 'trove'.*/
129    { "storage", GOSSIP_TROVE_DEBUG },
130    /* Log trove debugging info.  Same as 'storage'. */
131    { "trove", GOSSIP_TROVE_DEBUG },
132    /* Log trove operations. */
133    { "trove_op", GOSSIP_TROVE_OP_DEBUG },
134    /* Log network debug info. */
135    { "network", GOSSIP_BMI_DEBUG_ALL },
136    /* Log server info, including new operations. */
137    { "server", GOSSIP_SERVER_DEBUG },
138    /* Log client sysint info.  This is only useful for the client. */
139    { "client", GOSSIP_CLIENT_DEBUG },
140    /* Debug the varstrip distribution */
141    { "varstrip", GOSSIP_VARSTRIP_DEBUG },
142    /* Log job info */
143    { "job", GOSSIP_JOB_DEBUG },
144    /* Debug PINT_process_request calls.  EXTREMELY verbose! */
145    { "request", GOSSIP_REQUEST_DEBUG },
146    /* Log request scheduler events */
147    { "reqsched", GOSSIP_REQ_SCHED_DEBUG },
148    /* Log the flow protocol events, including flowproto_multiqueue */
149    { "flowproto", GOSSIP_FLOW_PROTO_DEBUG },
150    /* Log flow calls */
151    { "flow", GOSSIP_FLOW_DEBUG },
152    /* Debug the client name cache.  Only useful on the client. */
153    { "ncache", GOSSIP_NCACHE_DEBUG },
154    /* Debug read-ahead cache events.  Only useful on the client. */
155    { "mmaprcache", GOSSIP_MMAP_RCACHE_DEBUG },
156    /* Debug the attribute cache.  Only useful on the client. */
157    { "acache", GOSSIP_ACACHE_DEBUG },
158    /* Log/Debug distribution calls */
159    { "distribution", GOSSIP_DIST_DEBUG },
160    /* Debug the server-side dbpf attribute cache */
161    { "dbpfattrcache", GOSSIP_DBPF_ATTRCACHE_DEBUG },
162    /* Debug the client lookup state machine. */
163    { "lookup", GOSSIP_LOOKUP_DEBUG },
164    /* Debug the client remove state macine. */
165    { "remove", GOSSIP_REMOVE_DEBUG },
166    /* Debug the server getattr state machine. */
167    { "getattr", GOSSIP_GETATTR_DEBUG },
168    /* Debug the server setattr state machine. */
169    { "setattr", GOSSIP_SETATTR_DEBUG },
170    /* vectored getattr server state machine */
171    { "listattr", GOSSIP_LISTATTR_DEBUG },
172    /* Debug the client and server get ext attributes SM. */
173    { "geteattr", GOSSIP_GETEATTR_DEBUG },
174    /* Debug the client and server set ext attributes SM. */
175    { "seteattr", GOSSIP_SETEATTR_DEBUG },
176    /* Debug the readdir operation (client and server) */
177    { "readdir", GOSSIP_READDIR_DEBUG },
178    /* Debug the mkdir operation (server only) */
179    { "mkdir", GOSSIP_MKDIR_DEBUG },
180    /* Debug the io operation (reads and writes)
181     * for both the client and server */
182    { "io", GOSSIP_IO_DEBUG },
183    /* Debug the server's open file descriptor cache */
184    { "open_cache", GOSSIP_DBPF_OPEN_CACHE_DEBUG },
185    /* Debug permissions checking on the server */
186    { "permissions", GOSSIP_PERMISSIONS_DEBUG },
187    /* Debug the cancel operation */
188    { "cancel", GOSSIP_CANCEL_DEBUG },
189    /* Debug the msgpair state machine */
190    { "msgpair", GOSSIP_MSGPAIR_DEBUG },
191    /* Debug the client core app */
192    { "clientcore", GOSSIP_CLIENTCORE_DEBUG },
193    /* Debug the client timing state machines (job timeout, etc.) */
194    { "clientcore_timing", GOSSIP_CLIENTCORE_TIMING_DEBUG },
195    /* network encoding */
196    { "endecode", GOSSIP_ENDECODE_DEBUG },
197    /* Show server file (metadata) accesses (both modify and read-only). */
198    { "access", GOSSIP_ACCESS_DEBUG },
199    /* Show more detailed server file accesses */
200    { "access_detail", GOSSIP_ACCESS_DETAIL_DEBUG },
201    /* Debug the listeattr operation */
202    { "listeattr", GOSSIP_LISTEATTR_DEBUG },
203    /* Debug the state machine management code */
204    { "sm", GOSSIP_STATE_MACHINE_DEBUG },
205    /* Debug the metadata dbpf keyval functions */
206    { "keyval", GOSSIP_DBPF_KEYVAL_DEBUG },
207    /* Debug the metadata sync coalescing code */
208    { "coalesce", GOSSIP_DBPF_COALESCE_DEBUG },
209    /* Display the  hostnames instead of IP addrs in debug output */
210    { "access_hostnames", GOSSIP_ACCESS_HOSTNAMES },
211    /* Show the client device events */
212    { "user_dev", GOSSIP_USER_DEV_DEBUG },
213    /* Debug the fsck tool */
214    { "fsck", GOSSIP_FSCK_DEBUG },
215    /* Debug the bstream code */
216    { "bstream", GOSSIP_BSTREAM_DEBUG },
217    /* Debug trove in direct io mode */
218    {"directio", GOSSIP_DIRECTIO_DEBUG},
219    /* Everything except the periodic events.  Useful for debugging */
220    { "verbose",
221      (__DEBUG_ALL & ~(GOSSIP_PERFCOUNTER_DEBUG | GOSSIP_STATE_MACHINE_DEBUG |
222                       GOSSIP_ENDECODE_DEBUG | GOSSIP_USER_DEV_DEBUG))
223    },
224    /* No debug output */
225    { "none", GOSSIP_NO_DEBUG },
226    /* Everything */
227    { "all",  __DEBUG_ALL }
228};
229#undef __DEBUG_ALL
230
231/* map all kmod keywords to kmod debug masks here */
232static __keyword_mask_t s_kmod_keyword_mask_map[] =
233{
234    {"super" , GOSSIP_SUPER_DEBUG},
235    {"inode" , GOSSIP_INODE_DEBUG},
236    {"file"  , GOSSIP_FILE_DEBUG},
237    {"dir"   , GOSSIP_DIR_DEBUG},
238    {"utils" , GOSSIP_UTILS_DEBUG},
239    {"wait"  , GOSSIP_WAIT_DEBUG},
240    {"acl"   , GOSSIP_ACL_DEBUG},
241    {"dcache", GOSSIP_DCACHE_DEBUG},
242    {"dev"   , GOSSIP_DEV_DEBUG},
243    {"name"  , GOSSIP_NAME_DEBUG},
244    {"bufmap", GOSSIP_BUFMAP_DEBUG},
245    {"cache" , GOSSIP_CACHE_DEBUG},
246    {"proc"  , GOSSIP_PROC_DEBUG},
247    {"xattr" , GOSSIP_XATTR_DEBUG},
248    {"init"  , GOSSIP_INIT_DEBUG},
249    {"none"  , GOSSIP_NO_DEBUG},
250    {"all"   , GOSSIP_MAX_DEBUG}
251};
252
253static const int num_kmod_keyword_mask_map = (int)           \
254(sizeof(s_kmod_keyword_mask_map) / sizeof(__keyword_mask_t));
255
256static const int num_keyword_mask_map = (int)           \
257(sizeof(s_keyword_mask_map) / sizeof(__keyword_mask_t));
258
259#endif /* __PVFS2_DEBUG_H */
260
261/*
262 * Local variables:
263 *  c-indent-level: 4
264 *  c-basic-offset: 4
265 * End:
266 *
267 * vim: ts=8 sts=4 sw=4 expandtab
268 */
Note: See TracBrowser for help on using the browser.