Skip to contentSkip to conversation

trace-state: make the behaviour of "disable" consistent across all backends

RFC PATCH Superseded Lluís 5 participants 26 messages Apr 6, 2011 – Apr 26, 2011 Kbuild

v2 of 9 Superseded Latest is v9 →

lore
Share & tools
lore

Lluís

author
#0 lore raw

v2 cover trace-state: make the behaviour of "disable" consistent across all backends

This patch defines the "disable" trace event state to always use the "nop" backend.

As a side-effect, all events are now enabled (without "disable") by default, as all backends (except "stderr") have programmatic support for dynamically (de)activating each trace event.

In order to make this true, the "simple" backend now has a "-trace events=<file>" argument to let the user select which events must be enabled from the very beginning.

NOTES:
* Parsing of -trace arguments is not done in the OS-specific frontends.

---

Changes in v2:

* Documentation fixes.
* Seggregate whitespace/indentation changes.
* Minor code beautifications.
* Make all -trace suboptions explicit.
* Fix minor comments from Stefan.
* Minor trace-events format fixes.
* Integrate changes from Fabien.
* Rebase on qemu.git/master (c8f930c0eeb696d638f4d4bf654e955fa44ff40f).

Lluís Vilanova (11):
minor whitespace/indentation fixes
docs/tracing.txt: minor documentation fixes
trace: [ust] fix generation of 'trace.c' on events without args
trace: [trace-events] fix print formats in some events
trace: [simple] minor code fixes on conditional compilation
trace: generalize the "property" concept in the trace-events file
trace-state: always use the "nop" backend on events with the "disable" keyword
trace-state: [simple] disable all trace points by default
trace-state: [simple] add "-trace events" argument to control initial state
trace-state: [stderr] add support for dynamically enabling/disabling events
trace: enable all events

 Makefile.objs     |    8 +
 configure         |   33 ++--
 docs/tracing.txt  |   50 +++--
 hmp-commands.hx   |   38 ++--
 monitor.c         |   24 ++-
 qemu-config.c     |    8 +
 qemu-options.hx   |   26 ++-
 scripts/tracetool |  121 +++++++------
 simpletrace.h     |    7 -
 stderrtrace.c     |   24 +++
 stderrtrace.h     |   14 ++
 trace-events      |  491 ++++++++++++++++++++++++++---------------------------
 vl.c              |  104 ++++++++---
 13 files changed, 530 insertions(+), 418 deletions(-)
 create mode 100644 stderrtrace.c
 create mode 100644 stderrtrace.h
author
#1 lore raw

PATCH v2 1/11 minor whitespace/indentation fixes

---
 configure       |   30 +++++++++++++-------------
 hmp-commands.hx |   28 ++++++++++++------------
 monitor.c       |   14 ++++++------
 vl.c            |   64 ++++++++++++++++++++++++++++---------------------------
 4 files changed, 68 insertions(+), 68 deletions(-)
configure +15 -15
index faaed60..8754060 100755
@@ -965,7 +965,7 @@ int main(void) { return 0; }
 EOF
 for flag in $gcc_flags; do
     if compile_prog "-Werror $QEMU_CFLAGS" "-Werror $flag" ; then
-	QEMU_CFLAGS="$QEMU_CFLAGS $flag"
+        QEMU_CFLAGS="$QEMU_CFLAGS $flag"
     fi
 done
 
@@ -1264,7 +1264,7 @@ EOF
          sdl_cflags="$sdl_cflags `aalib-config --cflags 2>/dev/null`"
       fi
       if compile_prog "$sdl_cflags" "$sdl_libs" ; then
-	:
+        :
       else
         sdl=no
       fi
@@ -1727,10 +1727,10 @@ EOF
       if test \( "$cpu" = "i386" -o "$cpu" = "x86_64" \) \
          -a -d "$kerneldir/arch/x86/include" ; then
             kvm_cflags="$kvm_cflags -I$kerneldir/arch/x86/include"
-	elif test "$cpu" = "ppc" -a -d "$kerneldir/arch/powerpc/include" ; then
-	    kvm_cflags="$kvm_cflags -I$kerneldir/arch/powerpc/include"
-	elif test "$cpu" = "s390x" -a -d "$kerneldir/arch/s390/include" ; then
-	    kvm_cflags="$kvm_cflags -I$kerneldir/arch/s390/include"
+        elif test "$cpu" = "ppc" -a -d "$kerneldir/arch/powerpc/include" ; then
+            kvm_cflags="$kvm_cflags -I$kerneldir/arch/powerpc/include"
+        elif test "$cpu" = "s390x" -a -d "$kerneldir/arch/s390/include" ; then
+            kvm_cflags="$kvm_cflags -I$kerneldir/arch/s390/include"
         elif test -d "$kerneldir/arch/$cpu/include" ; then
             kvm_cflags="$kvm_cflags -I$kerneldir/arch/$cpu/include"
       fi
@@ -1750,8 +1750,8 @@ EOF
     if test "$kvm" = "yes" ; then
       if has awk && has grep; then
         kvmerr=`LANG=C $cc $QEMU_CFLAGS -o $TMPE $kvm_cflags $TMPC 2>&1 \
-	| grep "error: " \
-	| awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'`
+        | grep "error: " \
+        | awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'`
         if test "$kvmerr" != "" ; then
           echo -e "${kvmerr}\n\
 NOTE: To enable KVM support, update your kernel to 2.6.29+ or install \
@@ -1984,8 +1984,8 @@ cat > $TMPC << EOF
 int
 main(void)
 {
-	/* try to unlink nonexisting file */
-	return (unlinkat(AT_FDCWD, "nonexistent_file", 0));
+        /* try to unlink nonexisting file */
+        return (unlinkat(AT_FDCWD, "nonexistent_file", 0));
 }
 EOF
 if compile_prog "" "" ; then
@@ -2004,8 +2004,8 @@ cat > $TMPC << EOF
 int
 main(void)
 {
-	/* try to start inotify */
-	return inotify_init();
+        /* try to start inotify */
+        return inotify_init();
 }
 EOF
 if compile_prog "" "" ; then
@@ -2479,9 +2479,9 @@ fi
 # enable/disable
 if test -z "$zero_malloc" ; then
     if test "$z_version" = "50" ; then
-	zero_malloc="no"
+        zero_malloc="no"
     else
-	zero_malloc="yes"
+        zero_malloc="yes"
     fi
 fi
 
@@ -3390,7 +3390,7 @@ if test "$target_softmmu" = "yes" ; then
 fi
 
 if test "$target_user_only" = "yes" -a "$static" = "no" -a \
-	"$user_pie" = "yes" ; then
+        "$user_pie" = "yes" ; then
   cflags="-fpie $cflags"
   ldflags="-pie $ldflags"
 fi
hmp-commands.hx +14 -14
index 834e6a8..c3be311 100644
@@ -757,12 +757,12 @@ ETEXI
         .args_type  = "detach:-d,blk:-b,inc:-i,uri:s",
         .params     = "[-d] [-b] [-i] uri",
         .help       = "migrate to URI (using -d to not wait for completion)"
-		      "\n\t\t\t -b for migration without shared storage with"
-		      " full copy of disk\n\t\t\t -i for migration without "
-		      "shared storage with incremental copy of disk "
-		      "(base image shared between src and destination)",
-        .user_print = monitor_user_noop,	
-	.mhandler.cmd_new = do_migrate,
+                      "\n\t\t\t -b for migration without shared storage with"
+                      " full copy of disk\n\t\t\t -i for migration without "
+                      "shared storage with incremental copy of disk "
+                      "(base image shared between src and destination)",
+        .user_print = monitor_user_noop,
+        .mhandler.cmd_new = do_migrate,
     },
 
 
@@ -770,8 +770,8 @@ STEXI
 @item migrate [-d] [-b] [-i] @var{uri}
 @findex migrate
 Migrate to @var{uri} (using -d to not wait for completion).
-	-b for migration with full copy of disk
-	-i for migration with incremental copy of disk (base image is shared)
+        -b for migration with full copy of disk
+        -i for migration with incremental copy of disk (base image is shared)
 ETEXI
 
     {
@@ -794,7 +794,7 @@ ETEXI
         .args_type  = "value:o",
         .params     = "value",
         .help       = "set maximum speed (in bytes) for migrations. "
-	"Defaults to MB if no size suffix is specified, ie. B/K/M/G/T",
+        "Defaults to MB if no size suffix is specified, ie. B/K/M/G/T",
         .user_print = monitor_user_noop,
         .mhandler.cmd_new = do_migrate_set_speed,
     },
