]>
Commit | Line | Data |
---|---|---|
de57606c SW |
1 | #ifndef _FS_CEPH_DEBUG_H |
2 | #define _FS_CEPH_DEBUG_H | |
3 | ||
4 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | |
5 | ||
6f4dbd14 ID |
6 | #include <linux/string.h> |
7 | ||
3d14c5d2 | 8 | #ifdef CONFIG_CEPH_LIB_PRETTYDEBUG |
de57606c SW |
9 | |
10 | /* | |
11 | * wrap pr_debug to include a filename:lineno prefix on each line. | |
12 | * this incurs some overhead (kernel size and execution time) due to | |
13 | * the extra function call at each call site. | |
14 | */ | |
15 | ||
16 | # if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG) | |
de57606c | 17 | # define dout(fmt, ...) \ |
3d14c5d2 YS |
18 | pr_debug("%.*s %12.12s:%-4d : " fmt, \ |
19 | 8 - (int)sizeof(KBUILD_MODNAME), " ", \ | |
6f4dbd14 | 20 | kbasename(__FILE__), __LINE__, ##__VA_ARGS__) |
de57606c SW |
21 | # else |
22 | /* faux printk call just to see any compiler warnings. */ | |
23 | # define dout(fmt, ...) do { \ | |
24 | if (0) \ | |
25 | printk(KERN_DEBUG fmt, ##__VA_ARGS__); \ | |
26 | } while (0) | |
27 | # endif | |
28 | ||
29 | #else | |
30 | ||
31 | /* | |
32 | * or, just wrap pr_debug | |
33 | */ | |
34 | # define dout(fmt, ...) pr_debug(" " fmt, ##__VA_ARGS__) | |
35 | ||
36 | #endif | |
37 | ||
38 | #endif |