Whamcloud - gitweb
LU-17871 ldlm: FLOCK ownlocks may be not set
[fs/lustre-release.git] / lnet / include / uapi / linux / lnet / libcfs_debug.h
1 // SPDX-License-Identifier: GPL-2.0
2
3 /* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
4  * Use is subject to license terms.
5  *
6  * Copyright (c) 2012, 2014, Intel Corporation.
7  */
8
9 /* This file is part of Lustre, http://www.lustre.org/
10  *
11  * Debug messages and assertions
12  */
13
14 #ifndef __UAPI_LIBCFS_DEBUG_H__
15 #define __UAPI_LIBCFS_DEBUG_H__
16
17 #include <linux/types.h>
18
19 /**
20  * Format for debug message headers
21  */
22 struct ptldebug_header {
23         __u32 ph_len;
24         __u32 ph_flags;
25         __u32 ph_subsys;
26         __u32 ph_mask;
27         __u16 ph_cpu_id;
28         __u16 ph_type;
29         /* time_t overflow in 2106 */
30         __u32 ph_sec;
31         __u64 ph_usec;
32         __u32 ph_stack;
33         __u32 ph_pid;
34         __u32 ph_extern_pid;
35         __u32 ph_line_num;
36 } __attribute__((packed));
37
38 #define PH_FLAG_FIRST_RECORD    1
39
40 /* Debugging subsystems (32 bits, non-overlapping) */
41 enum libcfs_debug_subsys {
42         S_UNDEFINED     = 0x00000001,
43         S_MDC           = 0x00000002,
44         S_MDS           = 0x00000004,
45         S_OSC           = 0x00000008,
46         S_OST           = 0x00000010,
47         S_CLASS         = 0x00000020,
48         S_LOG           = 0x00000040,
49         S_LLITE         = 0x00000080,
50         S_RPC           = 0x00000100,
51         S_MGMT          = 0x00000200,
52         S_LNET          = 0x00000400,
53         S_LND           = 0x00000800, /* ALL LNDs */
54         S_PINGER        = 0x00001000,
55         S_FILTER        = 0x00002000,
56         S_LIBCFS        = 0x00004000,
57         S_ECHO          = 0x00008000,
58         S_LDLM          = 0x00010000,
59         S_LOV           = 0x00020000,
60         S_LQUOTA        = 0x00040000,
61         S_OSD           = 0x00080000,
62         S_LFSCK         = 0x00100000,
63         S_SNAPSHOT      = 0x00200000,
64 /* unused */
65         S_LMV           = 0x00800000,
66 /* unused */
67         S_SEC           = 0x02000000, /* upcall cache */
68         S_GSS           = 0x04000000,
69 /* unused */
70         S_MGC           = 0x10000000,
71         S_MGS           = 0x20000000,
72         S_FID           = 0x40000000,
73         S_FLD           = 0x80000000,
74 };
75 #define LIBCFS_S_DEFAULT (~0)
76
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",      \
82         "fid", "fld", NULL }
83
84 /* Debugging masks (32 bits, non-overlapping) */
85 enum libcfs_debug_masks {
86         D_TRACE         = 0x00000001, /* ENTRY/EXIT markers */
87         D_INODE         = 0x00000002,
88         D_SUPER         = 0x00000004,
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, ...) */
97         D_BUFFS         = 0x00000800,
98         D_OTHER         = 0x00001000,
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 */
109         D_MMAP          = 0x00800000,
110         D_CONFIG        = 0x01000000,
111         D_CONSOLE       = 0x02000000,
112         D_QUOTA         = 0x04000000,
113         D_SEC           = 0x08000000,
114         D_LFSCK         = 0x10000000, /* For both OI scrub and LFSCK */
115         D_HSM           = 0x20000000,
116         D_SNAPSHOT      = 0x40000000,
117         D_LAYOUT        = 0x80000000,
118 };
119 #define LIBCFS_D_DEFAULT (D_CANTMASK | D_NETERROR | D_HA | D_CONFIG | D_IOCTL |\
120                           D_LFSCK)
121
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",\
128         NULL }
129
130 #define D_CANTMASK   (D_ERROR | D_EMERG | D_WARNING | D_CONSOLE)
131
132 #define LIBCFS_DEBUG_FILE_PATH_DEFAULT "/tmp/lustre-log"
133
134 #endif  /* __UAPI_LIBCFS_DEBUG_H__ */