v2: * I realized that v1 was not complete enough after feedback from Lluís and Frank Ch. Eigler, so here is a v2 after all. * Add Makefile target for simpletrace .stp file [Lluís] * Generate SystemTap probe aliases so users can select a subset of probes to enable [Frank Ch. Eigler] * Delete --no-header from sys.argv[] so further command-line parsing works
SystemTap is a popular tracing solution on Fedora and RHEL. It does not have its own trace file format, instead stap scripts have the freedom to output data in whatever format is most appropriate. QEMU supports the simpletrace binary format for built-in tracing that comes with QEMU. Since we need a format for persisting SystemTap traces and a binary format has performance advantages, let's output simpletrace-compatible data. This patch adds a new stap file that is autogenerated from trace-events. The following example shows how to use SystemTap and analyze the resulting trace file with simpletrace.py: $ ./configure --enable-trace-backend=dtrace ... && make $ sudo stap x86_64-softmmu/qemu-system-x86_64-simpletrace.stp >trace ...run QEMU in another shell... ^C $ scripts/simpletrace.py --no-header trace-events trace One new concept here is the simpletrace.py --no-header option. SystemTap supports flight-recorder mode where trace records are written into a ring buffer. The ring buffer can be dumped at any time so it is useful to skip the simpletrace header check. Stefan Hajnoczi (4): trace: extract stap_escape() function for reuse trace: add tracetool simpletrace_stap format simpletrace: add simpletrace.py --no-header option trace: install simpletrace SystemTap tapset Makefile.target | 10 +++- scripts/simpletrace.py | 24 +++++++--- scripts/tracetool/format/simpletrace_stap.py | 71 ++++++++++++++++++++++++++++ scripts/tracetool/format/stap.py | 11 +++-- 4 files changed, 105 insertions(+), 11 deletions(-) create mode 100644 scripts/tracetool/format/simpletrace_stap.py -- 1.9.3