]> git.proxmox.com Git - mirror_qemu.git/blobdiff - docs/devel/tracing.txt
tracetool: add output filename command-line argument
[mirror_qemu.git] / docs / devel / tracing.txt
index 8c0376fefa4dff4fd078ca2a501d6dfc1afb0eb1..dba43fc7a4095c7f63e1ebe51a50913a214549b4 100644 (file)
@@ -55,12 +55,12 @@ without any sub-directory path prefix. eg io/channel-buffer.c would do
   #include "trace.h"
 
 To access the 'io/trace.h' file. While it is possible to include a trace.h
-file from outside a source files' own sub-directory, this is discouraged in
+file from outside a source file's own sub-directory, this is discouraged in
 general. It is strongly preferred that all events be declared directly in
 the sub-directory that uses them. The only exception is where there are some
 shared trace events defined in the top level directory trace-events file.
 The top level directory generates trace files with a filename prefix of
-"trace-root" instead of just "trace". This is to avoid ambiguity between
+"trace/trace-root" instead of just "trace". This is to avoid ambiguity between
 a trace.h in the current directory, vs the top level directory.
 
 === Using trace events ===
@@ -318,7 +318,8 @@ probes:
                          --target-type system \
                          --target-name x86_64 \
                          --group=all \
-                         trace-events-all >qemu.stp
+                         trace-events-all \
+                         qemu.stp
 
 To facilitate simple usage of systemtap where there merely needs to be printf
 logging of certain probes, a helper script "qemu-trace-stap" is provided.
@@ -342,8 +343,10 @@ 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
-function. In these cases you can use the macro 'TRACE_${EVENT_NAME}_ENABLED' to
-guard such computations and avoid its compilation when the event is disabled:
+function. In these cases you can use 'trace_event_get_state_backends()' to
+guard such computations, so they are skipped if the event has been either
+compile-time disabled or run-time disabled. If the event is compile-time
+disabled, this check will have no performance impact.
 
     #include "trace.h"  /* needed for trace event prototype */
     
@@ -356,7 +359,7 @@ guard such computations and avoid its compilation when the event is disabled:
             align = getpagesize();
         }
         ptr = qemu_memalign(align, size);
-        if (TRACE_QEMU_VMALLOC_ENABLED) { /* preprocessor macro */
+        if (trace_event_get_state_backends(TRACE_QEMU_VMALLOC)) {
             void *complex;
             /* some complex computations to produce the 'complex' value */
             trace_qemu_vmalloc(size, ptr, complex);
@@ -364,10 +367,6 @@ guard such computations and avoid its compilation when the event is disabled:
         return ptr;
     }
 
-You can check both if the event has been disabled and is dynamically enabled at
-the same time using the 'trace_event_get_state_backends' routine (see header
-"trace/control.h" for more information).
-
 === "tcg" ===
 
 Guest code generated by TCG can be traced by defining an event with the "tcg"