mirror of
https://github.com/adulau/aha.git
synced 2025-01-01 13:46:24 +00:00
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>
This commit is contained in:
parent
164b0fb1f2
commit
f33780d33f
3 changed files with 41 additions and 14 deletions
|
@ -114,11 +114,20 @@ do { \
|
||||||
debug_event(claw_dbf_##name,level,(void*)(addr),len); \
|
debug_event(claw_dbf_##name,level,(void*)(addr),len); \
|
||||||
} while (0)
|
} 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...) \
|
#define CLAW_DBF_TEXT_(level,name,text...) \
|
||||||
do { \
|
do { \
|
||||||
|
if (claw_dbf_passes(claw_dbf_##name, level)) { \
|
||||||
sprintf(debug_buffer, text); \
|
sprintf(debug_buffer, text); \
|
||||||
debug_text_event(claw_dbf_##name,level, debug_buffer);\
|
debug_text_event(claw_dbf_##name, level, \
|
||||||
} while (0)
|
debug_buffer); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
/*******************************************************
|
/*******************************************************
|
||||||
* Define Control Blocks *
|
* Define Control Blocks *
|
||||||
|
|
|
@ -16,11 +16,19 @@ do { \
|
||||||
debug_event(lcs_dbf_##name,level,(void*)(addr),len); \
|
debug_event(lcs_dbf_##name,level,(void*)(addr),len); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
/* Allow to sort out low debug levels early to avoid wasted sprints */
|
||||||
|
static inline int lcs_dbf_passes(debug_info_t *dbf_grp, int level)
|
||||||
|
{
|
||||||
|
return (level <= dbf_grp->level);
|
||||||
|
}
|
||||||
|
|
||||||
#define LCS_DBF_TEXT_(level,name,text...) \
|
#define LCS_DBF_TEXT_(level,name,text...) \
|
||||||
do { \
|
do { \
|
||||||
|
if (lcs_dbf_passes(lcs_dbf_##name, level)) { \
|
||||||
sprintf(debug_buffer, text); \
|
sprintf(debug_buffer, text); \
|
||||||
debug_text_event(lcs_dbf_##name,level, debug_buffer);\
|
debug_text_event(lcs_dbf_##name, level, debug_buffer); \
|
||||||
} while (0)
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sysfs related stuff
|
* sysfs related stuff
|
||||||
|
|
|
@ -97,12 +97,22 @@ MODULE_DESCRIPTION ("Linux for S/390 IUCV network driver");
|
||||||
|
|
||||||
DECLARE_PER_CPU(char[256], iucv_dbf_txt_buf);
|
DECLARE_PER_CPU(char[256], iucv_dbf_txt_buf);
|
||||||
|
|
||||||
#define IUCV_DBF_TEXT_(name,level,text...) \
|
/* 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 { \
|
do { \
|
||||||
char* iucv_dbf_txt_buf = get_cpu_var(iucv_dbf_txt_buf); \
|
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); \
|
sprintf(iucv_dbf_txt_buf, text); \
|
||||||
debug_text_event(iucv_dbf_##name,level,iucv_dbf_txt_buf); \
|
debug_text_event(iucv_dbf_##name, level, \
|
||||||
|
iucv_dbf_txt_buf); \
|
||||||
put_cpu_var(iucv_dbf_txt_buf); \
|
put_cpu_var(iucv_dbf_txt_buf); \
|
||||||
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define IUCV_DBF_SPRINTF(name,level,text...) \
|
#define IUCV_DBF_SPRINTF(name,level,text...) \
|
||||||
|
|
Loading…
Reference in a new issue