diff options
author | Peter Tiedemann <ptiedem@de.ibm.com> | 2008-02-08 13:09:05 +0100 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-02-11 11:14:50 -0500 |
commit | f33780d33f8a95fe5dc72b706a4de741e9240f36 (patch) | |
tree | 1a88852ed43bfc6231a6c08ffa13bfc36c23e36e /drivers/s390/net/claw.h | |
parent | 164b0fb1f2a2990a37b9aeae98a9b771f6add24e (diff) |
claw/lcs/netiucv: check s390dbf level before sprints
additional check of s390dbf level results in better performance
if the default low debugging level is active.
Signed-off-by: Peter Tiedemann <ptiedem@de.ibm.com>
Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/s390/net/claw.h')
-rw-r--r-- | drivers/s390/net/claw.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/s390/net/claw.h b/drivers/s390/net/claw.h index 7fbd017153ee..1a89d989f348 100644 --- a/drivers/s390/net/claw.h +++ b/drivers/s390/net/claw.h @@ -114,11 +114,20 @@ do { \ debug_event(claw_dbf_##name,level,(void*)(addr),len); \ } while (0) +/* Allow to sort out low debug levels early to avoid wasted sprints */ +static inline int claw_dbf_passes(debug_info_t *dbf_grp, int level) +{ + return (level <= dbf_grp->level); +} + #define CLAW_DBF_TEXT_(level,name,text...) \ -do { \ - sprintf(debug_buffer, text); \ - debug_text_event(claw_dbf_##name,level, debug_buffer);\ -} while (0) + do { \ + if (claw_dbf_passes(claw_dbf_##name, level)) { \ + sprintf(debug_buffer, text); \ + debug_text_event(claw_dbf_##name, level, \ + debug_buffer); \ + } \ + } while (0) /******************************************************* * Define Control Blocks * |