aboutsummaryrefslogtreecommitdiff
path: root/scripts/tracetool/backend/log.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/tracetool/backend/log.py')
-rw-r--r--scripts/tracetool/backend/log.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/scripts/tracetool/backend/log.py b/scripts/tracetool/backend/log.py
index da86f6b882..78933d03ad 100644
--- a/scripts/tracetool/backend/log.py
+++ b/scripts/tracetool/backend/log.py
@@ -20,7 +20,7 @@ PUBLIC = True
def generate_h_begin(events, group):
- out('#include "qemu/log.h"',
+ out('#include "qemu/log-for-trace.h"',
'')
@@ -35,14 +35,13 @@ def generate_h(event, group):
else:
cond = "trace_event_get_state(%s)" % ("TRACE_" + event.name.upper())
- out(' if (%(cond)s) {',
+ out(' if (%(cond)s && qemu_loglevel_mask(LOG_TRACE)) {',
' struct timeval _now;',
' gettimeofday(&_now, NULL);',
- ' qemu_log_mask(LOG_TRACE,',
- ' "%%d@%%zd.%%06zd:%(name)s " %(fmt)s "\\n",',
- ' getpid(),',
- ' (size_t)_now.tv_sec, (size_t)_now.tv_usec',
- ' %(argnames)s);',
+ ' qemu_log("%%d@%%zd.%%06zd:%(name)s " %(fmt)s "\\n",',
+ ' getpid(),',
+ ' (size_t)_now.tv_sec, (size_t)_now.tv_usec',
+ ' %(argnames)s);',
' }',
cond=cond,
name=event.name,