Commit 87e6f968339bcdda56b39572c7e63331192296a0
Committed by
Greg Kroah-Hartman
1 parent
07100be7e0
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
dynamic_debug: drop enabled field from struct _ddebug, use _DPRINTK_FLAGS_PRINT
Currently any enabled dynamic-debug flag on a pr_debug callsite will enable printing, even if _DPRINTK_FLAGS_PRINT is off. Checking print flag directly allows "-p" to disable callsites without fussing with other flags, so the following disables everything, without altering flags user may have set: echo -p > $DBGFS/dynamic_debug/control Signed-off-by: Jim Cromie <jim.cromie@gmail.com> Signed-off-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 2 changed files with 4 additions and 10 deletions Side-by-side Diff
include/linux/dynamic_debug.h
... | ... | @@ -28,7 +28,6 @@ |
28 | 28 | #define _DPRINTK_FLAGS_INCL_TID (1<<4) |
29 | 29 | #define _DPRINTK_FLAGS_DEFAULT 0 |
30 | 30 | unsigned int flags:8; |
31 | - char enabled; | |
32 | 31 | } __attribute__((aligned(8))); |
33 | 32 | |
34 | 33 | |
35 | 34 | |
36 | 35 | |
... | ... | @@ -62,21 +61,20 @@ |
62 | 61 | .format = (fmt), \ |
63 | 62 | .lineno = __LINE__, \ |
64 | 63 | .flags = _DPRINTK_FLAGS_DEFAULT, \ |
65 | - .enabled = false, \ | |
66 | 64 | } |
67 | 65 | |
68 | 66 | #define dynamic_pr_debug(fmt, ...) \ |
69 | 67 | do { \ |
70 | 68 | DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ |
71 | - if (unlikely(descriptor.enabled)) \ | |
69 | + if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT)) \ | |
72 | 70 | __dynamic_pr_debug(&descriptor, pr_fmt(fmt), \ |
73 | 71 | ##__VA_ARGS__); \ |
74 | 72 | } while (0) |
75 | 73 | |
76 | 74 | #define dynamic_dev_dbg(dev, fmt, ...) \ |
77 | 75 | do { \ |
78 | - DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ | |
79 | - if (unlikely(descriptor.enabled)) \ | |
76 | + DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ | |
77 | + if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT)) \ | |
80 | 78 | __dynamic_dev_dbg(&descriptor, dev, fmt, \ |
81 | 79 | ##__VA_ARGS__); \ |
82 | 80 | } while (0) |
... | ... | @@ -84,7 +82,7 @@ |
84 | 82 | #define dynamic_netdev_dbg(dev, fmt, ...) \ |
85 | 83 | do { \ |
86 | 84 | DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ |
87 | - if (unlikely(descriptor.enabled)) \ | |
85 | + if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT)) \ | |
88 | 86 | __dynamic_netdev_dbg(&descriptor, dev, fmt, \ |
89 | 87 | ##__VA_ARGS__); \ |
90 | 88 | } while (0) |
lib/dynamic_debug.c