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 17:14:50 +0100 |
commit | f33780d33f8a95fe5dc72b706a4de741e9240f36 (patch) | |
tree | 1a88852ed43bfc6231a6c08ffa13bfc36c23e36e /drivers/s390/net/netiucv.c | |
parent | lcs: avoid/reduce unused s390dbf debug areas. (diff) | |
download | linux-f33780d33f8a95fe5dc72b706a4de741e9240f36.tar.xz linux-f33780d33f8a95fe5dc72b706a4de741e9240f36.zip |
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/netiucv.c')
-rw-r--r-- | drivers/s390/net/netiucv.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index 42d701b5921c..874a19994489 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c @@ -97,12 +97,22 @@ MODULE_DESCRIPTION ("Linux for S/390 IUCV network driver"); DECLARE_PER_CPU(char[256], iucv_dbf_txt_buf); -#define IUCV_DBF_TEXT_(name,level,text...) \ - do { \ - char* iucv_dbf_txt_buf = get_cpu_var(iucv_dbf_txt_buf); \ - sprintf(iucv_dbf_txt_buf, text); \ - debug_text_event(iucv_dbf_##name,level,iucv_dbf_txt_buf); \ - put_cpu_var(iucv_dbf_txt_buf); \ +/* Allow to sort out low debug levels early to avoid wasted sprints */ +static inline int iucv_dbf_passes(debug_info_t *dbf_grp, int level) +{ + return (level <= dbf_grp->level); +} + +#define IUCV_DBF_TEXT_(name, level, text...) \ + do { \ + if (iucv_dbf_passes(iucv_dbf_##name, level)) { \ + char* iucv_dbf_txt_buf = \ + get_cpu_var(iucv_dbf_txt_buf); \ + sprintf(iucv_dbf_txt_buf, text); \ + debug_text_event(iucv_dbf_##name, level, \ + iucv_dbf_txt_buf); \ + put_cpu_var(iucv_dbf_txt_buf); \ + } \ } while (0) #define IUCV_DBF_SPRINTF(name,level,text...) \ |