mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
s390/debug: avoid function call for debug_sprintf_*
debug_sprintf_event/exception are called even for debug events with a disabling debug level. All other functions already do the check in a wrapper function. Lets do the same here. Due to the var_args the compiler rejects to make this function inline. So let's wrap this via a macro. This patch saves around 80 ns on my z196 for a KVM round trip (we have two debug statements for entry and exit) when KVM is build as a module. The savings for built-in drivers is smaller as we then avoid the PLT overhead for a function call. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Michael Holzheu <holzheu@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
committed by
Martin Schwidefsky
parent
ed7d56e174
commit
832a771034
@@ -1019,7 +1019,7 @@ debug_count_numargs(char *string)
|
||||
*/
|
||||
|
||||
debug_entry_t*
|
||||
debug_sprintf_event(debug_info_t* id, int level,char *string,...)
|
||||
__debug_sprintf_event(debug_info_t *id, int level, char *string, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int numargs,idx;
|
||||
@@ -1027,8 +1027,6 @@ debug_sprintf_event(debug_info_t* id, int level,char *string,...)
|
||||
debug_sprintf_entry_t *curr_event;
|
||||
debug_entry_t *active;
|
||||
|
||||
if((!id) || (level > id->level))
|
||||
return NULL;
|
||||
if (!debug_active || !id->areas)
|
||||
return NULL;
|
||||
numargs=debug_count_numargs(string);
|
||||
@@ -1050,14 +1048,14 @@ debug_sprintf_event(debug_info_t* id, int level,char *string,...)
|
||||
|
||||
return active;
|
||||
}
|
||||
EXPORT_SYMBOL(debug_sprintf_event);
|
||||
EXPORT_SYMBOL(__debug_sprintf_event);
|
||||
|
||||
/*
|
||||
* debug_sprintf_exception:
|
||||
*/
|
||||
|
||||
debug_entry_t*
|
||||
debug_sprintf_exception(debug_info_t* id, int level,char *string,...)
|
||||
__debug_sprintf_exception(debug_info_t *id, int level, char *string, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int numargs,idx;
|
||||
@@ -1065,8 +1063,6 @@ debug_sprintf_exception(debug_info_t* id, int level,char *string,...)
|
||||
debug_sprintf_entry_t *curr_event;
|
||||
debug_entry_t *active;
|
||||
|
||||
if((!id) || (level > id->level))
|
||||
return NULL;
|
||||
if (!debug_active || !id->areas)
|
||||
return NULL;
|
||||
|
||||
@@ -1089,7 +1085,7 @@ debug_sprintf_exception(debug_info_t* id, int level,char *string,...)
|
||||
|
||||
return active;
|
||||
}
|
||||
EXPORT_SYMBOL(debug_sprintf_exception);
|
||||
EXPORT_SYMBOL(__debug_sprintf_exception);
|
||||
|
||||
/*
|
||||
* debug_register_view:
|
||||
|
Reference in New Issue
Block a user