summary refs log tree commit diff stats
path: root/scripts/tracetool/backend/syslog.py
diff options
context:
space:
mode:
authorTanish Desai <tanishdesai37@gmail.com>2025-09-29 17:49:29 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2025-10-01 11:22:07 -0400
commit494492c5c5a145e04f3ebc9eb40fd34ffbcc2061 (patch)
treef20e479c6e21468c95537d7c5415904e14482e0c /scripts/tracetool/backend/syslog.py
parent809caa0d40a853144c02456737ed1e47859b0308 (diff)
downloadfocaccia-qemu-494492c5c5a145e04f3ebc9eb40fd34ffbcc2061.tar.gz
focaccia-qemu-494492c5c5a145e04f3ebc9eb40fd34ffbcc2061.zip
tracetool/backend: remove redundant trace event checks
Use CHECK_TRACE_EVENT_GET_STATE in log, syslog, dtrace and simple
backend, so that the "if (trace_event_get_state)" is created from common
code and unified when multiple backends are active.

When a single backend is active there is no code change (except
for the log backend, as shown in tests/tracetool/log.h), but the
code in the backends is simpler.

Signed-off-by: Tanish Desai <tanishdesai37@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20250929154938.594389-8-pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'scripts/tracetool/backend/syslog.py')
-rw-r--r--scripts/tracetool/backend/syslog.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/scripts/tracetool/backend/syslog.py b/scripts/tracetool/backend/syslog.py
index 78ee67136b..177414d56a 100644
--- a/scripts/tracetool/backend/syslog.py
+++ b/scripts/tracetool/backend/syslog.py
@@ -16,6 +16,7 @@ from tracetool import out
 
 
 PUBLIC = True
+CHECK_TRACE_EVENT_GET_STATE = True
 
 
 def generate_h_begin(events, group):
@@ -28,14 +29,9 @@ def generate_h(event, group):
     if len(event.args) > 0:
         argnames = ", " + argnames
 
-    cond = "trace_event_get_state(%s)" % ("TRACE_" + event.name.upper())
-
-    out('    if (%(cond)s) {',
-        '#line %(event_lineno)d "%(event_filename)s"',
+    out('#line %(event_lineno)d "%(event_filename)s"',
         '        syslog(LOG_INFO, "%(name)s " %(fmt)s %(argnames)s);',
         '#line %(out_next_lineno)d "%(out_filename)s"',
-        '    }',
-        cond=cond,
         event_lineno=event.lineno,
         event_filename=event.filename,
         name=event.name,