1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 * Copyright (c) International Business Machines Corp., 2000,2002
5 * Modified by Steve French (sfrench@us.ibm.com)
11 void cifs_dump_mem(char *label, void *data, int length);
12 void cifs_dump_detail(void *buf, struct TCP_Server_Info *ptcp_info);
13 void cifs_dump_mids(struct TCP_Server_Info *);
14 extern bool traceSMB; /* flag which enables the function below */
15 void dump_smb(void *, int);
16 #define CIFS_INFO 0x01
18 #define CIFS_TIMER 0x04
23 #ifdef CONFIG_CIFS_DEBUG2
34 #ifdef CONFIG_CIFS_DEBUG
38 * When adding tracepoints and debug messages we have various choices.
39 * Some considerations:
41 * Use cifs_dbg(VFS, ...) for things we always want logged, and the user to see
42 * cifs_info(...) slightly less important, admin can filter via loglevel > 6
43 * cifs_dbg(FYI, ...) minor debugging messages, off by default
44 * trace_smb3_* ftrace functions are preferred for complex debug messages
45 * intended for developers or experienced admins, off by default
48 /* Information level messages, minor events */
49 #define cifs_info_func(ratefunc, fmt, ...) \
51 pr_info_ ## ratefunc("CIFS: " fmt, ##__VA_ARGS__); \
54 #define cifs_info(fmt, ...) \
56 cifs_info_func(ratelimited, fmt, ##__VA_ARGS__); \
59 /* information message: e.g., configuration, major event */
60 #define cifs_dbg_func(ratefunc, type, fmt, ...) \
62 if ((type) & FYI && cifsFYI & CIFS_INFO) { \
63 pr_debug_ ## ratefunc("%s: " \
64 fmt, __FILE__, ##__VA_ARGS__); \
65 } else if ((type) & VFS) { \
66 pr_err_ ## ratefunc("CIFS VFS: " \
67 fmt, ##__VA_ARGS__); \
68 } else if ((type) & NOISY && (NOISY != 0)) { \
69 pr_debug_ ## ratefunc(fmt, ##__VA_ARGS__); \
73 #define cifs_dbg(type, fmt, ...) \
77 type, fmt, ##__VA_ARGS__); \
79 cifs_dbg_func(ratelimited, \
80 type, fmt, ##__VA_ARGS__); \
87 #else /* _CIFS_DEBUG */
88 #define cifs_dbg(type, fmt, ...) \
91 pr_debug(fmt, ##__VA_ARGS__); \
94 #define cifs_info(fmt, ...) \
96 pr_info("CIFS: "fmt, ##__VA_ARGS__); \
100 #endif /* _H_CIFS_DEBUG */