1 // SPDX-License-Identifier: GPL-2.0
3 /* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
4 * Use is subject to license terms.
6 * Copyright (c) 2012, 2014, Intel Corporation.
9 /* This file is part of Lustre, http://www.lustre.org/
11 * Debug messages and assertions
14 #ifndef __UAPI_LIBCFS_DEBUG_H__
15 #define __UAPI_LIBCFS_DEBUG_H__
17 #include <linux/types.h>
20 * Format for debug message headers
22 struct ptldebug_header {
29 /* time_t overflow in 2106 */
36 } __attribute__((packed));
38 #define PH_FLAG_FIRST_RECORD 1
40 /* Debugging subsystems (32 bits, non-overlapping) */
41 enum libcfs_debug_subsys {
42 S_UNDEFINED = 0x00000001,
53 S_LND = 0x00000800, /* ALL LNDs */
54 S_PINGER = 0x00001000,
55 S_FILTER = 0x00002000,
56 S_LIBCFS = 0x00004000,
60 S_LQUOTA = 0x00040000,
63 S_SNAPSHOT = 0x00200000,
67 S_SEC = 0x02000000, /* upcall cache */
75 #define LIBCFS_S_DEFAULT (~0)
77 #define LIBCFS_DEBUG_SUBSYS_NAMES { \
78 "undefined", "mdc", "mds", "osc", "ost", "class", "log", \
79 "llite", "rpc", "mgmt", "lnet", "lnd", "pinger", "filter", \
80 "libcfs", "echo", "ldlm", "lov", "lquota", "osd", "lfsck", \
81 "snapshot", "", "lmv", "", "sec", "gss", "", "mgc", "mgs", \
84 /* Debugging masks (32 bits, non-overlapping) */
85 enum libcfs_debug_masks {
86 D_TRACE = 0x00000001, /* ENTRY/EXIT markers */
89 D_IOTRACE = 0x00000008, /* simple, low overhead io tracing */
90 D_MALLOC = 0x00000010, /* print malloc, free information */
91 D_CACHE = 0x00000020, /* cache-related items */
92 D_INFO = 0x00000040, /* general information */
93 D_IOCTL = 0x00000080, /* ioctl related information */
94 D_NETERROR = 0x00000100, /* network errors */
95 D_NET = 0x00000200, /* network communications */
96 D_WARNING = 0x00000400, /* CWARN(...) == CDEBUG(D_WARNING, ...) */
99 D_DENTRY = 0x00002000,
100 D_NETTRACE = 0x00004000,
101 D_PAGE = 0x00008000, /* bulk page handling */
102 D_DLMTRACE = 0x00010000,
103 D_ERROR = 0x00020000, /* CERROR(...) == CDEBUG(D_ERROR, ...) */
104 D_EMERG = 0x00040000, /* CEMERG(...) == CDEBUG(D_EMERG, ...) */
105 D_HA = 0x00080000, /* recovery and failover */
106 D_RPCTRACE = 0x00100000, /* for distributed debugging */
107 D_VFSTRACE = 0x00200000,
108 D_READA = 0x00400000, /* read-ahead */
110 D_CONFIG = 0x01000000,
111 D_CONSOLE = 0x02000000,
112 D_QUOTA = 0x04000000,
114 D_LFSCK = 0x10000000, /* For both OI scrub and LFSCK */
116 D_SNAPSHOT = 0x40000000,
117 D_LAYOUT = 0x80000000,
119 #define LIBCFS_D_DEFAULT (D_CANTMASK | D_NETERROR | D_HA | D_CONFIG | D_IOCTL |\
122 #define LIBCFS_DEBUG_MASKS_NAMES { \
123 "trace", "inode", "super", "iotrace", "malloc", "cache", "info",\
124 "ioctl", "neterror", "net", "warning", "buffs", "other", \
125 "dentry", "nettrace", "page", "dlmtrace", "error", "emerg", \
126 "ha", "rpctrace", "vfstrace", "reada", "mmap", "config", \
127 "console", "quota", "sec", "lfsck", "hsm", "snapshot", "layout",\
130 #define D_CANTMASK (D_ERROR | D_EMERG | D_WARNING | D_CONSOLE)
132 #define LIBCFS_DEBUG_FILE_PATH_DEFAULT "/tmp/lustre-log"
134 #endif /* __UAPI_LIBCFS_DEBUG_H__ */