summaryrefslogtreecommitdiff
path: root/docs/tracing.txt
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-06-20 22:30:34 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-06-20 22:30:34 +0100
commitb0ad00b8c9f81874df93d2b41e911c260e91a100 (patch)
treef52c2ca7878b26437173df0802ffe16bb3c052ef /docs/tracing.txt
parent7e13ea57f47710de2c19f22b27b34ab9fb045700 (diff)
parentf52347d5b023dd2ab5518a4faaf2e0cee55c1915 (diff)
downloadqemu-b0ad00b8c9f81874df93d2b41e911c260e91a100.tar.gz
Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
# gpg: Signature made Mon 20 Jun 2016 21:29:27 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: (42 commits) trace: split out trace events for linux-user/ directory trace: split out trace events for qom/ directory trace: split out trace events for target-ppc/ directory trace: split out trace events for target-s390x/ directory trace: split out trace events for target-sparc/ directory trace: split out trace events for net/ directory trace: split out trace events for audio/ directory trace: split out trace events for ui/ directory trace: split out trace events for hw/alpha/ directory trace: split out trace events for hw/arm/ directory trace: split out trace events for hw/acpi/ directory trace: split out trace events for hw/vfio/ directory trace: split out trace events for hw/s390x/ directory trace: split out trace events for hw/pci/ directory trace: split out trace events for hw/ppc/ directory trace: split out trace events for hw/9pfs/ directory trace: split out trace events for hw/i386/ directory trace: split out trace events for hw/isa/ directory trace: split out trace events for hw/sd/ directory trace: split out trace events for hw/sparc/ directory ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'docs/tracing.txt')
-rw-r--r--docs/tracing.txt32
1 files changed, 18 insertions, 14 deletions
diff --git a/docs/tracing.txt b/docs/tracing.txt
index 0bd6b9cf9e..29f2f9a24d 100644
--- a/docs/tracing.txt
+++ b/docs/tracing.txt
@@ -23,20 +23,24 @@ for debugging, profiling, and observing execution.
4. Pretty-print the binary trace file:
- ./scripts/simpletrace.py trace-events trace-* # Override * with QEMU <pid>
+ ./scripts/simpletrace.py trace-events-all trace-* # Override * with QEMU <pid>
== Trace events ==
-There is a set of static trace events declared in the "trace-events" source
-file. Each trace event declaration names the event, its arguments, and the
-format string which can be used for pretty-printing:
+Each directory in the source tree can declare a set of static trace events
+in a "trace-events" file. Each trace event declaration names the event, its
+arguments, and the format string which can be used for pretty-printing:
qemu_vmalloc(size_t size, void *ptr) "size %zu ptr %p"
qemu_vfree(void *ptr) "ptr %p"
-The "trace-events" file is processed by the "tracetool" script during build to
-generate code for the trace events. Trace events are invoked directly from
-source code like this:
+All "trace-events" files must be listed in the "trace-event-y" make variable
+in the top level Makefile.objs. During build the individual files are combined
+to create a "trace-events-all" file, which is processed by the "tracetool"
+script during build to generate code for the trace events. The
+"trace-events-all" file is also installed into "/usr/share/qemu".
+
+Trace events are invoked directly from source code like this:
#include "trace.h" /* needed for trace event prototype */
@@ -196,12 +200,12 @@ Restriction: "ftrace" backend is restricted to Linux only.
==== Analyzing trace files ====
The "simple" backend produces binary trace files that can be formatted with the
-simpletrace.py script. The script takes the "trace-events" file and the binary
-trace:
+simpletrace.py script. The script takes the "trace-events-all" file and the
+binary trace:
- ./scripts/simpletrace.py trace-events trace-12345
+ ./scripts/simpletrace.py trace-events-all trace-12345
-You must ensure that the same "trace-events" file was used to build QEMU,
+You must ensure that the same "trace-events-all" file was used to build QEMU,
otherwise trace event declarations may have changed and output will not be
consistent.
@@ -259,11 +263,11 @@ probes:
--binary path/to/qemu-binary \
--target-type system \
--target-name x86_64 \
- <trace-events >qemu.stp
+ <trace-events-all >qemu.stp
== Trace event properties ==
-Each event in the "trace-events" file can be prefixed with a space-separated
+Each event in the "trace-events-all" file can be prefixed with a space-separated
list of zero or more of the following event properties.
=== "disable" ===
@@ -275,7 +279,7 @@ programmatically disabled.
In this case you should declare such event with the "disable" property. This
will effectively disable the event at compile time (by using the "nop" backend),
thus having no performance impact at all on regular builds (i.e., unless you
-edit the "trace-events" file).
+edit the "trace-events-all" file).
In addition, there might be cases where relatively complex computations must be
performed to generate values that are only used as arguments for a trace