aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorPeter Tiedemann <ptiedem@de.ibm.com>2008-02-08 07:09:05 -0500
committerJeff Garzik <jeff@garzik.org>2008-02-11 11:14:50 -0500
commitf33780d33f8a95fe5dc72b706a4de741e9240f36 (patch)
tree1a88852ed43bfc6231a6c08ffa13bfc36c23e36e /drivers/s390
parent164b0fb1f2a2990a37b9aeae98a9b771f6add24e (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')
-rw-r--r--drivers/s390/net/claw.h17
-rw-r--r--drivers/s390/net/lcs.h16
-rw-r--r--drivers/s390/net/netiucv.c22
3 files changed, 41 insertions, 14 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 { \
114 debug_event(claw_dbf_##name,level,(void*)(addr),len); \ 114 debug_event(claw_dbf_##name,level,(void*)(addr),len); \
115} while (0) 115} while (0)
116 116
117/* Allow to sort out low debug levels early to avoid wasted sprints */
118static inline int claw_dbf_passes(debug_info_t *dbf_grp, int level)
119{
120 return (level <= dbf_grp->level);
121}
122
117#define CLAW_DBF_TEXT_(level,name,text...) \ 123#define CLAW_DBF_TEXT_(level,name,text...) \
118do { \ 124 do { \
119 sprintf(debug_buffer, text); \ 125 if (claw_dbf_passes(claw_dbf_##name, level)) { \
120 debug_text_event(claw_dbf_##name,level, debug_buffer);\ 126 sprintf(debug_buffer, text); \
121} while (0) 127 debug_text_event(claw_dbf_##name, level, \
128 debug_buffer); \
129 } \
130 } while (0)
122 131
123/******************************************************* 132/*******************************************************
124* Define Control Blocks * 133* Define Control Blocks *
diff --git a/drivers/s390/net/lcs.h b/drivers/s390/net/lcs.h
index 8976fb0b070a..d58fea52557d 100644
--- a/drivers/s390/net/lcs.h
+++ b/drivers/s390/net/lcs.h
@@ -16,11 +16,19 @@ do { \
16 debug_event(lcs_dbf_##name,level,(void*)(addr),len); \ 16 debug_event(lcs_dbf_##name,level,(void*)(addr),len); \
17} while (0) 17} while (0)
18 18
19/* Allow to sort out low debug levels early to avoid wasted sprints */
20static inline int lcs_dbf_passes(debug_info_t *dbf_grp, int level)
21{
22 return (level <= dbf_grp->level);
23}
24
19#define LCS_DBF_TEXT_(level,name,text...) \ 25#define LCS_DBF_TEXT_(level,name,text...) \
20do { \ 26 do { \
21 sprintf(debug_buffer, text); \ 27 if (lcs_dbf_passes(lcs_dbf_##name, level)) { \
22 debug_text_event(lcs_dbf_##name,level, debug_buffer);\ 28 sprintf(debug_buffer, text); \
23} while (0) 29 debug_text_event(lcs_dbf_##name, level, debug_buffer); \
30 } \
31 } while (0)
24 32
25/** 33/**
26 * sysfs related stuff 34 * sysfs related stuff
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");
97 97
98DECLARE_PER_CPU(char[256], iucv_dbf_txt_buf); 98DECLARE_PER_CPU(char[256], iucv_dbf_txt_buf);
99 99
100#define IUCV_DBF_TEXT_(name,level,text...) \ 100/* Allow to sort out low debug levels early to avoid wasted sprints */
101 do { \ 101static inline int iucv_dbf_passes(debug_info_t *dbf_grp, int level)
102 char* iucv_dbf_txt_buf = get_cpu_var(iucv_dbf_txt_buf); \ 102{
103 sprintf(iucv_dbf_txt_buf, text); \ 103 return (level <= dbf_grp->level);
104 debug_text_event(iucv_dbf_##name,level,iucv_dbf_txt_buf); \ 104}
105 put_cpu_var(iucv_dbf_txt_buf); \ 105
106#define IUCV_DBF_TEXT_(name, level, text...) \
107 do { \
108 if (iucv_dbf_passes(iucv_dbf_##name, level)) { \
109 char* iucv_dbf_txt_buf = \
110 get_cpu_var(iucv_dbf_txt_buf); \
111 sprintf(iucv_dbf_txt_buf, text); \
112 debug_text_event(iucv_dbf_##name, level, \
113 iucv_dbf_txt_buf); \
114 put_cpu_var(iucv_dbf_txt_buf); \
115 } \
106 } while (0) 116 } while (0)
107 117
108#define IUCV_DBF_SPRINTF(name,level,text...) \ 118#define IUCV_DBF_SPRINTF(name,level,text...) \