4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 only,
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License version 2 for more details (a copy is included
14 * in the LICENSE file that accompanied this code).
16 * You should have received a copy of the GNU General Public License
17 * version 2 along with this program; If not, see
18 * http://www.gnu.org/licenses/gpl-2.0.html
23 * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Use is subject to license terms.
26 * Copyright (c) 2012, 2014, Intel Corporation.
29 * This file is part of Lustre, http://www.lustre.org/
31 * libcfs/include/libcfs/libcfs_debug.h
33 * Debug messages and assertions
37 #ifndef __UAPI_LIBCFS_DEBUG_H__
38 #define __UAPI_LIBCFS_DEBUG_H__
40 #include <linux/types.h>
43 * Format for debug message headers
45 struct ptldebug_header {
52 /* time_t overflow in 2106 */
59 } __attribute__((packed));
61 #define PH_FLAG_FIRST_RECORD 1
63 /* Debugging subsystems (32 bits, non-overlapping) */
64 enum libcfs_debug_subsys {
65 S_UNDEFINED = 0x00000001,
76 S_LND = 0x00000800, /* ALL LNDs */
77 S_PINGER = 0x00001000,
78 S_FILTER = 0x00002000,
79 S_LIBCFS = 0x00004000,
83 S_LQUOTA = 0x00040000,
86 S_SNAPSHOT = 0x00200000,
90 S_SEC = 0x02000000, /* upcall cache */
98 #define LIBCFS_S_DEFAULT (~0)
100 #define LIBCFS_DEBUG_SUBSYS_NAMES { \
101 "undefined", "mdc", "mds", "osc", "ost", "class", "log", \
102 "llite", "rpc", "mgmt", "lnet", "lnd", "pinger", "filter", \
103 "libcfs", "echo", "ldlm", "lov", "lquota", "osd", "lfsck", \
104 "snapshot", "", "lmv", "", "sec", "gss", "", "mgc", "mgs", \
107 /* Debugging masks (32 bits, non-overlapping) */
108 enum libcfs_debug_masks {
109 D_TRACE = 0x00000001, /* ENTRY/EXIT markers */
110 D_INODE = 0x00000002,
111 D_SUPER = 0x00000004,
112 D_IOTRACE = 0x00000008, /* simple, low overhead io tracing */
113 D_MALLOC = 0x00000010, /* print malloc, free information */
114 D_CACHE = 0x00000020, /* cache-related items */
115 D_INFO = 0x00000040, /* general information */
116 D_IOCTL = 0x00000080, /* ioctl related information */
117 D_NETERROR = 0x00000100, /* network errors */
118 D_NET = 0x00000200, /* network communications */
119 D_WARNING = 0x00000400, /* CWARN(...) == CDEBUG(D_WARNING, ...) */
120 D_BUFFS = 0x00000800,
121 D_OTHER = 0x00001000,
122 D_DENTRY = 0x00002000,
123 D_NETTRACE = 0x00004000,
124 D_PAGE = 0x00008000, /* bulk page handling */
125 D_DLMTRACE = 0x00010000,
126 D_ERROR = 0x00020000, /* CERROR(...) == CDEBUG(D_ERROR, ...) */
127 D_EMERG = 0x00040000, /* CEMERG(...) == CDEBUG(D_EMERG, ...) */
128 D_HA = 0x00080000, /* recovery and failover */
129 D_RPCTRACE = 0x00100000, /* for distributed debugging */
130 D_VFSTRACE = 0x00200000,
131 D_READA = 0x00400000, /* read-ahead */
133 D_CONFIG = 0x01000000,
134 D_CONSOLE = 0x02000000,
135 D_QUOTA = 0x04000000,
137 D_LFSCK = 0x10000000, /* For both OI scrub and LFSCK */
139 D_SNAPSHOT = 0x40000000,
140 D_LAYOUT = 0x80000000,
142 #define LIBCFS_D_DEFAULT (D_CANTMASK | D_NETERROR | D_HA | D_CONFIG | D_IOCTL |\
145 #define LIBCFS_DEBUG_MASKS_NAMES { \
146 "trace", "inode", "super", "iotrace", "malloc", "cache", "info",\
147 "ioctl", "neterror", "net", "warning", "buffs", "other", \
148 "dentry", "nettrace", "page", "dlmtrace", "error", "emerg", \
149 "ha", "rpctrace", "vfstrace", "reada", "mmap", "config", \
150 "console", "quota", "sec", "lfsck", "hsm", "snapshot", "layout",\
153 #define D_CANTMASK (D_ERROR | D_EMERG | D_WARNING | D_CONSOLE)
155 #define LIBCFS_DEBUG_FILE_PATH_DEFAULT "/tmp/lustre-log"
157 #endif /* __UAPI_LIBCFS_DEBUG_H__ */