Commit f1d86b61fb6692c592e937dfb5069e4057855a3b
Committed by
Martin Schwidefsky
1 parent
4ae803253e
Exists in
master
and in
16 other branches
s390/s390dbf: add debug_level_enabled() function
Add the debug_level_enabled() function to check if debug events for a particular level would be logged. This might help to save cycles for debug events that require additional information collection. Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Showing 2 changed files with 15 additions and 0 deletions Side-by-side Diff
Documentation/s390/s390dbf.txt
... | ... | @@ -158,6 +158,16 @@ |
158 | 158 | Description: Sets new actual debug level if new_level is valid. |
159 | 159 | |
160 | 160 | --------------------------------------------------------------------------- |
161 | +bool debug_level_enabled (debug_info_t * id, int level); | |
162 | + | |
163 | +Parameter: id: handle for debug log | |
164 | + level: debug level | |
165 | + | |
166 | +Return Value: True if level is less or equal to the current debug level. | |
167 | + | |
168 | +Description: Returns true if debug events for the specified level would be | |
169 | + logged. Otherwise returns false. | |
170 | +--------------------------------------------------------------------------- | |
161 | 171 | void debug_stop_all(void); |
162 | 172 | |
163 | 173 | Parameter: none |
arch/s390/include/asm/debug.h
... | ... | @@ -107,6 +107,11 @@ |
107 | 107 | void debug_set_critical(void); |
108 | 108 | void debug_stop_all(void); |
109 | 109 | |
110 | +static inline bool debug_level_enabled(debug_info_t* id, int level) | |
111 | +{ | |
112 | + return level <= id->level; | |
113 | +} | |
114 | + | |
110 | 115 | static inline debug_entry_t* |
111 | 116 | debug_event(debug_info_t* id, int level, void* data, int length) |
112 | 117 | { |