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 #define S_UNDEFINED 0x00000001
65 #define S_MDC 0x00000002
66 #define S_MDS 0x00000004
67 #define S_OSC 0x00000008
68 #define S_OST 0x00000010
69 #define S_CLASS 0x00000020
70 #define S_LOG 0x00000040
71 #define S_LLITE 0x00000080
72 #define S_RPC 0x00000100
73 #define S_MGMT 0x00000200
74 #define S_LNET 0x00000400
75 #define S_LND 0x00000800 /* ALL LNDs */
76 #define S_PINGER 0x00001000
77 #define S_FILTER 0x00002000
78 #define S_LIBCFS 0x00004000
79 #define S_ECHO 0x00008000
80 #define S_LDLM 0x00010000
81 #define S_LOV 0x00020000
82 #define S_LQUOTA 0x00040000
83 #define S_OSD 0x00080000
84 #define S_LFSCK 0x00100000
85 #define S_SNAPSHOT 0x00200000
87 #define S_LMV 0x00800000 /* b_new_cmd */
89 #define S_SEC 0x02000000 /* upcall cache */
90 #define S_GSS 0x04000000 /* b_new_cmd */
92 #define S_MGC 0x10000000
93 #define S_MGS 0x20000000
94 #define S_FID 0x40000000 /* b_new_cmd */
95 #define S_FLD 0x80000000 /* b_new_cmd */
97 #define LIBCFS_DEBUG_SUBSYS_NAMES { \
98 "undefined", "mdc", "mds", "osc", "ost", "class", "log", \
99 "llite", "rpc", "mgmt", "lnet", "lnd", "pinger", "filter", \
100 "libcfs", "echo", "ldlm", "lov", "lquota", "osd", "lfsck", \
101 "snapshot", "", "lmv", "", "sec", "gss", "", "mgc", "mgs", \
104 /* Debugging masks (32 bits, non-overlapping) */
105 #define D_TRACE 0x00000001 /* ENTRY/EXIT markers */
106 #define D_INODE 0x00000002
107 #define D_SUPER 0x00000004
108 #define D_MALLOC 0x00000010 /* print malloc, free information */
109 #define D_CACHE 0x00000020 /* cache-related items */
110 #define D_INFO 0x00000040 /* general information */
111 #define D_IOCTL 0x00000080 /* ioctl related information */
112 #define D_NETERROR 0x00000100 /* network errors */
113 #define D_NET 0x00000200 /* network communications */
114 #define D_WARNING 0x00000400 /* CWARN(...) == CDEBUG (D_WARNING, ...) */
115 #define D_BUFFS 0x00000800
116 #define D_OTHER 0x00001000
117 #define D_DENTRY 0x00002000
118 #define D_NETTRACE 0x00004000
119 #define D_PAGE 0x00008000 /* bulk page handling */
120 #define D_DLMTRACE 0x00010000
121 #define D_ERROR 0x00020000 /* CERROR(...) == CDEBUG (D_ERROR, ...) */
122 #define D_EMERG 0x00040000 /* CEMERG(...) == CDEBUG (D_EMERG, ...) */
123 #define D_HA 0x00080000 /* recovery and failover */
124 #define D_RPCTRACE 0x00100000 /* for distributed debugging */
125 #define D_VFSTRACE 0x00200000
126 #define D_READA 0x00400000 /* read-ahead */
127 #define D_MMAP 0x00800000
128 #define D_CONFIG 0x01000000
129 #define D_CONSOLE 0x02000000
130 #define D_QUOTA 0x04000000
131 #define D_SEC 0x08000000
132 #define D_LFSCK 0x10000000 /* For both OI scrub and LFSCK */
133 #define D_HSM 0x20000000
134 #define D_SNAPSHOT 0x40000000 /* snapshot */
135 #define D_LAYOUT 0x80000000
137 #define LIBCFS_DEBUG_MASKS_NAMES { \
138 "trace", "inode", "super", "tty", "malloc", "cache", "info", \
139 "ioctl", "neterror", "net", "warning", "buffs", "other", \
140 "dentry", "nettrace", "page", "dlmtrace", "error", "emerg", \
141 "ha", "rpctrace", "vfstrace", "reada", "mmap", "config", \
142 "console", "quota", "sec", "lfsck", "hsm", "snapshot", "layout",\
145 #define D_CANTMASK (D_ERROR | D_EMERG | D_WARNING | D_CONSOLE)
147 #define LIBCFS_DEBUG_FILE_PATH_DEFAULT "/tmp/lustre-log"
149 #endif /* __UAPI_LIBCFS_DEBUG_H__ */