summaryrefslogtreecommitdiffstats
path: root/scripts/tracetool/format
diff options
context:
space:
mode:
authorAlex Bennée2014-08-01 18:08:56 +0200
committerStefan Hajnoczi2014-08-12 15:26:12 +0200
commit41ef7b00abff4d31814890a14e5a8e49a177508b (patch)
treed3fe2dd5854b81df8f8b063296b34f3a5af83587 /scripts/tracetool/format
parenttrace: [tcg] Include TCG-tracing header on all targets (diff)
downloadqemu-41ef7b00abff4d31814890a14e5a8e49a177508b.tar.gz
qemu-41ef7b00abff4d31814890a14e5a8e49a177508b.tar.xz
qemu-41ef7b00abff4d31814890a14e5a8e49a177508b.zip
trace: teach lttng backend to use format strings
This makes the UST backend pay attention to the format string arguments that are defined when defining payload data. With this you can now ensure integers are reported in hex mode if you want. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'scripts/tracetool/format')
-rw-r--r--scripts/tracetool/format/ust_events_h.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/tracetool/format/ust_events_h.py b/scripts/tracetool/format/ust_events_h.py
index 5102565470..d18989942a 100644
--- a/scripts/tracetool/format/ust_events_h.py
+++ b/scripts/tracetool/format/ust_events_h.py
@@ -63,13 +63,20 @@ def generate(events, backend):
name=e.name,
args=", ".join(", ".join(i) for i in e.args))
- for t, n in e.args:
- if ('int' in t) or ('long' in t) or ('unsigned' in t) or ('size_t' in t):
+ types = e.args.types()
+ names = e.args.names()
+ fmts = e.arg_fmts
+ for t,n,f in zip(types, names, fmts):
+ if ('char *' in t) or ('char*' in t):
+ out(' ctf_string(' + n + ', ' + n + ')')
+ elif ("%p" in f) or ("x" in f) or ("PRIx" in f):
+ out(' ctf_integer_hex('+ t + ', ' + n + ', ' + n + ')')
+ elif ("ptr" in t) or ("*" in t):
+ out(' ctf_integer_hex('+ t + ', ' + n + ', ' + n + ')')
+ elif ('int' in t) or ('long' in t) or ('unsigned' in t) or ('size_t' in t):
out(' ctf_integer(' + t + ', ' + n + ', ' + n + ')')
elif ('double' in t) or ('float' in t):
out(' ctf_float(' + t + ', ' + n + ', ' + n + ')')
- elif ('char *' in t) or ('char*' in t):
- out(' ctf_string(' + n + ', ' + n + ')')
elif ('void *' in t) or ('void*' in t):
out(' ctf_integer_hex(unsigned long, ' + n + ', ' + n + ')')