mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 02:24:58 -06:00
qemu-log: Avoid function call for disabled qemu_log_mask logging
Make qemu_log_mask() a macro which only calls the function to do the actual work if the logging is enabled. This avoids making a function call in possible fast paths where logging is disabled. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
541957361e
commit
7ee606230e
2 changed files with 10 additions and 14 deletions
11
util/log.c
11
util/log.c
|
@ -38,17 +38,6 @@ void qemu_log(const char *fmt, ...)
|
|||
va_end(ap);
|
||||
}
|
||||
|
||||
void qemu_log_mask(int mask, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
if ((qemu_loglevel & mask) && qemu_logfile) {
|
||||
vfprintf(qemu_logfile, fmt, ap);
|
||||
}
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
/* enable or disable low levels log */
|
||||
void do_qemu_set_log(int log_flags, bool use_own_buffers)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue