Commit f1d86b61 authored by Hendrik Brueckner's avatar Hendrik Brueckner Committed by Martin Schwidefsky

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: default avatarHendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 4ae80325
......@@ -157,6 +157,16 @@ Return Value: none
Description: Sets new actual debug level if new_level is valid.
---------------------------------------------------------------------------
bool debug_level_enabled (debug_info_t * id, int level);
Parameter: id: handle for debug log
level: debug level
Return Value: True if level is less or equal to the current debug level.
Description: Returns true if debug events for the specified level would be
logged. Otherwise returns false.
---------------------------------------------------------------------------
void debug_stop_all(void);
......
......@@ -107,6 +107,11 @@ void debug_set_level(debug_info_t* id, int new_level);
void debug_set_critical(void);
void debug_stop_all(void);
static inline bool debug_level_enabled(debug_info_t* id, int level)
{
return level <= id->level;
}
static inline debug_entry_t*
debug_event(debug_info_t* id, int level, void* data, int length)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment