aboutsummaryrefslogtreecommitdiff
path: root/scripts/tracetool/backend
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2025-06-03 09:19:12 -0400
committerStefan Hajnoczi <stefanha@redhat.com>2025-06-03 09:19:12 -0400
commit37fa1bdf3439b924b6f833f500c764d473dfc4b7 (patch)
treeaeff0071c8c935d61559473c4180859751e3a21e /scripts/tracetool/backend
parent6322b753f798337835e205b6d805356bea582c86 (diff)
parentffcfb0faaa95fc6ca007f7dd989e390dacf936ca (diff)
downloadqemu-37fa1bdf3439b924b6f833f500c764d473dfc4b7.zip
qemu-37fa1bdf3439b924b6f833f500c764d473dfc4b7.tar.gz
qemu-37fa1bdf3439b924b6f833f500c764d473dfc4b7.tar.bz2
Merge tag 'tracing-pull-request' of https://gitlab.com/stefanha/qemu into staging
Pull request # -----BEGIN PGP SIGNATURE----- # # iQEzBAABCgAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmg+JcgACgkQnKSrs4Gr # c8jRKQgAgBwP5c+5YAN868Uu9nIZjT/B544FkQSp77t4SPfzzzChYHy4CGlbspYm # vGnAkYRn5u7EXLnJ7bm9J5wLvGLVLtyWJbpCRUHjYTG37xa4Q0NZ/I2iJqUbU863 # D8lv/R5kjlUsa/p955v2TCl2q8Oif++slqsLeFOoH0dy26ehalasLkqCf5SXlhlF # 5ULMRDKvHxkQhntp3k3DjzZVI7cUDhhLSYK9jpEVy+BVlhmUtWEeLp/mDdhdBQps # fy4c7G0VBpsUEIZP8+DFPSwTdQ+p2jjJXSlPGGCYBh5KfAKnOD8XaGWlozR5Gngz # v4bSHzgxU0HArmAfTh3vVftljyNvug== # =a0+Y # -----END PGP SIGNATURE----- # gpg: Signature made Mon 02 Jun 2025 18:29:28 EDT # gpg: using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [ultimate] # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" [ultimate] # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * tag 'tracing-pull-request' of https://gitlab.com/stefanha/qemu: trace/simple: seperate hot paths of tracing fucntions Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'scripts/tracetool/backend')
-rw-r--r--scripts/tracetool/backend/simple.py23
1 files changed, 10 insertions, 13 deletions
diff --git a/scripts/tracetool/backend/simple.py b/scripts/tracetool/backend/simple.py
index a74d61f..2688d4b 100644
--- a/scripts/tracetool/backend/simple.py
+++ b/scripts/tracetool/backend/simple.py
@@ -36,8 +36,17 @@ def generate_h_begin(events, group):
def generate_h(event, group):
- out(' _simple_%(api)s(%(args)s);',
+ event_id = 'TRACE_' + event.name.upper()
+ if "vcpu" in event.properties:
+ # already checked on the generic format code
+ cond = "true"
+ else:
+ cond = "trace_event_get_state(%s)" % event_id
+ out(' if (%(cond)s) {',
+ ' _simple_%(api)s(%(args)s);',
+ ' }',
api=event.api(),
+ cond=cond,
args=", ".join(event.args.names()))
@@ -72,22 +81,10 @@ def generate_c(event, group):
if len(event.args) == 0:
sizestr = '0'
- event_id = 'TRACE_' + event.name.upper()
- if "vcpu" in event.properties:
- # already checked on the generic format code
- cond = "true"
- else:
- cond = "trace_event_get_state(%s)" % event_id
-
out('',
- ' if (!%(cond)s) {',
- ' return;',
- ' }',
- '',
' if (trace_record_start(&rec, %(event_obj)s.id, %(size_str)s)) {',
' return; /* Trace Buffer Full, Event Dropped ! */',
' }',
- cond=cond,
event_obj=event.api(event.QEMU_EVENT),
size_str=sizestr)