From 7ee606230e6b7645d92365d9b39179368e83ac54 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Tue, 15 Mar 2016 19:12:03 +0100 Subject: qemu-log: Avoid function call for disabled qemu_log_mask logging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Alex Bennée Reviewed-by: Andreas Färber Signed-off-by: Paolo Bonzini --- util/log.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'util') diff --git a/util/log.c b/util/log.c index a14d480..4e69586 100644 --- a/util/log.c +++ b/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) { -- cgit v1.1