diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2016-03-15 19:12:03 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-03-22 22:20:18 +0100 |
commit | 7ee606230e6b7645d92365d9b39179368e83ac54 (patch) | |
tree | c757b955f233c40337678b881623f303762621ba /util | |
parent | 541957361e0728c2ffe8330a712099cc872986a0 (diff) |
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>
Diffstat (limited to 'util')
-rw-r--r-- | util/log.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/util/log.c b/util/log.c index a14d480a53..4e69586a73 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) { |