home *** CD-ROM | disk | FTP | other *** search
/ ftp.parl.clemson.edu / 2015-02-07.ftp.parl.clemson.edu.tar / ftp.parl.clemson.edu / pub / pvfs2 / orangefs-2.8.3-20110323.tar.gz / orangefs-2.8.3-20110323.tar / orangefs / include / pvfs2-debug.h < prev    next >
C/C++ Source or Header  |  2010-07-23  |  11KB  |  269 lines

  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. #define GOSSIP_MIRROR_DEBUG            ((uint64_t)1 << 56)
  79.  
  80. #define GOSSIP_BMI_DEBUG_ALL (uint64_t)                               \
  81. (GOSSIP_BMI_DEBUG_TCP + GOSSIP_BMI_DEBUG_CONTROL +                    \
  82.  GOSSIP_BMI_DEBUG_GM + GOSSIP_BMI_DEBUG_OFFSETS + GOSSIP_BMI_DEBUG_IB \
  83.  + GOSSIP_BMI_DEBUG_MX + GOSSIP_BMI_DEBUG_PORTALS)
  84.  
  85. const char *PVFS_debug_get_next_debug_keyword(
  86.     int position);
  87.  
  88. #define GOSSIP_SUPER_DEBUG            ((uint64_t)1 << 0)
  89. #define GOSSIP_INODE_DEBUG            ((uint64_t)1 << 1)
  90. #define GOSSIP_FILE_DEBUG             ((uint64_t)1 << 2)
  91. #define GOSSIP_DIR_DEBUG              ((uint64_t)1 << 3)
  92. #define GOSSIP_UTILS_DEBUG            ((uint64_t)1 << 4)
  93. #define GOSSIP_WAIT_DEBUG             ((uint64_t)1 << 5)
  94. #define GOSSIP_ACL_DEBUG              ((uint64_t)1 << 6)
  95. #define GOSSIP_DCACHE_DEBUG           ((uint64_t)1 << 7)
  96. #define GOSSIP_DEV_DEBUG              ((uint64_t)1 << 8)
  97. #define GOSSIP_NAME_DEBUG             ((uint64_t)1 << 9)
  98. #define GOSSIP_BUFMAP_DEBUG           ((uint64_t)1 << 10)
  99. #define GOSSIP_CACHE_DEBUG            ((uint64_t)1 << 11)
  100. #define GOSSIP_PROC_DEBUG             ((uint64_t)1 << 12)
  101. #define GOSSIP_XATTR_DEBUG            ((uint64_t)1 << 13)
  102. #define GOSSIP_INIT_DEBUG             ((uint64_t)1 << 14)
  103.  
  104. #define GOSSIP_MAX_NR                 15
  105. #define GOSSIP_MAX_DEBUG              (((uint64_t)1 << GOSSIP_MAX_NR) - 1)
  106.  
  107.  
  108. /*function prototypes*/
  109. uint64_t PVFS_kmod_eventlog_to_mask(const char *event_logging);
  110. uint64_t PVFS_debug_eventlog_to_mask(const char *event_logging);
  111. char * PVFS_debug_mask_to_eventlog(uint64_t mask);
  112. char * PVFS_kmod_mask_to_eventlog(uint64_t mask);
  113.  
  114. /* a private internal type */
  115. typedef struct 
  116. {
  117.     const char *keyword;
  118.     uint64_t mask_val;
  119. } __keyword_mask_t;
  120.  
  121. #define __DEBUG_ALL ((uint64_t) -1)
  122.  
  123. /* map all config keywords to pvfs2 debug masks here */
  124. static __keyword_mask_t s_keyword_mask_map[] =
  125. {
  126.     /* Log trove debugging info.  Same as 'trove'.*/
  127.     { "storage", GOSSIP_TROVE_DEBUG },
  128.     /* Log trove debugging info.  Same as 'storage'. */
  129.     { "trove", GOSSIP_TROVE_DEBUG },
  130.     /* Log trove operations. */
  131.     { "trove_op", GOSSIP_TROVE_OP_DEBUG },
  132.     /* Log network debug info. */
  133.     { "network", GOSSIP_BMI_DEBUG_ALL },
  134.     /* Log server info, including new operations. */
  135.     { "server", GOSSIP_SERVER_DEBUG },
  136.     /* Log client sysint info.  This is only useful for the client. */
  137.     { "client", GOSSIP_CLIENT_DEBUG },
  138.     /* Debug the varstrip distribution */
  139.     { "varstrip", GOSSIP_VARSTRIP_DEBUG },
  140.     /* Log job info */
  141.     { "job", GOSSIP_JOB_DEBUG },
  142.     /* Debug PINT_process_request calls.  EXTREMELY verbose! */
  143.     { "request", GOSSIP_REQUEST_DEBUG },
  144.     /* Log request scheduler events */
  145.     { "reqsched", GOSSIP_REQ_SCHED_DEBUG },
  146.     /* Log the flow protocol events, including flowproto_multiqueue */
  147.     { "flowproto", GOSSIP_FLOW_PROTO_DEBUG },
  148.     /* Log flow calls */
  149.     { "flow", GOSSIP_FLOW_DEBUG },
  150.     /* Debug the client name cache.  Only useful on the client. */
  151.     { "ncache", GOSSIP_NCACHE_DEBUG },
  152.     /* Debug read-ahead cache events.  Only useful on the client. */
  153.     { "mmaprcache", GOSSIP_MMAP_RCACHE_DEBUG },
  154.     /* Debug the attribute cache.  Only useful on the client. */
  155.     { "acache", GOSSIP_ACACHE_DEBUG },
  156.     /* Log/Debug distribution calls */
  157.     { "distribution", GOSSIP_DIST_DEBUG },
  158.     /* Debug the server-side dbpf attribute cache */
  159.     { "dbpfattrcache", GOSSIP_DBPF_ATTRCACHE_DEBUG },
  160.     /* Debug the client lookup state machine. */
  161.     { "lookup", GOSSIP_LOOKUP_DEBUG },
  162.     /* Debug the client remove state macine. */
  163.     { "remove", GOSSIP_REMOVE_DEBUG },
  164.     /* Debug the server getattr state machine. */
  165.     { "getattr", GOSSIP_GETATTR_DEBUG },
  166.     /* Debug the server setattr state machine. */
  167.     { "setattr", GOSSIP_SETATTR_DEBUG },
  168.     /* vectored getattr server state machine */
  169.     { "listattr", GOSSIP_LISTATTR_DEBUG },
  170.     /* Debug the client and server get ext attributes SM. */
  171.     { "geteattr", GOSSIP_GETEATTR_DEBUG },
  172.     /* Debug the client and server set ext attributes SM. */
  173.     { "seteattr", GOSSIP_SETEATTR_DEBUG },
  174.     /* Debug the readdir operation (client and server) */
  175.     { "readdir", GOSSIP_READDIR_DEBUG },
  176.     /* Debug the mkdir operation (server only) */
  177.     { "mkdir", GOSSIP_MKDIR_DEBUG },
  178.     /* Debug the io operation (reads and writes) 
  179.      * for both the client and server */
  180.     { "io", GOSSIP_IO_DEBUG },
  181.     /* Debug the server's open file descriptor cache */
  182.     { "open_cache", GOSSIP_DBPF_OPEN_CACHE_DEBUG }, 
  183.     /* Debug permissions checking on the server */
  184.     { "permissions", GOSSIP_PERMISSIONS_DEBUG }, 
  185.     /* Debug the cancel operation */
  186.     { "cancel", GOSSIP_CANCEL_DEBUG },
  187.     /* Debug the msgpair state machine */
  188.     { "msgpair", GOSSIP_MSGPAIR_DEBUG },
  189.     /* Debug the client core app */
  190.     { "clientcore", GOSSIP_CLIENTCORE_DEBUG },
  191.     /* Debug the client timing state machines (job timeout, etc.) */
  192.     { "clientcore_timing", GOSSIP_CLIENTCORE_TIMING_DEBUG },
  193.     /* network encoding */
  194.     { "endecode", GOSSIP_ENDECODE_DEBUG },
  195.     /* Show server file (metadata) accesses (both modify and read-only). */ 
  196.     { "access", GOSSIP_ACCESS_DEBUG },
  197.     /* Show more detailed server file accesses */
  198.     { "access_detail", GOSSIP_ACCESS_DETAIL_DEBUG },
  199.     /* Debug the listeattr operation */
  200.     { "listeattr", GOSSIP_LISTEATTR_DEBUG },
  201.     /* Debug the state machine management code */
  202.     { "sm", GOSSIP_STATE_MACHINE_DEBUG },
  203.     /* Debug the metadata dbpf keyval functions */
  204.     { "keyval", GOSSIP_DBPF_KEYVAL_DEBUG },
  205.     /* Debug the metadata sync coalescing code */
  206.     { "coalesce", GOSSIP_DBPF_COALESCE_DEBUG },
  207.     /* Display the  hostnames instead of IP addrs in debug output */
  208.     { "access_hostnames", GOSSIP_ACCESS_HOSTNAMES },
  209.     /* Show the client device events */
  210.     { "user_dev", GOSSIP_USER_DEV_DEBUG },
  211.     /* Debug the fsck tool */
  212.     { "fsck", GOSSIP_FSCK_DEBUG },
  213.     /* Debug the bstream code */
  214.     { "bstream", GOSSIP_BSTREAM_DEBUG },
  215.     /* Debug trove in direct io mode */
  216.     {"directio", GOSSIP_DIRECTIO_DEBUG},
  217.     /* Debug mirroring process */
  218.     {"mirror",GOSSIP_MIRROR_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 */
  232. static __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.  
  253. static const int num_kmod_keyword_mask_map = (int)           \
  254. (sizeof(s_kmod_keyword_mask_map) / sizeof(__keyword_mask_t));
  255.  
  256. static 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.  */
  269.