| 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 | |
|---|
| 84 | const char *PVFS_debug_get_next_debug_keyword( |
|---|
| 85 | int position); |
|---|
| 86 | |
|---|
| 87 | #define GOSSIP_SUPER_DEBUG ((uint64_t)1 << 0) |
|---|
| 88 | #define GOSSIP_INODE_DEBUG ((uint64_t)1 << 1) |
|---|
| 89 | #define GOSSIP_FILE_DEBUG ((uint64_t)1 << 2) |
|---|
| 90 | #define GOSSIP_DIR_DEBUG ((uint64_t)1 << 3) |
|---|
| 91 | #define GOSSIP_UTILS_DEBUG ((uint64_t)1 << 4) |
|---|
| 92 | #define GOSSIP_WAIT_DEBUG ((uint64_t)1 << 5) |
|---|
| 93 | #define GOSSIP_ACL_DEBUG ((uint64_t)1 << 6) |
|---|
| 94 | #define GOSSIP_DCACHE_DEBUG ((uint64_t)1 << 7) |
|---|
| 95 | #define GOSSIP_DEV_DEBUG ((uint64_t)1 << 8) |
|---|
| 96 | #define GOSSIP_NAME_DEBUG ((uint64_t)1 << 9) |
|---|
| 97 | #define GOSSIP_BUFMAP_DEBUG ((uint64_t)1 << 10) |
|---|
| 98 | #define GOSSIP_CACHE_DEBUG ((uint64_t)1 << 11) |
|---|
| 99 | #define GOSSIP_PROC_DEBUG ((uint64_t)1 << 12) |
|---|
| 100 | #define GOSSIP_XATTR_DEBUG ((uint64_t)1 << 13) |
|---|
| 101 | #define GOSSIP_INIT_DEBUG ((uint64_t)1 << 14) |
|---|
| 102 | |
|---|
| 103 | #define GOSSIP_MAX_NR 15 |
|---|
| 104 | #define GOSSIP_MAX_DEBUG (((uint64_t)1 << GOSSIP_MAX_NR) - 1) |
|---|
| 105 | |
|---|
| 106 | |
|---|
| 107 | /*function prototypes*/ |
|---|
| 108 | uint64_t PVFS_kmod_eventlog_to_mask(const char *event_logging); |
|---|
| 109 | uint64_t PVFS_debug_eventlog_to_mask(const char *event_logging); |
|---|
| 110 | char * PVFS_debug_mask_to_eventlog(uint64_t mask); |
|---|
| 111 | char * PVFS_kmod_mask_to_eventlog(uint64_t mask); |
|---|
| 112 | |
|---|
| 113 | /* a private internal type */ |
|---|
| 114 | typedef struct |
|---|
| 115 | { |
|---|
| 116 | const char *keyword; |
|---|
| 117 | uint64_t mask_val; |
|---|
| 118 | } __keyword_mask_t; |
|---|
| 119 | |
|---|
| 120 | #define __DEBUG_ALL ((uint64_t) -1) |
|---|
| 121 | |
|---|
| 122 | /* map all config keywords to pvfs2 debug masks here */ |
|---|
| 123 | static __keyword_mask_t s_keyword_mask_map[] = |
|---|
| 124 | { |
|---|
| 125 | /* Log trove debugging info. Same as 'trove'.*/ |
|---|
| 126 | { "storage", GOSSIP_TROVE_DEBUG }, |
|---|
| 127 | /* Log trove debugging info. Same as 'storage'. */ |
|---|
| 128 | { "trove", GOSSIP_TROVE_DEBUG }, |
|---|
| 129 | /* Log trove operations. */ |
|---|
| 130 | { "trove_op", GOSSIP_TROVE_OP_DEBUG }, |
|---|
| 131 | /* Log network debug info. */ |
|---|
| 132 | { "network", GOSSIP_BMI_DEBUG_ALL }, |
|---|
| 133 | /* Log server info, including new operations. */ |
|---|
| 134 | { "server", GOSSIP_SERVER_DEBUG }, |
|---|
| 135 | /* Log client sysint info. This is only useful for the client. */ |
|---|
| 136 | { "client", GOSSIP_CLIENT_DEBUG }, |
|---|
| 137 | /* Debug the varstrip distribution */ |
|---|
| 138 | { "varstrip", GOSSIP_VARSTRIP_DEBUG }, |
|---|
| 139 | /* Log job info */ |
|---|
| 140 | { "job", GOSSIP_JOB_DEBUG }, |
|---|
| 141 | /* Debug PINT_process_request calls. EXTREMELY verbose! */ |
|---|
| 142 | { "request", GOSSIP_REQUEST_DEBUG }, |
|---|
| 143 | /* Log request scheduler events */ |
|---|
| 144 | { "reqsched", GOSSIP_REQ_SCHED_DEBUG }, |
|---|
| 145 | /* Log the flow protocol events, including flowproto_multiqueue */ |
|---|
| 146 | { "flowproto", GOSSIP_FLOW_PROTO_DEBUG }, |
|---|
| 147 | /* Log flow calls */ |
|---|
| 148 | { "flow", GOSSIP_FLOW_DEBUG }, |
|---|
| 149 | /* Debug the client name cache. Only useful on the client. */ |
|---|
| 150 | { "ncache", GOSSIP_NCACHE_DEBUG }, |
|---|
| 151 | /* Debug read-ahead cache events. Only useful on the client. */ |
|---|
| 152 | { "mmaprcache", GOSSIP_MMAP_RCACHE_DEBUG }, |
|---|
| 153 | /* Debug the attribute cache. Only useful on the client. */ |
|---|
| 154 | { "acache", GOSSIP_ACACHE_DEBUG }, |
|---|
| 155 | /* Log/Debug distribution calls */ |
|---|
| 156 | { "distribution", GOSSIP_DIST_DEBUG }, |
|---|
| 157 | /* Debug the server-side dbpf attribute cache */ |
|---|
| 158 | { "dbpfattrcache", GOSSIP_DBPF_ATTRCACHE_DEBUG }, |
|---|
| 159 | /* Debug the client lookup state machine. */ |
|---|
| 160 | { "lookup", GOSSIP_LOOKUP_DEBUG }, |
|---|
| 161 | /* Debug the client remove state macine. */ |
|---|
| 162 | { "remove", GOSSIP_REMOVE_DEBUG }, |
|---|
| 163 | /* Debug the server getattr state machine. */ |
|---|
| 164 | { "getattr", GOSSIP_GETATTR_DEBUG }, |
|---|
| 165 | /* Debug the server setattr state machine. */ |
|---|
| 166 | { "setattr", GOSSIP_SETATTR_DEBUG }, |
|---|
| 167 | /* vectored getattr server state machine */ |
|---|
| 168 | { "listattr", GOSSIP_LISTATTR_DEBUG }, |
|---|
| 169 | /* Debug the client and server get ext attributes SM. */ |
|---|
| 170 | { "geteattr", GOSSIP_GETEATTR_DEBUG }, |
|---|
| 171 | /* Debug the client and server set ext attributes SM. */ |
|---|
| 172 | { "seteattr", GOSSIP_SETEATTR_DEBUG }, |
|---|
| 173 | /* Debug the readdir operation (client and server) */ |
|---|
| 174 | { "readdir", GOSSIP_READDIR_DEBUG }, |
|---|
| 175 | /* Debug the mkdir operation (server only) */ |
|---|
| 176 | { "mkdir", GOSSIP_MKDIR_DEBUG }, |
|---|
| 177 | /* Debug the io operation (reads and writes) |
|---|
| 178 | * for both the client and server */ |
|---|
| 179 | { "io", GOSSIP_IO_DEBUG }, |
|---|
| 180 | /* Debug the server's open file descriptor cache */ |
|---|
| 181 | { "open_cache", GOSSIP_DBPF_OPEN_CACHE_DEBUG }, |
|---|
| 182 | /* Debug permissions checking on the server */ |
|---|
| 183 | { "permissions", GOSSIP_PERMISSIONS_DEBUG }, |
|---|
| 184 | /* Debug the cancel operation */ |
|---|
| 185 | { "cancel", GOSSIP_CANCEL_DEBUG }, |
|---|
| 186 | /* Debug the msgpair state machine */ |
|---|
| 187 | { "msgpair", GOSSIP_MSGPAIR_DEBUG }, |
|---|
| 188 | /* Debug the client core app */ |
|---|
| 189 | { "clientcore", GOSSIP_CLIENTCORE_DEBUG }, |
|---|
| 190 | /* Debug the client timing state machines (job timeout, etc.) */ |
|---|
| 191 | { "clientcore_timing", GOSSIP_CLIENTCORE_TIMING_DEBUG }, |
|---|
| 192 | /* network encoding */ |
|---|
| 193 | { "endecode", GOSSIP_ENDECODE_DEBUG }, |
|---|
| 194 | /* Show server file (metadata) accesses (both modify and read-only). */ |
|---|
| 195 | { "access", GOSSIP_ACCESS_DEBUG }, |
|---|
| 196 | /* Show more detailed server file accesses */ |
|---|
| 197 | { "access_detail", GOSSIP_ACCESS_DETAIL_DEBUG }, |
|---|
| 198 | /* Debug the listeattr operation */ |
|---|
| 199 | { "listeattr", GOSSIP_LISTEATTR_DEBUG }, |
|---|
| 200 | /* Debug the state machine management code */ |
|---|
| 201 | { "sm", GOSSIP_STATE_MACHINE_DEBUG }, |
|---|
| 202 | /* Debug the metadata dbpf keyval functions */ |
|---|
| 203 | { "keyval", GOSSIP_DBPF_KEYVAL_DEBUG }, |
|---|
| 204 | /* Debug the metadata sync coalescing code */ |
|---|
| 205 | { "coalesce", GOSSIP_DBPF_COALESCE_DEBUG }, |
|---|
| 206 | /* Display the hostnames instead of IP addrs in debug output */ |
|---|
| 207 | { "access_hostnames", GOSSIP_ACCESS_HOSTNAMES }, |
|---|
| 208 | /* Show the client device events */ |
|---|
| 209 | { "user_dev", GOSSIP_USER_DEV_DEBUG }, |
|---|
| 210 | /* Debug the fsck tool */ |
|---|
| 211 | { "fsck", GOSSIP_FSCK_DEBUG }, |
|---|
| 212 | /* Debug the bstream code */ |
|---|
| 213 | { "bstream", GOSSIP_BSTREAM_DEBUG }, |
|---|
| 214 | /* Debug trove in direct io mode */ |
|---|
| 215 | {"directio", GOSSIP_DIRECTIO_DEBUG}, |
|---|
| 216 | /* Everything except the periodic events. Useful for debugging */ |
|---|
| 217 | { "verbose", |
|---|
| 218 | (__DEBUG_ALL & ~(GOSSIP_PERFCOUNTER_DEBUG | GOSSIP_STATE_MACHINE_DEBUG | |
|---|
| 219 | GOSSIP_ENDECODE_DEBUG | GOSSIP_USER_DEV_DEBUG)) |
|---|
| 220 | }, |
|---|
| 221 | /* No debug output */ |
|---|
| 222 | { "none", GOSSIP_NO_DEBUG }, |
|---|
| 223 | /* Everything */ |
|---|
| 224 | { "all", __DEBUG_ALL } |
|---|
| 225 | }; |
|---|
| 226 | #undef __DEBUG_ALL |
|---|
| 227 | |
|---|
| 228 | /* map all kmod keywords to kmod debug masks here */ |
|---|
| 229 | static __keyword_mask_t s_kmod_keyword_mask_map[] = |
|---|
| 230 | { |
|---|
| 231 | {"super" , GOSSIP_SUPER_DEBUG}, |
|---|
| 232 | {"inode" , GOSSIP_INODE_DEBUG}, |
|---|
| 233 | {"file" , GOSSIP_FILE_DEBUG}, |
|---|
| 234 | {"dir" , GOSSIP_DIR_DEBUG}, |
|---|
| 235 | {"utils" , GOSSIP_UTILS_DEBUG}, |
|---|
| 236 | {"wait" , GOSSIP_WAIT_DEBUG}, |
|---|
| 237 | {"acl" , GOSSIP_ACL_DEBUG}, |
|---|
| 238 | {"dcache", GOSSIP_DCACHE_DEBUG}, |
|---|
| 239 | {"dev" , GOSSIP_DEV_DEBUG}, |
|---|
| 240 | {"name" , GOSSIP_NAME_DEBUG}, |
|---|
| 241 | {"bufmap", GOSSIP_BUFMAP_DEBUG}, |
|---|
| 242 | {"cache" , GOSSIP_CACHE_DEBUG}, |
|---|
| 243 | {"proc" , GOSSIP_PROC_DEBUG}, |
|---|
| 244 | {"xattr" , GOSSIP_XATTR_DEBUG}, |
|---|
| 245 | {"init" , GOSSIP_INIT_DEBUG}, |
|---|
| 246 | {"none" , GOSSIP_NO_DEBUG}, |
|---|
| 247 | {"all" , GOSSIP_MAX_DEBUG} |
|---|
| 248 | }; |
|---|
| 249 | |
|---|
| 250 | static const int num_kmod_keyword_mask_map = (int) \ |
|---|
| 251 | (sizeof(s_kmod_keyword_mask_map) / sizeof(__keyword_mask_t)); |
|---|
| 252 | |
|---|
| 253 | static const int num_keyword_mask_map = (int) \ |
|---|
| 254 | (sizeof(s_keyword_mask_map) / sizeof(__keyword_mask_t)); |
|---|
| 255 | |
|---|
| 256 | #endif /* __PVFS2_DEBUG_H */ |
|---|
| 257 | |
|---|
| 258 | /* |
|---|
| 259 | * Local variables: |
|---|
| 260 | * c-indent-level: 4 |
|---|
| 261 | * c-basic-offset: 4 |
|---|
| 262 | * End: |
|---|
| 263 | * |
|---|
| 264 | * vim: ts=8 sts=4 sw=4 expandtab |
|---|
| 265 | */ |
|---|