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