@@ -911,14 +911,14 @@ ETEXI
     {
         .name       = "pcie_aer_inject_error",
         .args_type  = "advisory_non_fatal:-a,correctable:-c,"
-	              "id:s,error_status:s,"
-	              "header0:i?,header1:i?,header2:i?,header3:i?,"
-	              "prefix0:i?,prefix1:i?,prefix2:i?,prefix3:i?",
+                      "id:s,error_status:s,"
+                      "header0:i?,header1:i?,header2:i?,header3:i?,"
+                      "prefix0:i?,prefix1:i?,prefix2:i?,prefix3:i?",
         .params     = "[-a] [-c] id "
                       "<error_status> [<tlp header> [<tlp header prefix>]]",
         .help       = "inject pcie aer error\n\t\t\t"
-	              " -a for advisory non fatal error\n\t\t\t"
-	              " -c for correctable error\n\t\t\t"
+                      " -a for advisory non fatal error\n\t\t\t"
+                      " -c for correctable error\n\t\t\t"
                       "<id> = qdev device id\n\t\t\t"
                       "<error_status> = error string or 32bit\n\t\t\t"
                       "<tlb header> = 32bit x 4\n\t\t\t"
monitor.c +7 -7
index f1a08dc..2ba1362 100644
@@ -630,7 +630,7 @@ static void do_trace_file(Monitor *mon, const QDict *qdict)
 
 static void user_monitor_complete(void *opaque, QObject *ret_data)
 {
-    MonitorCompletionData *data = (MonitorCompletionData *)opaque; 
+    MonitorCompletionData *data = (MonitorCompletionData *)opaque;
 
     if (ret_data) {
         data->user_print(data->mon, ret_data);
@@ -3955,11 +3955,11 @@ static int default_fmt_size = 4;
 static int is_valid_option(const char *c, const char *typestr)
 {
     char option[3];
-  
+
     option[0] = '-';
     option[1] = *c;
     option[2] = '\0';
-  
+
     typestr = strstr(typestr, option);
     return (typestr != NULL);
 }
@@ -4299,7 +4299,7 @@ static const mon_cmd_t *monitor_parse_command(Monitor *mon,
                     p++;
                     if(c != *p) {
                         if(!is_valid_option(p, typestr)) {
-                  
+
                             monitor_printf(mon, "%s: unsupported option -%c\n",
                                            cmdname, *p);
                             goto fail;
@@ -4718,7 +4718,7 @@ static int check_client_args_type(const QDict *client_args,
             if (qobject_type(client_arg) != QTYPE_QINT) {
                 qerror_report(QERR_INVALID_PARAMETER_TYPE, client_arg_name,
                               "int");
-                return -1; 
+                return -1;
             }
             break;
         case 'T':
@@ -4726,7 +4726,7 @@ static int check_client_args_type(const QDict *client_args,
                 qobject_type(client_arg) != QTYPE_QFLOAT) {
                 qerror_report(QERR_INVALID_PARAMETER_TYPE, client_arg_name,
                               "number");
-               return -1; 
+               return -1;
             }
             break;
         case 'b':
@@ -4734,7 +4734,7 @@ static int check_client_args_type(const QDict *client_args,
             if (qobject_type(client_arg) != QTYPE_QBOOL) {
                 qerror_report(QERR_INVALID_PARAMETER_TYPE, client_arg_name,
                               "bool");
-               return -1; 
+               return -1;
             }
             break;
         case 'O':
vl.c +32 -32

129 lines not on this page · raw message

#2 lore raw

Re: [Qemu-devel] [PATCH v2 01/11] minor whitespace/indentation fixes

Quoted 7 lines · Lluís

---
 configure       |   30 +++++++++++++-------------
 hmp-commands.hx |   28 ++++++++++++------------
 monitor.c       |   14 ++++++------
 vl.c            |   64 ++++++++++++++++++++++++++++---------------------------

 4 files changed, 68 insertions(+), 68 deletions(-)

Not tracing related. Whitespace changes make it harder for forks/downstream and clutter git-blame(1). Please drop this patch.

Stefan

#3 lore raw

Re: [Qemu-devel] [PATCH v2 01/11] minor whitespace/indentation fixes

Quoted 11 lines · Stefan Hajnoczi
Quoted 7 lines · Lluís

---
 configure       |   30 +++++++++++++-------------
 hmp-commands.hx |   28 ++++++++++++------------
 monitor.c       |   14 ++++++------
 vl.c            |   64 ++++++++++++++++++++++++++++---------------------------

 4 files changed, 68 insertions(+), 68 deletions(-)

Not tracing related. Whitespace changes make it harder for forks/downstream and clutter git-blame(1). Please drop this patch.

I'm not arguing for or against this patch, just want to point to "git-blame -w".

author
#4 lore raw

PATCH v2 2/11 docs/tracing.txt: minor documentation fixes

In reply to Lluís
---
 docs/tracing.txt |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
docs/tracing.txt +9 -9
index f15069c..34b0901 100644
@@ -26,14 +26,14 @@ for debugging, profiling, and observing execution.
 
 == Trace events ==
 
-There is a set of static trace events declared in the trace-events source
+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:
 
     qemu_malloc(size_t size, void *ptr) "size %zu ptr %p"
     qemu_free(void *ptr) "ptr %p"
 
-The trace-events file is processed by the tracetool script during build to
+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:
 
@@ -52,10 +52,10 @@ source code like this:
 
 === Declaring trace events ===
 
-The tracetool script produces the trace.h header file which is included by
+The "tracetool" script produces the trace.h header file which is included by
 every source file that uses trace events.  Since many source files include
-trace.h, it uses a minimum of types and other header files included to keep
-the namespace clean and compile times and dependencies down.
+trace.h, it uses a minimum of types and other header files included to keep the
+namespace clean and compile times and dependencies down.
 
 Trace events should use types as follows:
 
@@ -105,10 +105,10 @@ portability macros, ensure they are preceded and followed by double quotes:
 
 == Trace backends ==
 
-The tracetool script automates tedious trace event code generation and also
+The "tracetool" script automates tedious trace event code generation and also
 keeps the trace event declarations independent of the trace backend.  The trace
 events are not tightly coupled to a specific trace backend, such as LTTng or
-SystemTap.  Support for trace backends can be added by extending the tracetool
+SystemTap.  Support for trace backends can be added by extending the "tracetool"
 script.
 
 The trace backend is chosen at configure time and only one trace backend can
@@ -176,12 +176,12 @@ events at runtime inside QEMU:
 ==== 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
+simpletrace.py script.  The script takes the "trace-events" file and the binary
 trace:
 
     ./simpletrace.py trace-events trace-12345
 
-You must ensure that the same trace-events file was used to build QEMU,
+You must ensure that the same "trace-events" file was used to build QEMU,
 otherwise trace event declarations may have changed and output will not be
 consistent.
 
author
#5 lore raw

PATCH v2 3/11 trace: [ust] fix generation of 'trace.c' on events without args

In reply to Lluís
---
 scripts/tracetool |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
scripts/tracetool +4 -3
index 412f695..d88cb43 100755
@@ -338,6 +338,7 @@ linetoc_ust()
     name=$(get_name "$1")
     args=$(get_args "$1")
     argnames=$(get_argnames "$1", ",")
+    [ -z "$argnames" ] || argnames=", $argnames"
     fmt=$(get_fmt "$1")
 
     cat <<EOF
@@ -345,7 +346,7 @@ DEFINE_TRACE(ust_$name);
 
 static void ust_${name}_probe($args)
 {
-    trace_mark(ust, $name, "$fmt", $argnames);
+    trace_mark(ust, $name, "$fmt"$argnames);
 }
 EOF
 
@@ -488,7 +489,7 @@ EOF
         cat <<EOF
   $arg = \$arg$i;
 EOF
-	i="$((i+1))"
+        i="$((i+1))"
     done
 
     cat <<EOF
@@ -585,7 +586,7 @@ tracetostap()
        exit 1
     fi
     if [ -z "$probeprefix" ]; then
-	probeprefix="qemu.$targettype.$targetarch";
+        probeprefix="qemu.$targettype.$targetarch";
     fi
     echo "/* This file is autogenerated by tracetool, do not edit. */"
     convert stap
author
#6 lore raw

PATCH v2 4/11 trace: [trace-events] fix print formats in some events

In reply to Lluís
---
 trace-events |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
trace-events +2 -2
index 06efdb7..9fcc3bb 100644
@@ -253,8 +253,8 @@ disable leon3_set_irq(int intno) "Set CPU IRQ %d"
 disable leon3_reset_irq(int intno) "Reset CPU IRQ %d"
 
 # spice-qemu-char.c
-disable spice_vmc_write(ssize_t out, int len) "spice wrottn %lu of requested %zd"
-disable spice_vmc_read(int bytes, int len) "spice read %lu of requested %zd"
+disable spice_vmc_write(ssize_t out, int len) "spice wrottn %zd of requested %d"
+disable spice_vmc_read(int bytes, int len) "spice read %d of requested %d"
 disable spice_vmc_register_interface(void *scd) "spice vmc registered interface %p"
 disable spice_vmc_unregister_interface(void *scd) "spice vmc unregistered interface %p"
 
author
#7 lore raw

PATCH v2 5/11 trace: [simple] minor code fixes on conditional compilation

In reply to Lluís
---
 monitor.c     |    4 +---
 qemu-config.c |    4 ++--
 simpletrace.h |    7 -------
 vl.c          |    7 +++++--
 4 files changed, 8 insertions(+), 14 deletions(-)
monitor.c +1 -3
index 2ba1362..377424e 100644
@@ -57,9 +57,7 @@
 #include "json-parser.h"
 #include "osdep.h"
 #include "exec-all.h"
-#ifdef CONFIG_SIMPLE_TRACE
 #include "trace.h"
-#endif
 #include "ui/qemu-spice.h"
 
 //#define DEBUG
@@ -592,7 +590,7 @@ static void do_help_cmd(Monitor *mon, const QDict *qdict)
     help_cmd(mon, qdict_get_try_str(qdict, "name"));
 }
 
-#ifdef CONFIG_SIMPLE_TRACE
+#if defined(CONFIG_SIMPLE_TRACE)
 static void do_change_trace_event_state(Monitor *mon, const QDict *qdict)
 {
     const char *tp_name = qdict_get_str(qdict, "name");
qemu-config.c +2 -2
index 323d3c2..8ba0804 100644
@@ -297,7 +297,7 @@ static QemuOptsList qemu_mon_opts = {
     },
 };
 
-#ifdef CONFIG_SIMPLE_TRACE
+#if defined(CONFIG_SIMPLE_TRACE)
 static QemuOptsList qemu_trace_opts = {
     .name = "trace",
     .implied_opt_name = "trace",
@@ -461,7 +461,7 @@ static QemuOptsList *vm_config_groups[32] = {
     &qemu_global_opts,
     &qemu_mon_opts,
     &qemu_cpudef_opts,
-#ifdef CONFIG_SIMPLE_TRACE
+#if defined(CONFIG_SIMPLE_TRACE)
     &qemu_trace_opts,
 #endif
     &qemu_option_rom_opts,
simpletrace.h +0 -7
index 8d893bd..196bbe7 100644
@@ -15,7 +15,6 @@
 #include <stdbool.h>
 #include <stdio.h>
 
-#ifdef CONFIG_SIMPLE_TRACE
 typedef uint64_t TraceEventID;
 
 typedef struct {
@@ -38,11 +37,5 @@ void st_set_trace_file_enabled(bool enable);
 bool st_set_trace_file(const char *file);
 void st_flush_trace_buffer(void);
 bool st_init(const char *file);
-#else
-static inline bool st_init(const char *file)
-{
-    return true;
-}
-#endif /* !CONFIG_SIMPLE_TRACE */
 
 #endif /* SIMPLETRACE_H */
vl.c +5 -2
index 8478cb8..5a9ea51 100644
@@ -156,7 +156,6 @@ int main(int argc, char **argv)
 #include "slirp/libslirp.h"
 
 #include "trace.h"
-#include "simpletrace.h"
 #include "qemu-queue.h"
 #include "cpus.h"
 #include "arch_init.h"
@@ -1967,7 +1966,9 @@ int main(int argc, char **argv, char **envp)
     int show_vnc_port = 0;
 #endif
     int defconfig = 1;
+#if defined(CONFIG_SIMPLE_TRACE)
     const char *trace_file = NULL;
+#endif
 
     atexit(qemu_run_exit_notifiers);
     error_set_progname(argv[0]);
@@ -2760,7 +2761,7 @@ int main(int argc, char **argv, char **envp)
                 }
                 xen_mode = XEN_ATTACH;
                 break;
-#ifdef CONFIG_SIMPLE_TRACE
+#if defined(CONFIG_SIMPLE_TRACE)
             case QEMU_OPTION_trace:
                 opts = qemu_opts_parse(qemu_find_opts("trace"), optarg, 0);
                 if (opts) {
@@ -2813,9 +2814,11 @@ int main(int argc, char **argv, char **envp)
     }
     loc_set_none();
 
+#if defined(CONFIG_SIMPLE_TRACE)
     if (!st_init(trace_file)) {
         fprintf(stderr, "warning: unable to initialize simple trace backend\n");
     }
+#endif
 
     /* If no data_dir is specified then try to find it relative to the
        executable path.  */
#8 lore raw

Re: [Qemu-devel] [PATCH v2 05/11] trace: [simple] minor code fixes on conditional compilation

Quoted 7 lines · Lluís

---
 monitor.c     |    4 +---
 qemu-config.c |    4 ++--
 simpletrace.h |    7 -------
 vl.c          |    7 +++++--

 4 files changed, 8 insertions(+), 14 deletions(-)

Please drop this patch, it's purely a style change.

Stefan

author
#9 lore raw

PATCH v2 6/11 trace: generalize the "property" concept in the trace-events file

In reply to Lluís

This adds/modifies the following functions:

* get_name: Get _only_ the event name
* has_property: Return whether an event has a property (keyword before the event name)

---
 docs/tracing.txt  |    6 ++--
 scripts/tracetool |   73 ++++++++++++++++++++++++-----------------------------
 2 files changed, 36 insertions(+), 43 deletions(-)
docs/tracing.txt +3 -3
index 34b0901..a9fd85b 100644
@@ -38,7 +38,7 @@ generate code for the trace events.  Trace events are invoked directly from
 source code like this:
 
     #include "trace.h"  /* needed for trace event prototype */
-
+ 
     void *qemu_malloc(size_t size)
     {
         void *ptr;
@@ -98,7 +98,7 @@ portability macros, ensure they are preceded and followed by double quotes:
 4. Name trace events after their function.  If there are multiple trace events
    in one function, append a unique distinguisher at the end of the name.
 
-5. Declare trace events with the "disable" keyword.  Some trace events can
+5. Declare trace events with the "disable" property.  Some trace events can
    produce a lot of output and users are typically only interested in a subset
    of trace events.  Marking trace events disabled by default saves the user
    from having to manually disable noisy trace events.
@@ -168,7 +168,7 @@ The st_change_trace_event_state() function can be used to enable or disable trac
 events at runtime inside QEMU:
 
     #include "trace.h"
-    
+
     st_change_trace_event_state("virtio_irq", true); /* enable */
     [...]
     st_change_trace_event_state("virtio_irq", false); /* disable */
scripts/tracetool +33 -40

133 lines not on this page · raw message

#10 lore raw

Re: [Qemu-devel] [PATCH v2 06/11] trace: generalize the "property" concept in the trace-events file

Quoted 28 lines · Lluís
docs/tracing.txt +0 -0
index 34b0901..a9fd85b 100644
@@ -38,7 +38,7 @@ generate code for the trace events.  Trace events are invoked directly from

 source code like this:

    #include "trace.h"  /* needed for trace event prototype */

docs/tracing.txt +1 -1
-
+

    void *qemu_malloc(size_t size)
    {
        void *ptr;

docs/tracing.txt +0 -0
@@ -98,7 +98,7 @@ portability macros, ensure they are preceded and followed by double quotes:

 4. Name trace events after their function.  If there are multiple trace events in one function, append a unique distinguisher at the end of the name.

-5. Declare trace events with the "disable" keyword.  Some trace events can +5. Declare trace events with the "disable" property.  Some trace events can produce a lot of output and users are typically only interested in a subset of trace events.  Marking trace events disabled by default saves the user from having to manually disable noisy trace events.

docs/tracing.txt +0 -0
@@ -168,7 +168,7 @@ The st_change_trace_event_state() function can be used to enable or disable trac

 events at runtime inside QEMU:

    #include "trace.h"

docs/tracing.txt +1 -1
-
+
Quoted 3 lines

    st_change_trace_event_state("virtio_irq", true); /* enable */ [...]
    st_change_trace_event_state("virtio_irq", false); /* disable */

Tailing whitespace is there due to wiki formatting. Please do not remove it.

The rest looks good.

Stefan

author
#11 lore raw

PATCH v2 7/11 trace-state: always use the "nop" backend on events with the "disable" keyword

In reply to Lluís

Any event with the keyword/property "disable" generates an empty trace event using the "nop" backend, regardless of the current backend.

---
 docs/tracing.txt  |   25 +++++++++++++++----------
 scripts/tracetool |   15 ++-------------
 2 files changed, 17 insertions(+), 23 deletions(-)
docs/tracing.txt +15 -10
index a9fd85b..9138dca 100644
@@ -12,15 +12,11 @@ for debugging, profiling, and observing execution.
     ./configure --trace-backend=simple
     make
 
-2. Enable trace events you are interested in:
-
-    $EDITOR trace-events  # remove "disable" from events you want
-
-3. Run the virtual machine to produce a trace file:
+2. Run the virtual machine to produce a trace file:
 
     qemu ... # your normal QEMU invocation
 
-4. Pretty-print the binary trace file:
+3. Pretty-print the binary trace file:
 
     ./simpletrace.py trace-events trace-*
 
@@ -98,10 +94,11 @@ portability macros, ensure they are preceded and followed by double quotes:
 4. Name trace events after their function.  If there are multiple trace events
    in one function, append a unique distinguisher at the end of the name.
 
-5. Declare trace events with the "disable" property.  Some trace events can
-   produce a lot of output and users are typically only interested in a subset
-   of trace events.  Marking trace events disabled by default saves the user
-   from having to manually disable noisy trace events.
+5. If specific trace events are going to be called a huge number of times, this
+   might have a noticeable performance impact even when the trace events are
+   programmatically disabled. In this case you should declare the trace event
+   with the "disable" property, which will effectively disable it at compile
+   time (using the "nop" backend).
 
 == Trace backends ==
 
@@ -126,6 +123,9 @@ The "nop" backend generates empty trace event functions so that the compiler
 can optimize out trace events completely.  This is the default and imposes no
 performance penalty.
 
+Note that regardless of the selected trace backend, events with the "disable"
+property will be generated with the "nop" backend.
+
 === Stderr ===
 
 The "stderr" backend sends trace events directly to standard error.  This
@@ -134,6 +134,11 @@ effectively turns trace events into debug printfs.
 This is the simplest backend and can be used together with existing code that
 uses DPRINTF().
 
+Note that with this backend trace events cannot be programmatically
+enabled/disabled. Thus, in order to trim down the amount of output and the
+performance impact of tracing, you might want to add the "disable" property in
+the "trace-events" file for those events you are not interested in.
+
 === Simpletrace ===
 
 The "simple" backend supports common use cases and comes as part of the QEMU
scripts/tracetool +2 -13
index 6d8ead2..7506776 100755
@@ -506,21 +506,10 @@ convert()
         # Skip comments and empty lines
         test -z "${str%%#*}" && continue
 
+        echo
         # Process the line.  The nop backend handles disabled lines.
-        disable="0"
         if has_property "$str" "disable"; then
-            disable="1"
-        fi
-        echo
-        if [ "$disable" = "1" ]; then
-            # Pass the disabled state as an arg for the simple
-            # or DTrace backends which handle it dynamically.
-            # For all other backends, call lineto$1_nop()
-            if [ $backend = "simple" -o "$backend" = "dtrace" ]; then
-                "$process_line" "$str"
-            else
-                "lineto$1_nop" "${str##disable }"
-            fi
+            "lineto$1_nop" "$str"
         else
             "$process_line" "$str"
         fi
author
#12 lore raw

PATCH v2 8/11 trace-state: [simple] disable all trace points by default

In reply to Lluís

Note that this refers to the backend-specific state (whether the output must be generated), not the event "disabled" property (which always uses the "nop" backend).

---
 scripts/tracetool |    9 ++-------
 trace-events      |    3 ---
 2 files changed, 2 insertions(+), 10 deletions(-)
scripts/tracetool +2 -7
index 7506776..e3aec89 100755
@@ -221,15 +221,10 @@ EOF
 
 linetoc_simple()
 {
-    local name state
+    local name
     name=$(get_name "$1")
-    if has_property "$1" "disable"; then
-        state="0"
-    else
-        state="1"
-    fi
     cat <<EOF
-{.tp_name = "$name", .state=$state},
+{.tp_name = "$name", .state=0},
 EOF
     simple_event_num=$((simple_event_num + 1))
 }
trace-events +0 -3
index 9fcc3bb..61bb3fb 100644
@@ -17,9 +17,6 @@
 # Example: qemu_malloc(size_t size) "size %zu"
 #
 # The "disable" keyword will build without the trace event.
-# In case of 'simple' trace backend, it will allow the trace event to be
-# compiled, but this would be turned off by default. It can be toggled on via
-# the monitor.
 #
 # The <name> must be a valid as a C function name.
 #
author
#13 lore raw

PATCH v2 9/11 trace-state: [simple] add "-trace events" argument to control initial state

In reply to Lluís

When using the "simple" tracing backend, all events are in disabled state by default.

The "-trace events" argument can be used to provide a file with a list of trace event names that will be enabled prior to starting execution. This saves the user from manually toggling event states through the monitor interface, as well as enables early tracing for the selected points, much like other more-sophisticated backends like "ust" or "dtrace".

---
 docs/tracing.txt |    5 +++++
 qemu-config.c    |    3 +++
 qemu-options.hx  |   18 ++++++++++++++----
 vl.c             |   26 ++++++++++++++++++++++++++
 4 files changed, 48 insertions(+), 4 deletions(-)
docs/tracing.txt +5 -0
index 9138dca..26b221f 100644
@@ -146,6 +146,11 @@ source tree.  It may not be as powerful as platform-specific or third-party
 trace backends but it is portable.  This is the recommended trace backend
 unless you have specific needs for more advanced backends.
 
+==== Enabling trace events from the command line ====
+
+The "-trace events=<file>" command line argument can be used to enable the
+events listed in <file> from the very beginning of the program.
+
 ==== Monitor commands ====
 
 * info trace
qemu-config.c +3 -0
index 8ba0804..7c7357f 100644
@@ -306,6 +306,9 @@ static QemuOptsList qemu_trace_opts = {
         {
             .name = "file",
             .type = QEMU_OPT_STRING,
+        },{
+            .name = "events",
+            .type = QEMU_OPT_STRING,
         },
         { /* end if list */ }
     },
qemu-options.hx +14 -4
index ef60730..ff8e75d 100644
@@ -2358,13 +2358,23 @@ option will prevent QEMU from loading these configuration files at startup.
 ETEXI
 #ifdef CONFIG_SIMPLE_TRACE
 DEF("trace", HAS_ARG, QEMU_OPTION_trace,
-    "-trace\n"
-    "                Specify a trace file to log traces to\n",
+    "-trace [file=<file>][,events=<file>]\n"
+    "                specify tracing options\n",
     QEMU_ARCH_ALL)
 STEXI
-@item -trace
+@item -trace [file=@var{file}][,events=@var{file}]
 @findex -trace
-Specify a trace file to log output traces to.
+
+Specify tracing options.
+
+@table @option
+@item file=@var{file}
+Log output traces to @var{file}.
+@item events=@var{file}
+Immediately enable events listed in @var{file}.
+The file must contain one event name (as listed in the @var{trace-events} file)
+per line.
+@end table
 ETEXI
 #endif
 
vl.c +26 -0
index 5a9ea51..35d440d 100644
@@ -1968,6 +1968,7 @@ int main(int argc, char **argv, char **envp)
     int defconfig = 1;
 #if defined(CONFIG_SIMPLE_TRACE)
     const char *trace_file = NULL;
+    const char *trace_events_file = NULL;
 #endif
 
     atexit(qemu_run_exit_notifiers);
@@ -2766,6 +2767,7 @@ int main(int argc, char **argv, char **envp)
                 opts = qemu_opts_parse(qemu_find_opts("trace"), optarg, 0);
                 if (opts) {
                     trace_file = qemu_opt_get(opts, "file");
+                    trace_events_file = qemu_opt_get(opts, "events");
                 }
                 break;
 #endif
@@ -2818,6 +2820,30 @@ int main(int argc, char **argv, char **envp)
     if (!st_init(trace_file)) {
         fprintf(stderr, "warning: unable to initialize simple trace backend\n");
     }
+    if (trace_events_file) {
+        FILE *trace_events_fp = fopen(trace_events_file, "r");
+        if (!trace_events_fp) {
+            fprintf(stderr, "could not open trace events file '%s': %s\n",
+                    trace_events_file, strerror(errno));
+            exit(1);
+        }
+        char line_buf[1024];
+        while (fgets(line_buf, sizeof(line_buf), trace_events_fp)) {
+            size_t len = strlen(line_buf);
+            if (len > 1) {              /* skip empty lines */
+                line_buf[len - 1] = '\0';
+                if (!st_change_trace_event_state(line_buf, true)) {
+                    fprintf(stderr, "trace event '%s' does not exist\n", line_buf);
+                    exit(1);
+                }
+            }
+        }
+        if (fclose(trace_events_fp) != 0) {
+            fprintf(stderr, "error closing file '%s': %s\n",
+                    trace_events_file, strerror(errno));
+            exit(1);
+        }
+    }
 #endif
 
     /* If no data_dir is specified then try to find it relative to the
author
#14 lore raw

PATCH v2 10/11 trace-state: [stderr] add support for dynamically enabling/disabling events

In reply to Lluís

This includes all the control interfaces already provided by the "simple" backend (i.e., command line, programmatic and monitor).

---
 Makefile.objs     |    8 +++++++-
 configure         |    3 +++
 docs/tracing.txt  |    6 ++----
 hmp-commands.hx   |   10 ++++++++--
 monitor.c         |    8 +++++++-
 qemu-config.c     |    7 ++++---
 qemu-options.hx   |    8 +++++++-
 scripts/tracetool |   33 ++++++++++++++++++++++++++++-----
 stderrtrace.c     |   24 ++++++++++++++++++++++++
 stderrtrace.h     |   14 ++++++++++++++
 vl.c              |   11 +++++++++--
 11 files changed, 113 insertions(+), 19 deletions(-)
 create mode 100644 stderrtrace.c
 create mode 100644 stderrtrace.h
Makefile.objs +7 -1
index c05f5e5..f7cd67b 100644
@@ -342,15 +342,22 @@ trace-dtrace.o: trace-dtrace.dtrace $(GENERATED_HEADERS)
 	$(call quiet-command,dtrace -o $@ -G -s $<, "  GEN trace-dtrace.o")
 
 simpletrace.o: simpletrace.c $(GENERATED_HEADERS)
+stderrtrace.o: stderrtrace.c $(GENERATED_HEADERS)
 
 ifeq ($(TRACE_BACKEND),dtrace)
 trace-obj-y = trace-dtrace.o
 else
 trace-obj-y = trace.o
+
 ifeq ($(TRACE_BACKEND),simple)
 trace-obj-y += simpletrace.o
 user-obj-y += qemu-timer-common.o
 endif
+
+ifeq ($(TRACE_BACKEND),stderr)
+trace-obj-y += stderrtrace.o
+endif
+
 endif
 
 ######################################################################
@@ -361,4 +368,3 @@ libcacard-y = cac.o event.o vcard.o vreader.o vcard_emul_nss.o vcard_emul_type.o
 vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
 
 vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS)
-
configure +3 -0
index 8754060..7dc9bdc 100755
@@ -2933,6 +2933,9 @@ echo "TRACE_BACKEND=$trace_backend" >> $config_host_mak
 if test "$trace_backend" = "simple"; then
   echo "CONFIG_SIMPLE_TRACE=y" >> $config_host_mak
 fi
+if test "$trace_backend" = "stderr"; then
+  echo "CONFIG_STDERR_TRACE=y" >> $config_host_mak
+fi
 # Set the appropriate trace file.
 if test "$trace_backend" = "simple"; then
   trace_file="\"$trace_file-%u\""
docs/tracing.txt +2 -4
index 26b221f..51fe0ad 100644
@@ -134,10 +134,8 @@ effectively turns trace events into debug printfs.
 This is the simplest backend and can be used together with existing code that
 uses DPRINTF().
 
-Note that with this backend trace events cannot be programmatically
-enabled/disabled. Thus, in order to trim down the amount of output and the
-performance impact of tracing, you might want to add the "disable" property in
-the "trace-events" file for those events you are not interested in.
+See the documentation in the "simple" backend for instruction on how to control
+trace event states from the command line, the monitor and/or programmatically.
 
 === Simpletrace ===
 
hmp-commands.hx +8 -2
index c3be311..7cca351 100644
@@ -180,7 +180,7 @@ STEXI
 Output logs to @var{filename}.
 ETEXI
 
-#ifdef CONFIG_SIMPLE_TRACE
+#if defined(CONFIG_SIMPLE_TRACE) || defined(CONFIG_STDERR_TRACE)
     {
         .name       = "trace-event",
         .args_type  = "name:s,option:b",
@@ -194,7 +194,9 @@ STEXI
 @findex trace-event
 changes status of a trace event
 ETEXI
+#endif
 
+#if defined(CONFIG_SIMPLE_TRACE)
     {
         .name       = "trace-file",
         .args_type  = "op:s?,arg:F?",
@@ -1355,10 +1357,14 @@ show roms
 @end table
 ETEXI
 
-#ifdef CONFIG_SIMPLE_TRACE
+#if defined(CONFIG_SIMPLE_TRACE)
 STEXI
 @item info trace
 show contents of trace buffer
+ETEXI
+#endif
+#if defined(CONFIG_SIMPLE_TRACE) || defined(CONFIG_STDERR_TRACE)
+STEXI
 @item info trace-events
 show available trace events and their state
 ETEXI
monitor.c +7 -1
index 377424e..7991c6c 100644
@@ -590,7 +590,7 @@ static void do_help_cmd(Monitor *mon, const QDict *qdict)
     help_cmd(mon, qdict_get_try_str(qdict, "name"));
 }
 
-#if defined(CONFIG_SIMPLE_TRACE)
+#if defined(CONFIG_SIMPLE_TRACE) || defined(CONFIG_STDERR_TRACE)
 static void do_change_trace_event_state(Monitor *mon, const QDict *qdict)
 {
     const char *tp_name = qdict_get_str(qdict, "name");
@@ -601,7 +601,9 @@ static void do_change_trace_event_state(Monitor *mon, const QDict *qdict)
         monitor_printf(mon, "unknown event name \"%s\"\n", tp_name);
     }
 }
+#endif
 
+#if defined(CONFIG_SIMPLE_TRACE)
 static void do_trace_file(Monitor *mon, const QDict *qdict)
 {
     const char *op = qdict_get_try_str(qdict, "op");
@@ -999,7 +1001,9 @@ static void do_info_trace(Monitor *mon)
 {
     st_print_trace((FILE *)mon, &monitor_fprintf);
 }
+#endif
 
+#if defined(CONFIG_SIMPLE_TRACE) || defined(CONFIG_STDERR_TRACE)
 static void do_info_trace_events(Monitor *mon)
 {
     st_print_trace_events((FILE *)mon, &monitor_fprintf);
@@ -3103,6 +3107,8 @@ static const mon_cmd_t info_cmds[] = {
         .help       = "show current contents of trace buffer",
         .mhandler.info = do_info_trace,
     },
+#endif
+#if defined(CONFIG_SIMPLE_TRACE) || defined(CONFIG_STDERR_TRACE)
     {
         .name       = "trace-events",
         .args_type  = "",
qemu-config.c +4 -3
index 7c7357f..7a20971 100644
@@ -297,7 +297,7 @@ static QemuOptsList qemu_mon_opts = {
     },
 };
 
-#if defined(CONFIG_SIMPLE_TRACE)
+#if defined(CONFIG_SIMPLE_TRACE) || defined(CONFIG_STDERR_TRACE)
 static QemuOptsList qemu_trace_opts = {
     .name = "trace",
     .implied_opt_name = "trace",
@@ -306,7 +306,8 @@ static QemuOptsList qemu_trace_opts = {
         {
             .name = "file",
             .type = QEMU_OPT_STRING,
-        },{
+        },
+        {
             .name = "events",
             .type = QEMU_OPT_STRING,
         },
@@ -464,7 +465,7 @@ static QemuOptsList *vm_config_groups[32] = {
     &qemu_global_opts,
     &qemu_mon_opts,
     &qemu_cpudef_opts,
-#if defined(CONFIG_SIMPLE_TRACE)
+#if defined(CONFIG_SIMPLE_TRACE) || defined(CONFIG_STDERR_TRACE)
     &qemu_trace_opts,
 #endif
     &qemu_option_rom_opts,
qemu-options.hx +7 -1
index ff8e75d..1bcc27b 100644
@@ -2356,9 +2356,13 @@ Normally QEMU loads a configuration file from @var{sysconfdir}/qemu.conf and
 @var{sysconfdir}/target-@var{ARCH}.conf on startup.  The @code{-nodefconfig}
 option will prevent QEMU from loading these configuration files at startup.
 ETEXI
-#ifdef CONFIG_SIMPLE_TRACE
+#if defined(CONFIG_SIMPLE_TRACE) || defined(CONFIG_STDERR_TRACE)
 DEF("trace", HAS_ARG, QEMU_OPTION_trace,
+#if defined(CONFIG_SIMPLE_TRACE)
     "-trace [file=<file>][,events=<file>]\n"
+#elif defined(CONFIG_STDERR_TRACE)
+    "-trace [events=<file>]\n"
+#endif
     "                specify tracing options\n",
     QEMU_ARCH_ALL)
 STEXI
@@ -2368,7 +2372,9 @@ STEXI
 Specify tracing options.
 
 @table @option
+#if defined(CONFIG_SIMPLE_TRACE)
 @item file=@var{file}
+#endif
 Log output traces to @var{file}.
 @item events=@var{file}
 Immediately enable events listed in @var{file}.
scripts/tracetool +28 -5
index e3aec89..17e3f37 100755
@@ -241,7 +241,12 @@ linetoh_begin_stderr()
 {
     cat <<EOF
 #include <stdio.h>
+#include "stderrtrace.h"
+
+extern TraceEvent trace_list[];
 EOF
+
+    stderr_event_num=0
 }
 
 linetoh_stderr()
@@ -260,29 +265,47 @@ linetoh_stderr()
     cat <<EOF
 static inline void trace_$name($args)
 {
-    fprintf(stderr, "$name $fmt\n" $argnames);
+    if (trace_list[$stderr_event_num].state != 0) {
+        fprintf(stderr, "$name $fmt\n" $argnames);
+    }
 }
 EOF
+    stderr_event_num=$((stderr_event_num + 1))
+
 }
 
 linetoh_end_stderr()
 {
-return
+    cat <<EOF
+#define NR_TRACE_EVENTS $stderr_event_num
+EOF
 }
 
 linetoc_begin_stderr()
 {
-return
+    cat <<EOF
+#include "trace.h"
+
+TraceEvent trace_list[] = {
+EOF
+    stderr_event_num=0
 }
 
 linetoc_stderr()
 {
-return
+    local name
+    name=$(get_name "$1")
+    cat <<EOF
+{.tp_name = "$name", .state=0},
+EOF
+    stderr_event_num=$(($stderr_event_num + 1))
 }
 
 linetoc_end_stderr()
 {
-return
+    cat <<EOF
+};
+EOF
 }
 #END OF STDERR
 
stderrtrace.c new file +24 -0
new file mode 100644
index 0000000..dac373c
@@ -0,0 +1,24 @@
+#include "trace.h"
+
+void st_print_trace_events(FILE *stream, int (*stream_printf)(FILE *stream, const char *fmt, ...))
+{
+    unsigned int i;
+
+    for (i = 0; i < NR_TRACE_EVENTS; i++) {
+        stream_printf(stream, "%s [Event ID %u] : state %u\n",
+                      trace_list[i].tp_name, i, trace_list[i].state);
+    }
+}
+
+bool st_change_trace_event_state(const char *name, bool enabled)
+{
+    int i;
+
+    for (i = 0; i < NR_TRACE_EVENTS; i++) {
+        if (!strcmp(trace_list[i].tp_name, name)) {
+            trace_list[i].state = enabled;
+            return true;
+        }
+    }
+    return false;
+}
stderrtrace.h new file +14 -0
new file mode 100644
index 0000000..48ac36a
@@ -0,0 +1,14 @@
+#ifndef _STDERRTRACE_H_
+#define _STDERRTRACE_H_
+
+typedef uint64_t TraceEventID;
+
+typedef struct {
+    const char *tp_name;
+    bool state;
+} TraceEvent;
+
+void st_print_trace_events(FILE *stream, fprintf_function stream_printf);
+bool st_change_trace_event_state(const char *name, bool enabled);
+
+#endif /* ! _STDERRTRACE_H_ */
vl.c +9 -2
index 35d440d..67dc530 100644
@@ -1966,7 +1966,7 @@ int main(int argc, char **argv, char **envp)
     int show_vnc_port = 0;
 #endif
     int defconfig = 1;
-#if defined(CONFIG_SIMPLE_TRACE)
+#if defined(CONFIG_SIMPLE_TRACE) || defined(CONFIG_STDERR_TRACE)
     const char *trace_file = NULL;
     const char *trace_events_file = NULL;
 #endif
@@ -2762,7 +2762,7 @@ int main(int argc, char **argv, char **envp)
                 }
                 xen_mode = XEN_ATTACH;
                 break;
-#if defined(CONFIG_SIMPLE_TRACE)
+#if defined(CONFIG_SIMPLE_TRACE) || defined(CONFIG_STDERR_TRACE)
             case QEMU_OPTION_trace:
                 opts = qemu_opts_parse(qemu_find_opts("trace"), optarg, 0);
                 if (opts) {
@@ -2820,6 +2820,13 @@ int main(int argc, char **argv, char **envp)
     if (!st_init(trace_file)) {
         fprintf(stderr, "warning: unable to initialize simple trace backend\n");
     }
+#else
+    if (trace_file) {
+        fprintf(stderr, "option \"-trace file=\" not supported\n");
+        exit(1);
+    }
+#endif
+#if defined(CONFIG_SIMPLE_TRACE) || defined(CONFIG_STDERR_TRACE)
     if (trace_events_file) {
         FILE *trace_events_fp = fopen(trace_events_file, "r");
         if (!trace_events_fp) {
#15 lore raw

Re: [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events

Quoted 17 lines · Lluís

This includes all the control interfaces already provided by the "simple" backend (i.e., command line, programmatic and monitor).

---
 Makefile.objs     |    8 +++++++-
 configure         |    3 +++
 docs/tracing.txt  |    6 ++----
 hmp-commands.hx   |   10 ++++++++--
 monitor.c         |    8 +++++++-
 qemu-config.c     |    7 ++++---
 qemu-options.hx   |    8 +++++++- scripts/tracetool |   33 ++++++++++++++++++++++++++++----- stderrtrace.c     |   24 ++++++++++++++++++++++++ stderrtrace.h     |   14 ++++++++++++++
 vl.c              |   11 +++++++++--

Quoted 3 lines
 11 files changed, 113 insertions(+), 19 deletions(-)

 create mode 100644 stderrtrace.c
 create mode 100644 stderrtrace.h

I feel that the monitor commands for the simple backend were a mistake. Simple trace is used during development, not production, so being able to toggle trace events at runtime is probably not worth the extra user interfaces we've added. But when the simple backend was written we thought it would be used in production and planned for libvirt interfaces and all ;).

Let's not go down that road for the stderr backend which is very useful today at a tiny cost in code size.

For tracing use cases that require performance or runtime enabling/disabling trace events, just use the simple, ust, or dtrace backends.

Please drop this patch.

Stefan

#16 lore raw

Re: [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events

Quoted 3 lines · Stefan Hajnoczi

For tracing use cases that require performance or runtime enabling/disabling trace events, just use the simple, ust, or dtrace backends.

Having -trace events for the stderr backend would still be nice.

Paolo

#17 lore raw

Re: [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events

Quoted 7 lines · Paolo Bonzini
Quoted 4 lines · Stefan Hajnoczi

For tracing use cases that require performance or runtime enabling/disabling trace events, just use the simple, ust, or dtrace backends.

Having -trace events for the stderr backend would still be nice.

That should be doable without ifdefing and duplicating simpletrace. The tracer and monitor command parts of simpletrace need to be separated from common TraceEvent and tracetool generation, which can be reused by stderr.

Stefan

author
#18 lore raw

Re: [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events

Quoted 7 lines · Stefan Hajnoczi
Quoted 6 lines · Paolo Bonzini
Quoted 4 lines · Stefan Hajnoczi

For tracing use cases that require performance or runtime enabling/disabling trace events, just use the simple, ust, or dtrace backends.

Quoted 6 lines
Quoted 1 line

Having -trace events for the stderr backend would still be nice.

That should be doable without ifdefing and duplicating simpletrace. The tracer and monitor command parts of simpletrace need to be separated from common TraceEvent and tracetool generation, which can be reused by stderr.

That's exactly what I thought, but I tried to preserve as much as possible the original patch that was sent to me.

But in any case, I'm still not sure if stderr should have programatic tracing state controls.

Lluis

Signature · 4 lines
 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
 Tollbooth
#19 lore raw

Re: [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events

Quoted 2 lines · Lluís

But in any case, I'm still not sure if stderr should have programatic tracing state controls.

Yes, please, stderr is even more useful than simple when you're using it under gdb.

Paolo

#20 lore raw

Re: [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events

Quoted 5 lines · Paolo Bonzini
Quoted 2 lines · Lluís

But in any case, I'm still not sure if stderr should have programatic tracing state controls.

Yes, please, stderr is even more useful than simple when you're using it under gdb.

Agreed, trace control seems really useful with stderr, and we should be able to do this in a generic way (shared by simple and stderr backends).

Signature · 1 line
Fabien Chouteau
#21 lore raw

Re: [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events

Quoted 9 lines · Fabien Chouteau
Quoted 5 lines · Paolo Bonzini
Quoted 2 lines · Lluís

But in any case, I'm still not sure if stderr should have programatic tracing state controls.

Yes, please, stderr is even more useful than simple when you're using it under gdb.

Agreed, trace control seems really useful with stderr, and we should be able to do this in a generic way (shared by simple and stderr backends).

The commonality between stderr and simple is having a set of trace events with on/off states. Generating trace.h/trace.c is mostly common. Toggling trace event states from the monitor as well as -trace events=<file> are common.

The simple backend additionally allows setting and flushing the output file. It also supports dumping the trace buffer.

Stefan

#22 lore raw

Re: [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events

Quoted 2 lines · Stefan Hajnoczi

The simple backend additionally allows setting and flushing the output file. It also supports dumping the trace buffer.

I agree that neither of these would be a particularly interesting addition to the stderr backend.

Paolo

author
#23 lore raw

Re: [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events

In reply to Stefan Hajnoczi
Quoted 11 lines · Stefan Hajnoczi
Quoted 9 lines · Fabien Chouteau
Quoted 5 lines · Paolo Bonzini
Quoted 2 lines · Lluís

But in any case, I'm still not sure if stderr should have programatic tracing state controls.

Yes, please, stderr is even more useful than simple when you're using it under gdb.

Agreed, trace control seems really useful with stderr, and we should be able to do this in a generic way (shared by simple and stderr backends).

Quoted 7 lines

The commonality between stderr and simple is having a set of trace events with on/off states. Generating trace.h/trace.c is mostly common. Toggling trace event states from the monitor as well as -trace events=<file> are common.

The simple backend additionally allows setting and flushing the output file. It also supports dumping the trace buffer.

Ok, what I was thinking about long time ago is providing some generic "trace_*" interface for the common cmdline and monitor commands to use (basically list event names and query or change their dynamic state, which is the only common part on all backends).

With this, every backend is responsible of providing a suitable implementation. If no implementation is provided, a default one will be used that simply results in qemu erroring out when any of these functionalities is invoked.

I think this was already discussed, and the idea was rejected because it seemed too verbose for qemu to implement tracepoint controls when other external tools already exist for such backends (e.g., ust). Maybe providing the default implementation on the previous paragraph would solve the issues.

Lluis

Signature · 4 lines
 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
 Tollbooth
author
#24 lore raw

PATCH v2 11/11 trace: enable all events

In reply to Lluís

Given that all events with programmatically-controlled state are disabled by default, we can delete the "disable" property from all events.

As of now, the only backend that will generate high ammounts of (possibly) undesired output is "stderr", but it is considered only for debug purposes.

---
 trace-events |  488 +++++++++++++++++++++++++++++-----------------------------
 1 files changed, 244 insertions(+), 244 deletions(-)
trace-events +244 -244
index 61bb3fb..cd8c9d9 100644
@@ -26,333 +26,333 @@
 # The <format-string> should be a sprintf()-compatible format string.
 
 # qemu-malloc.c
-disable qemu_malloc(size_t size, void *ptr) "size %zu ptr %p"
-disable qemu_realloc(void *ptr, size_t size, void *newptr) "ptr %p size %zu newptr %p"
-disable qemu_free(void *ptr) "ptr %p"
+qemu_malloc(size_t size, void *ptr) "size %zu ptr %p"
+qemu_realloc(void *ptr, size_t size, void *newptr) "ptr %p size %zu newptr %p"
+qemu_free(void *ptr) "ptr %p"
 
 # osdep.c
-disable qemu_memalign(size_t alignment, size_t size, void *ptr) "alignment %zu size %zu ptr %p"
-disable qemu_vmalloc(size_t size, void *ptr) "size %zu ptr %p"
-disable qemu_vfree(void *ptr) "ptr %p"
+qemu_memalign(size_t alignment, size_t size, void *ptr) "alignment %zu size %zu ptr %p"
+qemu_vmalloc(size_t size, void *ptr) "size %zu ptr %p"
+qemu_vfree(void *ptr) "ptr %p"
 
 # hw/virtio.c
-disable virtqueue_fill(void *vq, const void *elem, unsigned int len, unsigned int idx) "vq %p elem %p len %u idx %u"
-disable virtqueue_flush(void *vq, unsigned int count) "vq %p count %u"
-disable virtqueue_pop(void *vq, void *elem, unsigned int in_num, unsigned int out_num) "vq %p elem %p in_num %u out_num %u"
-disable virtio_queue_notify(void *vdev, int n, void *vq) "vdev %p n %d vq %p"
-disable virtio_irq(void *vq) "vq %p"
-disable virtio_notify(void *vdev, void *vq) "vdev %p vq %p"
+virtqueue_fill(void *vq, const void *elem, unsigned int len, unsigned int idx) "vq %p elem %p len %u idx %u"
+virtqueue_flush(void *vq, unsigned int count) "vq %p count %u"
+virtqueue_pop(void *vq, void *elem, unsigned int in_num, unsigned int out_num) "vq %p elem %p in_num %u out_num %u"
+virtio_queue_notify(void *vdev, int n, void *vq) "vdev %p n %d vq %p"
+virtio_irq(void *vq) "vq %p"
+virtio_notify(void *vdev, void *vq) "vdev %p vq %p"
 
 # block.c
-disable multiwrite_cb(void *mcb, int ret) "mcb %p ret %d"
-disable bdrv_aio_multiwrite(void *mcb, int num_callbacks, int num_reqs) "mcb %p num_callbacks %d num_reqs %d"
-disable bdrv_aio_multiwrite_earlyfail(void *mcb) "mcb %p"
-disable bdrv_aio_multiwrite_latefail(void *mcb, int i) "mcb %p i %d"
-disable bdrv_aio_flush(void *bs, void *opaque) "bs %p opaque %p"
-disable bdrv_aio_readv(void *bs, int64_t sector_num, int nb_sectors, void *opaque) "bs %p sector_num %"PRId64" nb_sectors %d opaque %p"
-disable bdrv_aio_writev(void *bs, int64_t sector_num, int nb_sectors, void *opaque) "bs %p sector_num %"PRId64" nb_sectors %d opaque %p"
+multiwrite_cb(void *mcb, int ret) "mcb %p ret %d"
+bdrv_aio_multiwrite(void *mcb, int num_callbacks, int num_reqs) "mcb %p num_callbacks %d num_reqs %d"
+bdrv_aio_multiwrite_earlyfail(void *mcb) "mcb %p"
+bdrv_aio_multiwrite_latefail(void *mcb, int i) "mcb %p i %d"
+bdrv_aio_flush(void *bs, void *opaque) "bs %p opaque %p"
+bdrv_aio_readv(void *bs, int64_t sector_num, int nb_sectors, void *opaque) "bs %p sector_num %"PRId64" nb_sectors %d opaque %p"
+bdrv_aio_writev(void *bs, int64_t sector_num, int nb_sectors, void *opaque) "bs %p sector_num %"PRId64" nb_sectors %d opaque %p"
 
 # hw/virtio-blk.c
-disable virtio_blk_req_complete(void *req, int status) "req %p status %d"
-disable virtio_blk_rw_complete(void *req, int ret) "req %p ret %d"
-disable virtio_blk_handle_write(void *req, uint64_t sector, size_t nsectors) "req %p sector %"PRIu64" nsectors %zu"
+virtio_blk_req_complete(void *req, int status) "req %p status %d"
+virtio_blk_rw_complete(void *req, int ret) "req %p ret %d"
+virtio_blk_handle_write(void *req, uint64_t sector, size_t nsectors) "req %p sector %"PRIu64" nsectors %zu"
 
 # posix-aio-compat.c
-disable paio_submit(void *acb, void *opaque, int64_t sector_num, int nb_sectors, int type) "acb %p opaque %p sector_num %"PRId64" nb_sectors %d type %d"
-disable paio_complete(void *acb, void *opaque, int ret) "acb %p opaque %p ret %d"
-disable paio_cancel(void *acb, void *opaque) "acb %p opaque %p"
+paio_submit(void *acb, void *opaque, int64_t sector_num, int nb_sectors, int type) "acb %p opaque %p sector_num %"PRId64" nb_sectors %d type %d"
+paio_complete(void *acb, void *opaque, int ret) "acb %p opaque %p ret %d"
+paio_cancel(void *acb, void *opaque) "acb %p opaque %p"
 
 # ioport.c
-disable cpu_in(unsigned int addr, unsigned int val) "addr %#x value %u"
-disable cpu_out(unsigned int addr, unsigned int val) "addr %#x value %u"
+cpu_in(unsigned int addr, unsigned int val) "addr %#x value %u"
+cpu_out(unsigned int addr, unsigned int val) "addr %#x value %u"
 
 # balloon.c
 # Since requests are raised via monitor, not many tracepoints are needed.
-disable balloon_event(void *opaque, unsigned long addr) "opaque %p addr %lu"
+balloon_event(void *opaque, unsigned long addr) "opaque %p addr %lu"
 
 # hw/apic.c
-disable apic_local_deliver(int vector, uint32_t lvt) "vector %d delivery mode %d"
-disable apic_deliver_irq(uint8_t dest, uint8_t dest_mode, uint8_t delivery_mode, uint8_t vector_num, uint8_t polarity, uint8_t trigger_mode) "dest %d dest_mode %d delivery_mode %d vector %d polarity %d trigger_mode %d"
-disable cpu_set_apic_base(uint64_t val) "%016"PRIx64""
-disable cpu_get_apic_base(uint64_t val) "%016"PRIx64""
-disable apic_mem_readl(uint64_t addr, uint32_t val)  "%"PRIx64" = %08x"
-disable apic_mem_writel(uint64_t addr, uint32_t val) "%"PRIx64" = %08x"
+apic_local_deliver(int vector, uint32_t lvt) "vector %d delivery mode %d"
+apic_deliver_irq(uint8_t dest, uint8_t dest_mode, uint8_t delivery_mode, uint8_t vector_num, uint8_t polarity, uint8_t trigger_mode) "dest %d dest_mode %d delivery_mode %d vector %d polarity %d trigger_mode %d"
+cpu_set_apic_base(uint64_t val) "%016"PRIx64""
+cpu_get_apic_base(uint64_t val) "%016"PRIx64""
+apic_mem_readl(uint64_t addr, uint32_t val)  "%"PRIx64" = %08x"
+apic_mem_writel(uint64_t addr, uint32_t val) "%"PRIx64" = %08x"
 # coalescing
-disable apic_reset_irq_delivered(int apic_irq_delivered) "old coalescing %d"
-disable apic_get_irq_delivered(int apic_irq_delivered) "returning coalescing %d"
-disable apic_set_irq(int apic_irq_delivered) "coalescing %d"
+apic_reset_irq_delivered(int apic_irq_delivered) "old coalescing %d"
+apic_get_irq_delivered(int apic_irq_delivered) "returning coalescing %d"
+apic_set_irq(int apic_irq_delivered) "coalescing %d"
 
 # hw/cs4231.c
-disable cs4231_mem_readl_dreg(uint32_t reg, uint32_t ret) "read dreg %d: 0x%02x"
-disable cs4231_mem_readl_reg(uint32_t reg, uint32_t ret) "read reg %d: 0x%08x"
-disable cs4231_mem_writel_reg(uint32_t reg, uint32_t old, uint32_t val) "write reg %d: 0x%08x -> 0x%08x"
-disable cs4231_mem_writel_dreg(uint32_t reg, uint32_t old, uint32_t val) "write dreg %d: 0x%02x -> 0x%02x"
+cs4231_mem_readl_dreg(uint32_t reg, uint32_t ret) "read dreg %d: 0x%02x"
+cs4231_mem_readl_reg(uint32_t reg, uint32_t ret) "read reg %d: 0x%08x"
+cs4231_mem_writel_reg(uint32_t reg, uint32_t old, uint32_t val) "write reg %d: 0x%08x -> 0x%08x"
+cs4231_mem_writel_dreg(uint32_t reg, uint32_t old, uint32_t val) "write dreg %d: 0x%02x -> 0x%02x"
 
 # hw/eccmemctl.c
-disable ecc_mem_writel_mer(uint32_t val) "Write memory enable %08x"
-disable ecc_mem_writel_mdr(uint32_t val) "Write memory delay %08x"
-disable ecc_mem_writel_mfsr(uint32_t val) "Write memory fault status %08x"
-disable ecc_mem_writel_vcr(uint32_t val) "Write slot configuration %08x"
-disable ecc_mem_writel_dr(uint32_t val) "Write diagnostic %08x"
-disable ecc_mem_writel_ecr0(uint32_t val) "Write event count 1 %08x"
-disable ecc_mem_writel_ecr1(uint32_t val) "Write event count 2 %08x"
-disable ecc_mem_readl_mer(uint32_t ret) "Read memory enable %08x"
-disable ecc_mem_readl_mdr(uint32_t ret) "Read memory delay %08x"
-disable ecc_mem_readl_mfsr(uint32_t ret) "Read memory fault status %08x"
-disable ecc_mem_readl_vcr(uint32_t ret) "Read slot configuration %08x"
-disable ecc_mem_readl_mfar0(uint32_t ret) "Read memory fault address 0 %08x"
-disable ecc_mem_readl_mfar1(uint32_t ret) "Read memory fault address 1 %08x"
-disable ecc_mem_readl_dr(uint32_t ret) "Read diagnostic %08x"
-disable ecc_mem_readl_ecr0(uint32_t ret) "Read event count 1 %08x"
-disable ecc_mem_readl_ecr1(uint32_t ret) "Read event count 2 %08x"
-disable ecc_diag_mem_writeb(uint64_t addr, uint32_t val) "Write diagnostic %"PRId64" = %02x"
-disable ecc_diag_mem_readb(uint64_t addr, uint32_t ret) "Read diagnostic %"PRId64"= %02x"
+ecc_mem_writel_mer(uint32_t val) "Write memory enable %08x"
+ecc_mem_writel_mdr(uint32_t val) "Write memory delay %08x"
+ecc_mem_writel_mfsr(uint32_t val) "Write memory fault status %08x"
+ecc_mem_writel_vcr(uint32_t val) "Write slot configuration %08x"
+ecc_mem_writel_dr(uint32_t val) "Write diagnostic %08x"
+ecc_mem_writel_ecr0(uint32_t val) "Write event count 1 %08x"
+ecc_mem_writel_ecr1(uint32_t val) "Write event count 2 %08x"
+ecc_mem_readl_mer(uint32_t ret) "Read memory enable %08x"
+ecc_mem_readl_mdr(uint32_t ret) "Read memory delay %08x"
+ecc_mem_readl_mfsr(uint32_t ret) "Read memory fault status %08x"
+ecc_mem_readl_vcr(uint32_t ret) "Read slot configuration %08x"
+ecc_mem_readl_mfar0(uint32_t ret) "Read memory fault address 0 %08x"
+ecc_mem_readl_mfar1(uint32_t ret) "Read memory fault address 1 %08x"
+ecc_mem_readl_dr(uint32_t ret) "Read diagnostic %08x"
+ecc_mem_readl_ecr0(uint32_t ret) "Read event count 1 %08x"
+ecc_mem_readl_ecr1(uint32_t ret) "Read event count 2 %08x"
+ecc_diag_mem_writeb(uint64_t addr, uint32_t val) "Write diagnostic %"PRId64" = %02x"
+ecc_diag_mem_readb(uint64_t addr, uint32_t ret) "Read diagnostic %"PRId64"= %02x"
 
 # hw/lance.c
-disable lance_mem_readw(uint64_t addr, uint32_t ret) "addr=%"PRIx64"val=0x%04x"
-disable lance_mem_writew(uint64_t addr, uint32_t val) "addr=%"PRIx64"val=0x%04x"
+lance_mem_readw(uint64_t addr, uint32_t ret) "addr=%"PRIx64"val=0x%04x"
+lance_mem_writew(uint64_t addr, uint32_t val) "addr=%"PRIx64"val=0x%04x"
 
 # hw/slavio_intctl.c
-disable slavio_intctl_mem_readl(uint32_t cpu, uint64_t addr, uint32_t ret) "read cpu %d reg 0x%"PRIx64" = %x"
-disable slavio_intctl_mem_writel(uint32_t cpu, uint64_t addr, uint32_t val) "write cpu %d reg 0x%"PRIx64" = %x"
-disable slavio_intctl_mem_writel_clear(uint32_t cpu, uint32_t val, uint32_t intreg_pending) "Cleared cpu %d irq mask %x, curmask %x"
-disable slavio_intctl_mem_writel_set(uint32_t cpu, uint32_t val, uint32_t intreg_pending) "Set cpu %d irq mask %x, curmask %x"
-disable slavio_intctlm_mem_readl(uint64_t addr, uint32_t ret) "read system reg 0x%"PRIx64" = %x"
-disable slavio_intctlm_mem_writel(uint64_t addr, uint32_t val) "write system reg 0x%"PRIx64" = %x"
-disable slavio_intctlm_mem_writel_enable(uint32_t val, uint32_t intregm_disabled) "Enabled master irq mask %x, curmask %x"
-disable slavio_intctlm_mem_writel_disable(uint32_t val, uint32_t intregm_disabled) "Disabled master irq mask %x, curmask %x"
-disable slavio_intctlm_mem_writel_target(uint32_t cpu) "Set master irq cpu %d"
-disable slavio_check_interrupts(uint32_t pending, uint32_t intregm_disabled) "pending %x disabled %x"
-disable slavio_set_irq(uint32_t target_cpu, int irq, uint32_t pil, int level) "Set cpu %d irq %d -> pil %d level %d"
-disable slavio_set_timer_irq_cpu(int cpu, int level) "Set cpu %d local timer level %d"
+slavio_intctl_mem_readl(uint32_t cpu, uint64_t addr, uint32_t ret) "read cpu %d reg 0x%"PRIx64" = %x"
+slavio_intctl_mem_writel(uint32_t cpu, uint64_t addr, uint32_t val) "write cpu %d reg 0x%"PRIx64" = %x"
+slavio_intctl_mem_writel_clear(uint32_t cpu, uint32_t val, uint32_t intreg_pending) "Cleared cpu %d irq mask %x, curmask %x"
+slavio_intctl_mem_writel_set(uint32_t cpu, uint32_t val, uint32_t intreg_pending) "Set cpu %d irq mask %x, curmask %x"
+slavio_intctlm_mem_readl(uint64_t addr, uint32_t ret) "read system reg 0x%"PRIx64" = %x"
+slavio_intctlm_mem_writel(uint64_t addr, uint32_t val) "write system reg 0x%"PRIx64" = %x"
+slavio_intctlm_mem_writel_enable(uint32_t val, uint32_t intregm_disabled) "Enabled master irq mask %x, curmask %x"
+slavio_intctlm_mem_writel_disable(uint32_t val, uint32_t intregm_disabled) "Disabled master irq mask %x, curmask %x"
+slavio_intctlm_mem_writel_target(uint32_t cpu) "Set master irq cpu %d"
+slavio_check_interrupts(uint32_t pending, uint32_t intregm_disabled) "pending %x disabled %x"
+slavio_set_irq(uint32_t target_cpu, int irq, uint32_t pil, int level) "Set cpu %d irq %d -> pil %d level %d"
+slavio_set_timer_irq_cpu(int cpu, int level) "Set cpu %d local timer level %d"
 
 # hw/slavio_misc.c
-disable slavio_misc_update_irq_raise(void) "Raise IRQ"
-disable slavio_misc_update_irq_lower(void) "Lower IRQ"
-disable slavio_set_power_fail(int power_failing, uint8_t config) "Power fail: %d, config: %d"
-disable slavio_cfg_mem_writeb(uint32_t val) "Write config %02x"
-disable slavio_cfg_mem_readb(uint32_t ret) "Read config %02x"
-disable slavio_diag_mem_writeb(uint32_t val) "Write diag %02x"
-disable slavio_diag_mem_readb(uint32_t ret) "Read diag %02x"
-disable slavio_mdm_mem_writeb(uint32_t val) "Write modem control %02x"
-disable slavio_mdm_mem_readb(uint32_t ret) "Read modem control %02x"
-disable slavio_aux1_mem_writeb(uint32_t val) "Write aux1 %02x"
-disable slavio_aux1_mem_readb(uint32_t ret) "Read aux1 %02x"
-disable slavio_aux2_mem_writeb(uint32_t val) "Write aux2 %02x"
-disable slavio_aux2_mem_readb(uint32_t ret) "Read aux2 %02x"
-disable apc_mem_writeb(uint32_t val) "Write power management %02x"
-disable apc_mem_readb(uint32_t ret) "Read power management %02x"
-disable slavio_sysctrl_mem_writel(uint32_t val) "Write system control %08x"
-disable slavio_sysctrl_mem_readl(uint32_t ret) "Read system control %08x"
-disable slavio_led_mem_writew(uint32_t val) "Write diagnostic LED %04x"
-disable slavio_led_mem_readw(uint32_t ret) "Read diagnostic LED %04x"
+slavio_misc_update_irq_raise(void) "Raise IRQ"
+slavio_misc_update_irq_lower(void) "Lower IRQ"
+slavio_set_power_fail(int power_failing, uint8_t config) "Power fail: %d, config: %d"
+slavio_cfg_mem_writeb(uint32_t val) "Write config %02x"
+slavio_cfg_mem_readb(uint32_t ret) "Read config %02x"
+slavio_diag_mem_writeb(uint32_t val) "Write diag %02x"
+slavio_diag_mem_readb(uint32_t ret) "Read diag %02x"
+slavio_mdm_mem_writeb(uint32_t val) "Write modem control %02x"
+slavio_mdm_mem_readb(uint32_t ret) "Read modem control %02x"
+slavio_aux1_mem_writeb(uint32_t val) "Write aux1 %02x"
+slavio_aux1_mem_readb(uint32_t ret) "Read aux1 %02x"
+slavio_aux2_mem_writeb(uint32_t val) "Write aux2 %02x"
+slavio_aux2_mem_readb(uint32_t ret) "Read aux2 %02x"
+apc_mem_writeb(uint32_t val) "Write power management %02x"
+apc_mem_readb(uint32_t ret) "Read power management %02x"
+slavio_sysctrl_mem_writel(uint32_t val) "Write system control %08x"
+slavio_sysctrl_mem_readl(uint32_t ret) "Read system control %08x"
+slavio_led_mem_writew(uint32_t val) "Write diagnostic LED %04x"
+slavio_led_mem_readw(uint32_t ret) "Read diagnostic LED %04x"
 
 # hw/slavio_timer.c
-disable slavio_timer_get_out(uint64_t limit, uint32_t counthigh, uint32_t count) "limit %"PRIx64" count %x%08x"
-disable slavio_timer_irq(uint32_t counthigh, uint32_t count) "callback: count %x%08x"
-disable slavio_timer_mem_readl_invalid(uint64_t addr) "invalid read address %"PRIx64""
-disable slavio_timer_mem_readl(uint64_t addr, uint32_t ret) "read %"PRIx64" = %08x"
-disable slavio_timer_mem_writel(uint64_t addr, uint32_t val) "write %"PRIx64" = %08x"
-disable slavio_timer_mem_writel_limit(unsigned int timer_index, uint64_t count) "processor %d user timer set to %016"PRIx64""
-disable slavio_timer_mem_writel_counter_invalid(void) "not user timer"
-disable slavio_timer_mem_writel_status_start(unsigned int timer_index) "processor %d user timer started"
-disable slavio_timer_mem_writel_status_stop(unsigned int timer_index) "processor %d user timer stopped"
-disable slavio_timer_mem_writel_mode_user(unsigned int timer_index) "processor %d changed from counter to user timer"
-disable slavio_timer_mem_writel_mode_counter(unsigned int timer_index) "processor %d changed from user timer to counter"
-disable slavio_timer_mem_writel_mode_invalid(void) "not system timer"
-disable slavio_timer_mem_writel_invalid(uint64_t addr) "invalid write address %"PRIx64""
+slavio_timer_get_out(uint64_t limit, uint32_t counthigh, uint32_t count) "limit %"PRIx64" count %x%08x"
+slavio_timer_irq(uint32_t counthigh, uint32_t count) "callback: count %x%08x"
+slavio_timer_mem_readl_invalid(uint64_t addr) "invalid read address %"PRIx64""
+slavio_timer_mem_readl(uint64_t addr, uint32_t ret) "read %"PRIx64" = %08x"
+slavio_timer_mem_writel(uint64_t addr, uint32_t val) "write %"PRIx64" = %08x"
+slavio_timer_mem_writel_limit(unsigned int timer_index, uint64_t count) "processor %d user timer set to %016"PRIx64""
+slavio_timer_mem_writel_counter_invalid(void) "not user timer"
+slavio_timer_mem_writel_status_start(unsigned int timer_index) "processor %d user timer started"
+slavio_timer_mem_writel_status_stop(unsigned int timer_index) "processor %d user timer stopped"
+slavio_timer_mem_writel_mode_user(unsigned int timer_index) "processor %d changed from counter to user timer"
+slavio_timer_mem_writel_mode_counter(unsigned int timer_index) "processor %d changed from user timer to counter"
+slavio_timer_mem_writel_mode_invalid(void) "not system timer"
+slavio_timer_mem_writel_invalid(uint64_t addr) "invalid write address %"PRIx64""
 
 # hw/sparc32_dma.c
-disable ledma_memory_read(uint64_t addr) "DMA read addr 0x%"PRIx64""
-disable ledma_memory_write(uint64_t addr) "DMA write addr 0x%"PRIx64""
-disable sparc32_dma_set_irq_raise(void) "Raise IRQ"
-disable sparc32_dma_set_irq_lower(void) "Lower IRQ"
-disable espdma_memory_read(uint32_t addr) "DMA read addr 0x%08x"
-disable espdma_memory_write(uint32_t addr) "DMA write addr 0x%08x"
-disable sparc32_dma_mem_readl(uint64_t addr, uint32_t ret) "read dmareg %"PRIx64": 0x%08x"
-disable sparc32_dma_mem_writel(uint64_t addr, uint32_t old, uint32_t val) "write dmareg %"PRIx64": 0x%08x -> 0x%08x"
-disable sparc32_dma_enable_raise(void) "Raise DMA enable"
-disable sparc32_dma_enable_lower(void) "Lower DMA enable"
+ledma_memory_read(uint64_t addr) "DMA read addr 0x%"PRIx64""
+ledma_memory_write(uint64_t addr) "DMA write addr 0x%"PRIx64""
+sparc32_dma_set_irq_raise(void) "Raise IRQ"
+sparc32_dma_set_irq_lower(void) "Lower IRQ"
+espdma_memory_read(uint32_t addr) "DMA read addr 0x%08x"
+espdma_memory_write(uint32_t addr) "DMA write addr 0x%08x"
+sparc32_dma_mem_readl(uint64_t addr, uint32_t ret) "read dmareg %"PRIx64": 0x%08x"
+sparc32_dma_mem_writel(uint64_t addr, uint32_t old, uint32_t val) "write dmareg %"PRIx64": 0x%08x -> 0x%08x"
+sparc32_dma_enable_raise(void) "Raise DMA enable"
+sparc32_dma_enable_lower(void) "Lower DMA enable"
 
 # hw/sun4m.c
-disable sun4m_cpu_interrupt(unsigned int level) "Set CPU IRQ %d"
-disable sun4m_cpu_reset_interrupt(unsigned int level) "Reset CPU IRQ %d"
-disable sun4m_cpu_set_irq_raise(int level) "Raise CPU IRQ %d"
-disable sun4m_cpu_set_irq_lower(int level) "Lower CPU IRQ %d"
+sun4m_cpu_interrupt(unsigned int level) "Set CPU IRQ %d"
+sun4m_cpu_reset_interrupt(unsigned int level) "Reset CPU IRQ %d"
+sun4m_cpu_set_irq_raise(int level) "Raise CPU IRQ %d"
+sun4m_cpu_set_irq_lower(int level) "Lower CPU IRQ %d"
 
 # hw/sun4m_iommu.c
-disable sun4m_iommu_mem_readl(uint64_t addr, uint32_t ret) "read reg[%"PRIx64"] = %x"
-disable sun4m_iommu_mem_writel(uint64_t addr, uint32_t val) "write reg[%"PRIx64"] = %x"
-disable sun4m_iommu_mem_writel_ctrl(uint64_t iostart) "iostart = %"PRIx64""
-disable sun4m_iommu_mem_writel_tlbflush(uint32_t val) "tlb flush %x"
-disable sun4m_iommu_mem_writel_pgflush(uint32_t val) "page flush %x"
-disable sun4m_iommu_page_get_flags(uint64_t pa, uint64_t iopte, uint32_t ret) "get flags addr %"PRIx64" => pte %"PRIx64", *pte = %x"
-disable sun4m_iommu_translate_pa(uint64_t addr, uint64_t pa, uint32_t iopte) "xlate dva %"PRIx64" => pa %"PRIx64" iopte = %x"
-disable sun4m_iommu_bad_addr(uint64_t addr) "bad addr %"PRIx64""
+sun4m_iommu_mem_readl(uint64_t addr, uint32_t ret) "read reg[%"PRIx64"] = %x"
+sun4m_iommu_mem_writel(uint64_t addr, uint32_t val) "write reg[%"PRIx64"] = %x"
+sun4m_iommu_mem_writel_ctrl(uint64_t iostart) "iostart = %"PRIx64""
+sun4m_iommu_mem_writel_tlbflush(uint32_t val) "tlb flush %x"
+sun4m_iommu_mem_writel_pgflush(uint32_t val) "page flush %x"
+sun4m_iommu_page_get_flags(uint64_t pa, uint64_t iopte, uint32_t ret) "get flags addr %"PRIx64" => pte %"PRIx64", *pte = %x"
+sun4m_iommu_translate_pa(uint64_t addr, uint64_t pa, uint32_t iopte) "xlate dva %"PRIx64" => pa %"PRIx64" iopte = %x"
+sun4m_iommu_bad_addr(uint64_t addr) "bad addr %"PRIx64""
 
 # hw/usb-desc.c
-disable usb_desc_device(int addr, int len, int ret) "dev %d query device, len %d, ret %d"
-disable usb_desc_device_qualifier(int addr, int len, int ret) "dev %d query device qualifier, len %d, ret %d"
-disable usb_desc_config(int addr, int index, int len, int ret) "dev %d query config %d, len %d, ret %d"
-disable usb_desc_other_speed_config(int addr, int index, int len, int ret) "dev %d query config %d, len %d, ret %d"
-disable usb_desc_string(int addr, int index, int len, int ret) "dev %d query string %d, len %d, ret %d"
-disable usb_set_addr(int addr) "dev %d"
-disable usb_set_config(int addr, int config, int ret) "dev %d, config %d, ret %d"
-disable usb_clear_device_feature(int addr, int feature, int ret) "dev %d, feature %d, ret %d"
-disable usb_set_device_feature(int addr, int feature, int ret) "dev %d, feature %d, ret %d"
+usb_desc_device(int addr, int len, int ret) "dev %d query device, len %d, ret %d"
+usb_desc_device_qualifier(int addr, int len, int ret) "dev %d query device qualifier, len %d, ret %d"
+usb_desc_config(int addr, int index, int len, int ret) "dev %d query config %d, len %d, ret %d"
+usb_desc_other_speed_config(int addr, int index, int len, int ret) "dev %d query config %d, len %d, ret %d"
+usb_desc_string(int addr, int index, int len, int ret) "dev %d query string %d, len %d, ret %d"
+usb_set_addr(int addr) "dev %d"
+usb_set_config(int addr, int config, int ret) "dev %d, config %d, ret %d"
+usb_clear_device_feature(int addr, int feature, int ret) "dev %d, feature %d, ret %d"
+usb_set_device_feature(int addr, int feature, int ret) "dev %d, feature %d, ret %d"
 
 # vl.c
-disable vm_state_notify(int running, int reason) "running %d reason %d"
+vm_state_notify(int running, int reason) "running %d reason %d"
 
 # block/qed-l2-cache.c
-disable qed_alloc_l2_cache_entry(void *l2_cache, void *entry) "l2_cache %p entry %p"
-disable qed_unref_l2_cache_entry(void *entry, int ref) "entry %p ref %d"
-disable qed_find_l2_cache_entry(void *l2_cache, void *entry, uint64_t offset, int ref) "l2_cache %p entry %p offset %"PRIu64" ref %d"
+qed_alloc_l2_cache_entry(void *l2_cache, void *entry) "l2_cache %p entry %p"
+qed_unref_l2_cache_entry(void *entry, int ref) "entry %p ref %d"
+qed_find_l2_cache_entry(void *l2_cache, void *entry, uint64_t offset, int ref) "l2_cache %p entry %p offset %"PRIu64" ref %d"
 
 # block/qed-table.c
-disable qed_read_table(void *s, uint64_t offset, void *table) "s %p offset %"PRIu64" table %p"
-disable qed_read_table_cb(void *s, void *table, int ret) "s %p table %p ret %d"
-disable qed_write_table(void *s, uint64_t offset, void *table, unsigned int index, unsigned int n) "s %p offset %"PRIu64" table %p index %u n %u"
-disable qed_write_table_cb(void *s, void *table, int flush, int ret) "s %p table %p flush %d ret %d"
+qed_read_table(void *s, uint64_t offset, void *table) "s %p offset %"PRIu64" table %p"
+qed_read_table_cb(void *s, void *table, int ret) "s %p table %p ret %d"
+qed_write_table(void *s, uint64_t offset, void *table, unsigned int index, unsigned int n) "s %p offset %"PRIu64" table %p index %u n %u"
+qed_write_table_cb(void *s, void *table, int flush, int ret) "s %p table %p flush %d ret %d"
 
 # block/qed.c
-disable qed_aio_complete(void *s, void *acb, int ret) "s %p acb %p ret %d"
-disable qed_aio_setup(void *s, void *acb, int64_t sector_num, int nb_sectors, void *opaque, int is_write) "s %p acb %p sector_num %"PRId64" nb_sectors %d opaque %p is_write %d"
-disable qed_aio_next_io(void *s, void *acb, int ret, uint64_t cur_pos) "s %p acb %p ret %d cur_pos %"PRIu64""
-disable qed_aio_read_data(void *s, void *acb, int ret, uint64_t offset, size_t len) "s %p acb %p ret %d offset %"PRIu64" len %zu"
-disable qed_aio_write_data(void *s, void *acb, int ret, uint64_t offset, size_t len) "s %p acb %p ret %d offset %"PRIu64" len %zu"
-disable qed_aio_write_prefill(void *s, void *acb, uint64_t start, size_t len, uint64_t offset) "s %p acb %p start %"PRIu64" len %zu offset %"PRIu64""
-disable qed_aio_write_postfill(void *s, void *acb, uint64_t start, size_t len, uint64_t offset) "s %p acb %p start %"PRIu64" len %zu offset %"PRIu64""
-disable qed_aio_write_main(void *s, void *acb, int ret, uint64_t offset, size_t len) "s %p acb %p ret %d offset %"PRIu64" len %zu"
+qed_aio_complete(void *s, void *acb, int ret) "s %p acb %p ret %d"
+qed_aio_setup(void *s, void *acb, int64_t sector_num, int nb_sectors, void *opaque, int is_write) "s %p acb %p sector_num %"PRId64" nb_sectors %d opaque %p is_write %d"
+qed_aio_next_io(void *s, void *acb, int ret, uint64_t cur_pos) "s %p acb %p ret %d cur_pos %"PRIu64""
+qed_aio_read_data(void *s, void *acb, int ret, uint64_t offset, size_t len) "s %p acb %p ret %d offset %"PRIu64" len %zu"
+qed_aio_write_data(void *s, void *acb, int ret, uint64_t offset, size_t len) "s %p acb %p ret %d offset %"PRIu64" len %zu"
+qed_aio_write_prefill(void *s, void *acb, uint64_t start, size_t len, uint64_t offset) "s %p acb %p start %"PRIu64" len %zu offset %"PRIu64""
+qed_aio_write_postfill(void *s, void *acb, uint64_t start, size_t len, uint64_t offset) "s %p acb %p start %"PRIu64" len %zu offset %"PRIu64""
+qed_aio_write_main(void *s, void *acb, int ret, uint64_t offset, size_t len) "s %p acb %p ret %d offset %"PRIu64" len %zu"
 
 # hw/grlib_gptimer.c
-disable grlib_gptimer_enable(int id, uint32_t count) "timer:%d set count 0x%x and run"
-disable grlib_gptimer_disabled(int id, uint32_t config) "timer:%d Timer disable config 0x%x"
-disable grlib_gptimer_restart(int id, uint32_t reload) "timer:%d reload val: 0x%x"
-disable grlib_gptimer_set_scaler(uint32_t scaler, uint32_t freq) "scaler:0x%x freq: 0x%x"
-disable grlib_gptimer_hit(int id) "timer:%d HIT"
-disable grlib_gptimer_readl(int id, const char *s, uint32_t val) "timer:%d %s 0x%x"
-disable grlib_gptimer_writel(int id, const char *s, uint32_t val) "timer:%d %s 0x%x"
-disable grlib_gptimer_unknown_register(const char *op, uint64_t val) "%s unknown register 0x%"PRIx64""
+grlib_gptimer_enable(int id, uint32_t count) "timer:%d set count 0x%x and run"
+grlib_gptimer_disabled(int id, uint32_t config) "timer:%d Timer disable config 0x%x"
+grlib_gptimer_restart(int id, uint32_t reload) "timer:%d reload val: 0x%x"
+grlib_gptimer_set_scaler(uint32_t scaler, uint32_t freq) "scaler:0x%x freq: 0x%x"
+grlib_gptimer_hit(int id) "timer:%d HIT"
+grlib_gptimer_readl(int id, const char *s, uint32_t val) "timer:%d %s 0x%x"
+grlib_gptimer_writel(int id, const char *s, uint32_t val) "timer:%d %s 0x%x"
+grlib_gptimer_unknown_register(const char *op, uint64_t val) "%s unknown register 0x%"PRIx64""
 
 # hw/grlib_irqmp.c
-disable grlib_irqmp_check_irqs(uint32_t pend, uint32_t force, uint32_t mask, uint32_t lvl1, uint32_t lvl2) "pend:0x%04x force:0x%04x mask:0x%04x lvl1:0x%04x lvl0:0x%04x\n"
-disable grlib_irqmp_ack(int intno) "interrupt:%d"
-disable grlib_irqmp_set_irq(int irq) "Raise CPU IRQ %d"
-disable grlib_irqmp_unknown_register(const char *op, uint64_t val) "%s unknown register 0x%"PRIx64""
+grlib_irqmp_check_irqs(uint32_t pend, uint32_t force, uint32_t mask, uint32_t lvl1, uint32_t lvl2) "pend:0x%04x force:0x%04x mask:0x%04x lvl1:0x%04x lvl0:0x%04x\n"
+grlib_irqmp_ack(int intno) "interrupt:%d"
+grlib_irqmp_set_irq(int irq) "Raise CPU IRQ %d"
+grlib_irqmp_unknown_register(const char *op, uint64_t val) "%s unknown register 0x%"PRIx64""
 
 # hw/grlib_apbuart.c
-disable grlib_apbuart_event(int event) "event:%d"
-disable grlib_apbuart_unknown_register(const char *op, uint64_t val) "%s unknown register 0x%"PRIx64""
+grlib_apbuart_event(int event) "event:%d"
+grlib_apbuart_unknown_register(const char *op, uint64_t val) "%s unknown register 0x%"PRIx64""
 
 # hw/leon3.c
-disable leon3_set_irq(int intno) "Set CPU IRQ %d"
-disable leon3_reset_irq(int intno) "Reset CPU IRQ %d"
+leon3_set_irq(int intno) "Set CPU IRQ %d"
+leon3_reset_irq(int intno) "Reset CPU IRQ %d"
 
 # spice-qemu-char.c
-disable spice_vmc_write(ssize_t out, int len) "spice wrottn %zd of requested %d"
-disable spice_vmc_read(int bytes, int len) "spice read %d of requested %d"
-disable spice_vmc_register_interface(void *scd) "spice vmc registered interface %p"
-disable spice_vmc_unregister_interface(void *scd) "spice vmc unregistered interface %p"
+spice_vmc_write(ssize_t out, int len) "spice wrottn %zd of requested %d"
+spice_vmc_read(int bytes, int len) "spice read %d of requested %d"
+spice_vmc_register_interface(void *scd) "spice vmc registered interface %p"
+spice_vmc_unregister_interface(void *scd) "spice vmc unregistered interface %p"
 
 # hw/lm32_pic.c
-disable lm32_pic_raise_irq(void) "Raise CPU interrupt"
-disable lm32_pic_lower_irq(void) "Lower CPU interrupt"
-disable lm32_pic_interrupt(int irq, int level) "Set IRQ%d %d"
-disable lm32_pic_set_im(uint32_t im) "im 0x%08x"
-disable lm32_pic_set_ip(uint32_t ip) "ip 0x%08x"
-disable lm32_pic_get_im(uint32_t im) "im 0x%08x"
-disable lm32_pic_get_ip(uint32_t ip) "ip 0x%08x"
+lm32_pic_raise_irq(void) "Raise CPU interrupt"
+lm32_pic_lower_irq(void) "Lower CPU interrupt"
+lm32_pic_interrupt(int irq, int level) "Set IRQ%d %d"
+lm32_pic_set_im(uint32_t im) "im 0x%08x"
+lm32_pic_set_ip(uint32_t ip) "ip 0x%08x"
+lm32_pic_get_im(uint32_t im) "im 0x%08x"
+lm32_pic_get_ip(uint32_t ip) "ip 0x%08x"
 
 # hw/lm32_juart.c
-disable lm32_juart_get_jtx(uint32_t value) "jtx 0x%08x"
-disable lm32_juart_set_jtx(uint32_t value) "jtx 0x%08x"
-disable lm32_juart_get_jrx(uint32_t value) "jrx 0x%08x"
-disable lm32_juart_set_jrx(uint32_t value) "jrx 0x%08x"
+lm32_juart_get_jtx(uint32_t value) "jtx 0x%08x"
+lm32_juart_set_jtx(uint32_t value) "jtx 0x%08x"
+lm32_juart_get_jrx(uint32_t value) "jrx 0x%08x"
+lm32_juart_set_jrx(uint32_t value) "jrx 0x%08x"
 
 # hw/lm32_timer.c
-disable lm32_timer_memory_write(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
-disable lm32_timer_memory_read(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
-disable lm32_timer_hit(void) "timer hit"
-disable lm32_timer_irq_state(int level) "irq state %d"
+lm32_timer_memory_write(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
+lm32_timer_memory_read(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
+lm32_timer_hit(void) "timer hit"
+lm32_timer_irq_state(int level) "irq state %d"
 
 # hw/lm32_uart.c
-disable lm32_uart_memory_write(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
-disable lm32_uart_memory_read(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
-disable lm32_uart_irq_state(int level) "irq state %d"
+lm32_uart_memory_write(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
+lm32_uart_memory_read(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
+lm32_uart_irq_state(int level) "irq state %d"
 
 # hw/lm32_sys.c
-disable lm32_sys_memory_write(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
+lm32_sys_memory_write(uint32_t addr, uint32_t value) "addr 0x%08x value 0x%08x"
 
 # hw/milkymist-ac97.c
-disable milkymist_ac97_memory_read(uint32_t addr, uint32_t value) "addr %08x value %08x"
-disable milkymist_ac97_memory_write(uint32_t addr, uint32_t value) "addr %08x value %08x"
-disable milkymist_ac97_pulse_irq_crrequest(void) "Pulse IRQ CR request"
-disable milkymist_ac97_pulse_irq_crreply(void) "Pulse IRQ CR reply"
-disable milkymist_ac97_pulse_irq_dmaw(void) "Pulse IRQ DMA write"
-disable milkymist_ac97_pulse_irq_dmar(void) "Pulse IRQ DMA read"
-disable milkymist_ac97_in_cb(int avail, uint32_t remaining) "avail %d remaining %u"
-disable milkymist_ac97_in_cb_transferred(int transferred) "transferred %d"
-disable milkymist_ac97_out_cb(int free, uint32_t remaining) "free %d remaining %u"
-disable milkymist_ac97_out_cb_transferred(int transferred) "transferred %d"
+milkymist_ac97_memory_read(uint32_t addr, uint32_t value) "addr %08x value %08x"
+milkymist_ac97_memory_write(uint32_t addr, uint32_t value) "addr %08x value %08x"
+milkymist_ac97_pulse_irq_crrequest(void) "Pulse IRQ CR request"
+milkymist_ac97_pulse_irq_crreply(void) "Pulse IRQ CR reply"
+milkymist_ac97_pulse_irq_dmaw(void) "Pulse IRQ DMA write"
+milkymist_ac97_pulse_irq_dmar(void) "Pulse IRQ DMA read"
+milkymist_ac97_in_cb(int avail, uint32_t remaining) "avail %d remaining %u"
+milkymist_ac97_in_cb_transferred(int transferred) "transferred %d"
+milkymist_ac97_out_cb(int free, uint32_t remaining) "free %d remaining %u"
+milkymist_ac97_out_cb_transferred(int transferred) "transferred %d"
 
 # hw/milkymist-hpdmc.c
-disable milkymist_hpdmc_memory_read(uint32_t addr, uint32_t value) "addr=%08x value=%08x"
-disable milkymist_hpdmc_memory_write(uint32_t addr, uint32_t value) "addr=%08x value=%08x"
+milkymist_hpdmc_memory_read(uint32_t addr, uint32_t value) "addr=%08x value=%08x"
+milkymist_hpdmc_memory_write(uint32_t addr, uint32_t value) "addr=%08x value=%08x"
 
 # hw/milkymist-memcard.c
-disable milkymist_memcard_memory_read(uint32_t addr, uint32_t value) "addr %08x value %08x"
-disable milkymist_memcard_memory_write(uint32_t addr, uint32_t value) "addr %08x value %08x"
+milkymist_memcard_memory_read(uint32_t addr, uint32_t value) "addr %08x value %08x"
+milkymist_memcard_memory_write(uint32_t addr, uint32_t value) "addr %08x value %08x"
 
 # hw/milkymist-minimac.c
-disable milkymist_minimac_memory_read(uint32_t addr, uint32_t value) "addr %08x value %08x"
-disable milkymist_minimac_memory_write(uint32_t addr, uint32_t value) "addr %08x value %08x"
-disable milkymist_minimac_mdio_write(uint8_t phy_addr, uint8_t addr, uint16_t value) "phy_addr %02x addr %02x value %04x"
-disable milkymist_minimac_mdio_read(uint8_t phy_addr, uint8_t addr, uint16_t value) "phy_addr %02x addr %02x value %04x"
-disable milkymist_minimac_tx_frame(uint32_t length) "length %u"
-disable milkymist_minimac_rx_frame(const void *buf, uint32_t length) "buf %p length %u"
-disable milkymist_minimac_drop_rx_frame(const void *buf) "buf %p"
-disable milkymist_minimac_rx_transfer(const void *buf, uint32_t length) "buf %p length %d"
-disable milkymist_minimac_pulse_irq_rx(void) "Pulse IRQ RX"
-disable milkymist_minimac_pulse_irq_tx(void) "Pulse IRQ TX"
+milkymist_minimac_memory_read(uint32_t addr, uint32_t value) "addr %08x value %08x"
+milkymist_minimac_memory_write(uint32_t addr, uint32_t value) "addr %08x value %08x"
+milkymist_minimac_mdio_write(uint8_t phy_addr, uint8_t addr, uint16_t value) "phy_addr %02x addr %02x value %04x"
+milkymist_minimac_mdio_read(uint8_t phy_addr, uint8_t addr, uint16_t value) "phy_addr %02x addr %02x value %04x"
+milkymist_minimac_tx_frame(uint32_t length) "length %u"
+milkymist_minimac_rx_frame(const void *buf, uint32_t length) "buf %p length %u"
+milkymist_minimac_drop_rx_frame(const void *buf) "buf %p"
+milkymist_minimac_rx_transfer(const void *buf, uint32_t length) "buf %p length %d"
+milkymist_minimac_pulse_irq_rx(void) "Pulse IRQ RX"
+milkymist_minimac_pulse_irq_tx(void) "Pulse IRQ TX"
 
 # hw/milkymist-pfpu.c
-disable milkymist_pfpu_memory_read(uint32_t addr, uint32_t value) "addr %08x value %08x"
-disable milkymist_pfpu_memory_write(uint32_t addr, uint32_t value) "addr %08x value %08x"
-disable milkymist_pfpu_vectout(uint32_t a, uint32_t b, uint32_t dma_ptr) "a %08x b %08x dma_ptr %08x"
-disable milkymist_pfpu_pulse_irq(void) "Pulse IRQ"
+milkymist_pfpu_memory_read(uint32_t addr, uint32_t value) "addr %08x value %08x"
+milkymist_pfpu_memory_write(uint32_t addr, uint32_t value) "addr %08x value %08x"
+milkymist_pfpu_vectout(uint32_t a, uint32_t b, uint32_t dma_ptr) "a %08x b %08x dma_ptr %08x"
+milkymist_pfpu_pulse_irq(void) "Pulse IRQ"
 
 # hw/milkymist-softusb.c
-disable milkymist_softusb_memory_read(uint32_t addr, uint32_t value) "addr %08x value %08x"
-disable milkymist_softusb_memory_write(uint32_t addr, uint32_t value) "addr %08x value %08x"
-disable milkymist_softusb_mevt(uint8_t m) "m %d"
-disable milkymist_softusb_kevt(uint8_t m) "m %d"
-disable milkymist_softusb_mouse_event(int dx, int dy, int dz, int bs) "dx %d dy %d dz %d bs %02x"
-disable milkymist_softusb_pulse_irq(void) "Pulse IRQ"
+milkymist_softusb_memory_read(uint32_t addr, uint32_t value) "addr %08x value %08x"
+milkymist_softusb_memory_write(uint32_t addr, uint32_t value) "addr %08x value %08x"
+milkymist_softusb_mevt(uint8_t m) "m %d"
+milkymist_softusb_kevt(uint8_t m) "m %d"
+milkymist_softusb_mouse_event(int dx, int dy, int dz, int bs) "dx %d dy %d dz %d bs %02x"
+milkymist_softusb_pulse_irq(void) "Pulse IRQ"
 
 # hw/milkymist-sysctl.c
-disable milkymist_sysctl_memory_read(uint32_t addr, uint32_t value) "addr %08x value %08x"
-disable milkymist_sysctl_memory_write(uint32_t addr, uint32_t value) "addr %08x value %08x"
-disable milkymist_sysctl_icap_write(uint32_t value) "value %08x"
-disable milkymist_sysctl_start_timer0(void) "Start timer0"
-disable milkymist_sysctl_stop_timer0(void) "Stop timer0"
-disable milkymist_sysctl_start_timer1(void) "Start timer1"
-disable milkymist_sysctl_stop_timer1(void) "Stop timer1"
-disable milkymist_sysctl_pulse_irq_timer0(void) "Pulse IRQ Timer0"
-disable milkymist_sysctl_pulse_irq_timer1(void) "Pulse IRQ Timer1"
+milkymist_sysctl_memory_read(uint32_t addr, uint32_t value) "addr %08x value %08x"
+milkymist_sysctl_memory_write(uint32_t addr, uint32_t value) "addr %08x value %08x"
+milkymist_sysctl_icap_write(uint32_t value) "value %08x"
+milkymist_sysctl_start_timer0(void) "Start timer0"
+milkymist_sysctl_stop_timer0(void) "Stop timer0"
+milkymist_sysctl_start_timer1(void) "Start timer1"
+milkymist_sysctl_stop_timer1(void) "Stop timer1"
+milkymist_sysctl_pulse_irq_timer0(void) "Pulse IRQ Timer0"
+milkymist_sysctl_pulse_irq_timer1(void) "Pulse IRQ Timer1"
 
 # hw/milkymist-tmu2.c
-disable milkymist_tmu2_memory_read(uint32_t addr, uint32_t value) "addr %08x value %08x"
-disable milkymist_tmu2_memory_write(uint32_t addr, uint32_t value) "addr %08x value %08x"
-disable milkymist_tmu2_start(void) "Start TMU"
-disable milkymist_tmu2_pulse_irq(void) "Pulse IRQ"
+milkymist_tmu2_memory_read(uint32_t addr, uint32_t value) "addr %08x value %08x"
+milkymist_tmu2_memory_write(uint32_t addr, uint32_t value) "addr %08x value %08x"
+milkymist_tmu2_start(void) "Start TMU"
+milkymist_tmu2_pulse_irq(void) "Pulse IRQ"
 
 # hw/milkymist-uart.c
-disable milkymist_uart_memory_read(uint32_t addr, uint32_t value) "addr %08x value %08x"
-disable milkymist_uart_memory_write(uint32_t addr, uint32_t value) "addr %08x value %08x"
-disable milkymist_uart_pulse_irq_rx(void) "Pulse IRQ RX"
-disable milkymist_uart_pulse_irq_tx(void) "Pulse IRQ TX"
+milkymist_uart_memory_read(uint32_t addr, uint32_t value) "addr %08x value %08x"
+milkymist_uart_memory_write(uint32_t addr, uint32_t value) "addr %08x value %08x"
+milkymist_uart_pulse_irq_rx(void) "Pulse IRQ RX"
+milkymist_uart_pulse_irq_tx(void) "Pulse IRQ TX"
 
 # hw/milkymist-vgafb.c
-disable milkymist_vgafb_memory_read(uint32_t addr, uint32_t value) "addr %08x value %08x"
-disable milkymist_vgafb_memory_write(uint32_t addr, uint32_t value) "addr %08x value %08x"
+milkymist_vgafb_memory_read(uint32_t addr, uint32_t value) "addr %08x value %08x"
+milkymist_vgafb_memory_write(uint32_t addr, uint32_t value) "addr %08x value %08x"
#25 lore raw
In reply to Lluís
Quoted 50 lines · Lluís

This patch defines the "disable" trace event state to always use the "nop" backend.

As a side-effect, all events are now enabled (without "disable") by default, as all backends (except "stderr") have programmatic support for dynamically (de)activating each trace event.

In order to make this true, the "simple" backend now has a "-trace events=<file>" argument to let the user select which events must be enabled from the very beginning.

NOTES:
* Parsing of -trace arguments is not done in the OS-specific frontends.

---

Changes in v2:

* Documentation fixes.
* Seggregate whitespace/indentation changes.
* Minor code beautifications.
* Make all -trace suboptions explicit.
* Fix minor comments from Stefan.
* Minor trace-events format fixes.
* Integrate changes from Fabien.
* Rebase on qemu.git/master (c8f930c0eeb696d638f4d4bf654e955fa44ff40f).

Lluís Vilanova (11):
     minor whitespace/indentation fixes
     docs/tracing.txt: minor documentation fixes
     trace: [ust] fix generation of 'trace.c' on events without args
     trace: [trace-events] fix print formats in some events
     trace: [simple] minor code fixes on conditional compilation
     trace: generalize the "property" concept in the trace-events file
     trace-state: always use the "nop" backend on events with the "disable" keyword
     trace-state: [simple] disable all trace points by default
     trace-state: [simple] add "-trace events" argument to control initial state
     trace-state: [stderr] add support for dynamically enabling/disabling events
     trace: enable all events

 Makefile.objs     |    8 +
 configure         |   33 ++--
 docs/tracing.txt  |   50 +++--
 hmp-commands.hx   |   38 ++--
 monitor.c         |   24 ++-
 qemu-config.c     |    8 +
 qemu-options.hx   |   26 ++-
 scripts/tracetool |  121 +++++++------

Quoted 8 lines
 simpletrace.h     |    7 -
 stderrtrace.c     |   24 +++
 stderrtrace.h     |   14 ++
 trace-events      |  491 ++++++++++++++++++++++++++---------------------------
 vl.c              |  104 ++++++++---
 13 files changed, 530 insertions(+), 418 deletions(-)

 create mode 100644 stderrtrace.c
 create mode 100644 stderrtrace.h

Merged patches 2-4. I left comments on other patches.
http://repo.or.cz/w/qemu/stefanha.git/shortlog/refs/heads/tracing

This is good work and I look forward to merging the -trace events=<file> option. Please try to change only what is necessary, style issues are subjective.

Stefan