1 /* SPDX-License-Identifier: GPL-2.0 */ 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 2 /* 3 * (C) 2001 Clemson University and The Univers 3 * (C) 2001 Clemson University and The University of Chicago 4 * 4 * 5 * See COPYING in top-level directory. 5 * See COPYING in top-level directory. 6 */ 6 */ 7 7 8 /* This file just defines debugging masks to b 8 /* This file just defines debugging masks to be used with the gossip 9 * logging utility. All debugging masks for O 9 * logging utility. All debugging masks for ORANGEFS are kept here to make 10 * sure we don't have collisions. 10 * sure we don't have collisions. 11 */ 11 */ 12 12 13 #ifndef __ORANGEFS_DEBUG_H 13 #ifndef __ORANGEFS_DEBUG_H 14 #define __ORANGEFS_DEBUG_H 14 #define __ORANGEFS_DEBUG_H 15 15 16 #ifdef __KERNEL__ 16 #ifdef __KERNEL__ 17 #include <linux/types.h> 17 #include <linux/types.h> 18 #include <linux/kernel.h> 18 #include <linux/kernel.h> 19 #else 19 #else 20 #include <stdint.h> 20 #include <stdint.h> 21 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof( 21 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) 22 #endif 22 #endif 23 23 24 #define GOSSIP_NO_DEBUG (__u64 24 #define GOSSIP_NO_DEBUG (__u64)0 25 25 26 #define GOSSIP_SUPER_DEBUG ((__u6 26 #define GOSSIP_SUPER_DEBUG ((__u64)1 << 0) 27 #define GOSSIP_INODE_DEBUG ((__u6 27 #define GOSSIP_INODE_DEBUG ((__u64)1 << 1) 28 #define GOSSIP_FILE_DEBUG ((__u6 28 #define GOSSIP_FILE_DEBUG ((__u64)1 << 2) 29 #define GOSSIP_DIR_DEBUG ((__u6 29 #define GOSSIP_DIR_DEBUG ((__u64)1 << 3) 30 #define GOSSIP_UTILS_DEBUG ((__u6 30 #define GOSSIP_UTILS_DEBUG ((__u64)1 << 4) 31 #define GOSSIP_WAIT_DEBUG ((__u6 31 #define GOSSIP_WAIT_DEBUG ((__u64)1 << 5) 32 #define GOSSIP_ACL_DEBUG ((__u6 32 #define GOSSIP_ACL_DEBUG ((__u64)1 << 6) 33 #define GOSSIP_DCACHE_DEBUG ((__u6 33 #define GOSSIP_DCACHE_DEBUG ((__u64)1 << 7) 34 #define GOSSIP_DEV_DEBUG ((__u6 34 #define GOSSIP_DEV_DEBUG ((__u64)1 << 8) 35 #define GOSSIP_NAME_DEBUG ((__u6 35 #define GOSSIP_NAME_DEBUG ((__u64)1 << 9) 36 #define GOSSIP_BUFMAP_DEBUG ((__u6 36 #define GOSSIP_BUFMAP_DEBUG ((__u64)1 << 10) 37 #define GOSSIP_CACHE_DEBUG ((__u6 37 #define GOSSIP_CACHE_DEBUG ((__u64)1 << 11) 38 #define GOSSIP_DEBUGFS_DEBUG ((__u6 38 #define GOSSIP_DEBUGFS_DEBUG ((__u64)1 << 12) 39 #define GOSSIP_XATTR_DEBUG ((__u6 39 #define GOSSIP_XATTR_DEBUG ((__u64)1 << 13) 40 #define GOSSIP_INIT_DEBUG ((__u6 40 #define GOSSIP_INIT_DEBUG ((__u64)1 << 14) 41 #define GOSSIP_SYSFS_DEBUG ((__u6 41 #define GOSSIP_SYSFS_DEBUG ((__u64)1 << 15) 42 42 43 #define GOSSIP_MAX_NR 16 43 #define GOSSIP_MAX_NR 16 44 #define GOSSIP_MAX_DEBUG (((__u64 44 #define GOSSIP_MAX_DEBUG (((__u64)1 << GOSSIP_MAX_NR) - 1) 45 45 46 /* a private internal type */ 46 /* a private internal type */ 47 struct __keyword_mask_s { 47 struct __keyword_mask_s { 48 const char *keyword; 48 const char *keyword; 49 __u64 mask_val; 49 __u64 mask_val; 50 }; 50 }; 51 51 52 /* 52 /* 53 * Map all kmod keywords to kmod debug masks h 53 * Map all kmod keywords to kmod debug masks here. Keep this 54 * structure "packed": 54 * structure "packed": 55 * 55 * 56 * "all" is always last... 56 * "all" is always last... 57 * 57 * 58 * keyword mask_val index 58 * keyword mask_val index 59 * foo 1 0 59 * foo 1 0 60 * bar 2 1 60 * bar 2 1 61 * baz 4 2 61 * baz 4 2 62 * qux 8 3 62 * qux 8 3 63 * . . . 63 * . . . 64 */ 64 */ 65 static struct __keyword_mask_s s_kmod_keyword_ 65 static struct __keyword_mask_s s_kmod_keyword_mask_map[] = { 66 {"super", GOSSIP_SUPER_DEBUG}, 66 {"super", GOSSIP_SUPER_DEBUG}, 67 {"inode", GOSSIP_INODE_DEBUG}, 67 {"inode", GOSSIP_INODE_DEBUG}, 68 {"file", GOSSIP_FILE_DEBUG}, 68 {"file", GOSSIP_FILE_DEBUG}, 69 {"dir", GOSSIP_DIR_DEBUG}, 69 {"dir", GOSSIP_DIR_DEBUG}, 70 {"utils", GOSSIP_UTILS_DEBUG}, 70 {"utils", GOSSIP_UTILS_DEBUG}, 71 {"wait", GOSSIP_WAIT_DEBUG}, 71 {"wait", GOSSIP_WAIT_DEBUG}, 72 {"acl", GOSSIP_ACL_DEBUG}, 72 {"acl", GOSSIP_ACL_DEBUG}, 73 {"dcache", GOSSIP_DCACHE_DEBUG}, 73 {"dcache", GOSSIP_DCACHE_DEBUG}, 74 {"dev", GOSSIP_DEV_DEBUG}, 74 {"dev", GOSSIP_DEV_DEBUG}, 75 {"name", GOSSIP_NAME_DEBUG}, 75 {"name", GOSSIP_NAME_DEBUG}, 76 {"bufmap", GOSSIP_BUFMAP_DEBUG}, 76 {"bufmap", GOSSIP_BUFMAP_DEBUG}, 77 {"cache", GOSSIP_CACHE_DEBUG}, 77 {"cache", GOSSIP_CACHE_DEBUG}, 78 {"debugfs", GOSSIP_DEBUGFS_DEBUG}, 78 {"debugfs", GOSSIP_DEBUGFS_DEBUG}, 79 {"xattr", GOSSIP_XATTR_DEBUG}, 79 {"xattr", GOSSIP_XATTR_DEBUG}, 80 {"init", GOSSIP_INIT_DEBUG}, 80 {"init", GOSSIP_INIT_DEBUG}, 81 {"sysfs", GOSSIP_SYSFS_DEBUG}, 81 {"sysfs", GOSSIP_SYSFS_DEBUG}, 82 {"none", GOSSIP_NO_DEBUG}, 82 {"none", GOSSIP_NO_DEBUG}, 83 {"all", GOSSIP_MAX_DEBUG} 83 {"all", GOSSIP_MAX_DEBUG} 84 }; 84 }; 85 85 86 static const int num_kmod_keyword_mask_map = ( 86 static const int num_kmod_keyword_mask_map = (int) 87 (ARRAY_SIZE(s_kmod_keyword_mask_map)); 87 (ARRAY_SIZE(s_kmod_keyword_mask_map)); 88 88 89 #endif /* __ORANGEFS_DEBUG_H */ 89 #endif /* __ORANGEFS_DEBUG_H */ 90 90
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.