summaryrefslogtreecommitdiffstats
path: root/scripts/tracetool/backend/simple.py
diff options
context:
space:
mode:
authorPeter Maydell2016-07-19 11:54:49 +0200
committerPeter Maydell2016-07-19 11:54:49 +0200
commit0c1b58f25025cc09463aae235162b19ff45c37b7 (patch)
tree93f05bbeadc130a91399cc98ac3c914df87958e3 /scripts/tracetool/backend/simple.py
parentMerge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20160718.0' i... (diff)
parenttrace: Add QAPI/QMP interfaces to query and control per-vCPU tracing state (diff)
downloadqemu-0c1b58f25025cc09463aae235162b19ff45c37b7.tar.gz
qemu-0c1b58f25025cc09463aae235162b19ff45c37b7.tar.xz
qemu-0c1b58f25025cc09463aae235162b19ff45c37b7.zip
Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
# gpg: Signature made Mon 18 Jul 2016 22:59:55 BST # gpg: using RSA key 0x9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/tracing-pull-request: trace: Add QAPI/QMP interfaces to query and control per-vCPU tracing state trace: Allow event name pattern in "info trace-events" trace: Conditionally trace events based on their per-vCPU state trace: Add per-vCPU tracing states for events with the 'vcpu' property trace: Cosmetic changes on fast-path tracing disas: Remove unused macro '_' trace: Identify events with the 'vcpu' property trace: [bsd-user] Commandline arguments to control tracing trace: [linux-user] Commandline arguments to control tracing Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts/tracetool/backend/simple.py')
-rw-r--r--scripts/tracetool/backend/simple.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/tracetool/backend/simple.py b/scripts/tracetool/backend/simple.py
index 3246c20015..1bccada63d 100644
--- a/scripts/tracetool/backend/simple.py
+++ b/scripts/tracetool/backend/simple.py
@@ -36,7 +36,7 @@ def generate_h_begin(events):
def generate_h(event):
- out(' _simple_%(api)s(%(args)s);',
+ out(' _simple_%(api)s(%(args)s);',
api=event.api(),
args=", ".join(event.args.names()))
@@ -68,16 +68,23 @@ def generate_c(event):
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 (!trace_event_get_state(%(event_id)s)) {',
+ ' if (!%(cond)s) {',
' return;',
' }',
'',
' if (trace_record_start(&rec, %(event_id)s, %(size_str)s)) {',
' return; /* Trace Buffer Full, Event Dropped ! */',
' }',
- event_id='TRACE_' + event.name.upper(),
+ cond=cond,
+ event_id=event_id,
size_str=sizestr)
if len(event.args) > 0: