* [Qemu-devel] [RFC][PATCH v2 00/11] trace-state: make the behaviour of "disable" consistent across all backends
@ 2011-04-06 18:33 Lluís
2011-04-06 18:33 ` [Qemu-devel] [PATCH v2 01/11] minor whitespace/indentation fixes Lluís
` (11 more replies)
0 siblings, 12 replies; 26+ messages in thread
From: Lluís @ 2011-04-06 18:33 UTC (permalink / raw)
To: qemu-devel; +Cc: stefanha, chouteau
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.
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
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
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH v2 01/11] minor whitespace/indentation fixes
2011-04-06 18:33 [Qemu-devel] [RFC][PATCH v2 00/11] trace-state: make the behaviour of "disable" consistent across all backends Lluís
@ 2011-04-06 18:33 ` Lluís
2011-04-23 14:19 ` Stefan Hajnoczi
2011-04-06 18:33 ` [Qemu-devel] [PATCH v2 02/11] docs/tracing.txt: minor documentation fixes Lluís
` (10 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: Lluís @ 2011-04-06 18:33 UTC (permalink / raw)
To: qemu-devel; +Cc: stefanha, chouteau
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
configure | 30 +++++++++++++-------------
hmp-commands.hx | 28 ++++++++++++------------
monitor.c | 14 ++++++------
vl.c | 64 ++++++++++++++++++++++++++++---------------------------
4 files changed, 68 insertions(+), 68 deletions(-)
diff --git a/configure b/configure
index faaed60..8754060 100755
--- a/configure
+++ b/configure
@@ -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
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 834e6a8..c3be311 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -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"
diff --git a/monitor.c b/monitor.c
index f1a08dc..2ba1362 100644
--- a/monitor.c
+++ b/monitor.c
@@ -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':
diff --git a/vl.c b/vl.c
index de232b7..8478cb8 100644
--- a/vl.c
+++ b/vl.c
@@ -1860,7 +1860,7 @@ static int virtcon_parse(const char *devname)
}
static int debugcon_parse(const char *devname)
-{
+{
QemuOpts *opts;
if (!qemu_chr_open("debugcon", devname, NULL)) {
@@ -2041,7 +2041,7 @@ int main(int argc, char **argv, char **envp)
if (optind >= argc)
break;
if (argv[optind][0] != '-') {
- hda_opts = drive_add(IF_DEFAULT, 0, argv[optind++], HD_OPTS);
+ hda_opts = drive_add(IF_DEFAULT, 0, argv[optind++], HD_OPTS);
} else {
const QEMUOption *popt;
@@ -2103,15 +2103,15 @@ int main(int argc, char **argv, char **envp)
break;
case QEMU_OPTION_drive:
drive_def(optarg);
- break;
+ break;
case QEMU_OPTION_set:
if (qemu_set_option(optarg) != 0)
exit(1);
- break;
+ break;
case QEMU_OPTION_global:
if (qemu_global_option(optarg) != 0)
exit(1);
- break;
+ break;
case QEMU_OPTION_mtdblock:
drive_add(IF_MTD, -1, optarg, MTD_OPTS);
break;
@@ -2158,7 +2158,7 @@ int main(int argc, char **argv, char **envp)
fprintf(stderr, "qemu: invalid physical CHS format\n");
exit(1);
}
- if (hda_opts != NULL) {
+ if (hda_opts != NULL) {
char num[16];
snprintf(num, sizeof(num), "%d", cyls);
qemu_opt_set(hda_opts, "cyls", num);
@@ -2360,9 +2360,9 @@ int main(int argc, char **argv, char **envp)
case QEMU_OPTION_S:
autostart = 0;
break;
- case QEMU_OPTION_k:
- keyboard_layout = optarg;
- break;
+ case QEMU_OPTION_k:
+ keyboard_layout = optarg;
+ break;
case QEMU_OPTION_localtime:
rtc_utc = 0;
break;
@@ -2545,9 +2545,9 @@ int main(int argc, char **argv, char **envp)
case QEMU_OPTION_debugcon:
add_device_config(DEV_DEBUGCON, optarg);
break;
- case QEMU_OPTION_loadvm:
- loadvm = optarg;
- break;
+ case QEMU_OPTION_loadvm:
+ loadvm = optarg;
+ break;
case QEMU_OPTION_full_screen:
full_screen = 1;
break;
@@ -2622,7 +2622,7 @@ int main(int argc, char **argv, char **envp)
exit(1);
}
break;
- case QEMU_OPTION_vnc:
+ case QEMU_OPTION_vnc:
#ifdef CONFIG_VNC
display_remote++;
vnc_display = optarg;
@@ -2659,11 +2659,11 @@ int main(int argc, char **argv, char **envp)
exit(1);
}
break;
- case QEMU_OPTION_option_rom:
- if (nb_option_roms >= MAX_OPTION_ROMS) {
- fprintf(stderr, "Too many option ROMs\n");
- exit(1);
- }
+ case QEMU_OPTION_option_rom:
+ if (nb_option_roms >= MAX_OPTION_ROMS) {
+ fprintf(stderr, "Too many option ROMs\n");
+ exit(1);
+ }
opts = qemu_opts_parse(qemu_find_opts("option-rom"), optarg, 1);
option_rom[nb_option_roms].name = qemu_opt_get(opts, "romfile");
option_rom[nb_option_roms].bootindex =
@@ -2672,25 +2672,25 @@ int main(int argc, char **argv, char **envp)
fprintf(stderr, "Option ROM file is not specified\n");
exit(1);
}
- nb_option_roms++;
- break;
+ nb_option_roms++;
+ break;
case QEMU_OPTION_semihosting:
semihosting_enabled = 1;
break;
case QEMU_OPTION_name:
qemu_name = qemu_strdup(optarg);
- {
- char *p = strchr(qemu_name, ',');
- if (p != NULL) {
- *p++ = 0;
- if (strncmp(p, "process=", 8)) {
- fprintf(stderr, "Unknown subargument %s to -name\n", p);
- exit(1);
- }
- p += 8;
- os_set_proc_name(p);
- }
- }
+ {
+ char *p = strchr(qemu_name, ',');
+ if (p != NULL) {
+ *p++ = 0;
+ if (strncmp(p, "process=", 8)) {
+ fprintf(stderr, "Unknown subargument %s to -name\n", p);
+ exit(1);
+ }
+ p += 8;
+ os_set_proc_name(p);
+ }
+ }
break;
case QEMU_OPTION_prom_env:
if (nb_prom_envs >= MAX_PROM_ENVS) {
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH v2 02/11] docs/tracing.txt: minor documentation fixes
2011-04-06 18:33 [Qemu-devel] [RFC][PATCH v2 00/11] trace-state: make the behaviour of "disable" consistent across all backends Lluís
2011-04-06 18:33 ` [Qemu-devel] [PATCH v2 01/11] minor whitespace/indentation fixes Lluís
@ 2011-04-06 18:33 ` Lluís
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 03/11] trace: [ust] fix generation of 'trace.c' on events without args Lluís
` (9 subsequent siblings)
11 siblings, 0 replies; 26+ messages in thread
From: Lluís @ 2011-04-06 18:33 UTC (permalink / raw)
To: qemu-devel; +Cc: stefanha, chouteau
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
docs/tracing.txt | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/docs/tracing.txt b/docs/tracing.txt
index f15069c..34b0901 100644
--- a/docs/tracing.txt
+++ b/docs/tracing.txt
@@ -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.
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH v2 03/11] trace: [ust] fix generation of 'trace.c' on events without args
2011-04-06 18:33 [Qemu-devel] [RFC][PATCH v2 00/11] trace-state: make the behaviour of "disable" consistent across all backends Lluís
2011-04-06 18:33 ` [Qemu-devel] [PATCH v2 01/11] minor whitespace/indentation fixes Lluís
2011-04-06 18:33 ` [Qemu-devel] [PATCH v2 02/11] docs/tracing.txt: minor documentation fixes Lluís
@ 2011-04-06 18:34 ` Lluís
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 04/11] trace: [trace-events] fix print formats in some events Lluís
` (8 subsequent siblings)
11 siblings, 0 replies; 26+ messages in thread
From: Lluís @ 2011-04-06 18:34 UTC (permalink / raw)
To: qemu-devel; +Cc: stefanha, chouteau
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
scripts/tracetool | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/scripts/tracetool b/scripts/tracetool
index 412f695..d88cb43 100755
--- a/scripts/tracetool
+++ b/scripts/tracetool
@@ -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
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH v2 04/11] trace: [trace-events] fix print formats in some events
2011-04-06 18:33 [Qemu-devel] [RFC][PATCH v2 00/11] trace-state: make the behaviour of "disable" consistent across all backends Lluís
` (2 preceding siblings ...)
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 03/11] trace: [ust] fix generation of 'trace.c' on events without args Lluís
@ 2011-04-06 18:34 ` Lluís
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 05/11] trace: [simple] minor code fixes on conditional compilation Lluís
` (7 subsequent siblings)
11 siblings, 0 replies; 26+ messages in thread
From: Lluís @ 2011-04-06 18:34 UTC (permalink / raw)
To: qemu-devel; +Cc: stefanha, chouteau
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
trace-events | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/trace-events b/trace-events
index 06efdb7..9fcc3bb 100644
--- a/trace-events
+++ b/trace-events
@@ -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"
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH v2 05/11] trace: [simple] minor code fixes on conditional compilation
2011-04-06 18:33 [Qemu-devel] [RFC][PATCH v2 00/11] trace-state: make the behaviour of "disable" consistent across all backends Lluís
` (3 preceding siblings ...)
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 04/11] trace: [trace-events] fix print formats in some events Lluís
@ 2011-04-06 18:34 ` Lluís
2011-04-23 14:20 ` Stefan Hajnoczi
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 06/11] trace: generalize the "property" concept in the trace-events file Lluís
` (6 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: Lluís @ 2011-04-06 18:34 UTC (permalink / raw)
To: qemu-devel; +Cc: stefanha, chouteau
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
monitor.c | 4 +---
qemu-config.c | 4 ++--
simpletrace.h | 7 -------
vl.c | 7 +++++--
4 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/monitor.c b/monitor.c
index 2ba1362..377424e 100644
--- a/monitor.c
+++ b/monitor.c
@@ -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");
diff --git a/qemu-config.c b/qemu-config.c
index 323d3c2..8ba0804 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -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,
diff --git a/simpletrace.h b/simpletrace.h
index 8d893bd..196bbe7 100644
--- a/simpletrace.h
+++ b/simpletrace.h
@@ -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 */
diff --git a/vl.c b/vl.c
index 8478cb8..5a9ea51 100644
--- a/vl.c
+++ b/vl.c
@@ -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. */
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH v2 06/11] trace: generalize the "property" concept in the trace-events file
2011-04-06 18:33 [Qemu-devel] [RFC][PATCH v2 00/11] trace-state: make the behaviour of "disable" consistent across all backends Lluís
` (4 preceding siblings ...)
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 05/11] trace: [simple] minor code fixes on conditional compilation Lluís
@ 2011-04-06 18:34 ` Lluís
2011-04-23 14:22 ` Stefan Hajnoczi
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 07/11] trace-state: always use the "nop" backend on events with the "disable" keyword Lluís
` (5 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: Lluís @ 2011-04-06 18:34 UTC (permalink / raw)
To: qemu-devel; +Cc: stefanha, chouteau
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)
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
docs/tracing.txt | 6 ++--
scripts/tracetool | 73 ++++++++++++++++++++++++-----------------------------
2 files changed, 36 insertions(+), 43 deletions(-)
diff --git a/docs/tracing.txt b/docs/tracing.txt
index 34b0901..a9fd85b 100644
--- a/docs/tracing.txt
+++ b/docs/tracing.txt
@@ -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 */
diff --git a/scripts/tracetool b/scripts/tracetool
index d88cb43..6d8ead2 100755
--- a/scripts/tracetool
+++ b/scripts/tracetool
@@ -43,7 +43,26 @@ EOF
# Get the name of a trace event
get_name()
{
- echo ${1%%\(*}
+ local name
+ name=${1%%\(*}
+ echo "${name##* }"
+}
+
+# Get the given property of a trace event
+# 1: trace-events line
+# 2: property name
+# -> return 0 if property is present, or 1 otherwise
+has_property()
+{
+ local props prop
+ props=${1%%\(*}
+ props=${props% *}
+ for prop in $props; do
+ if [ "$prop" = "$2" ]; then
+ return 0
+ fi
+ done
+ return 1
}
# Get the argument list of a trace event, including types and names
@@ -101,20 +120,6 @@ get_fmt()
echo "$fmt"
}
-# Get the state of a trace event
-get_state()
-{
- local str disable state
- str=$(get_name "$1")
- disable=${str##disable }
- if [ "$disable" = "$str" ] ; then
- state=1
- else
- state=0
- fi
- echo "$state"
-}
-
linetoh_begin_nop()
{
return
@@ -174,14 +179,10 @@ cast_args_to_uint64_t()
linetoh_simple()
{
- local name args argc trace_args state
+ local name args argc trace_args
name=$(get_name "$1")
args=$(get_args "$1")
argc=$(get_argc "$1")
- state=$(get_state "$1")
- if [ "$state" = "0" ]; then
- name=${name##disable }
- fi
trace_args="$simple_event_num"
if [ "$argc" -gt 0 ]
@@ -222,9 +223,10 @@ linetoc_simple()
{
local name state
name=$(get_name "$1")
- state=$(get_state "$1")
- if [ "$state" = "0" ] ; then
- name=${name##disable }
+ if has_property "$1" "disable"; then
+ state="0"
+ else
+ state="1"
fi
cat <<EOF
{.tp_name = "$name", .state=$state},
@@ -379,14 +381,10 @@ EOF
linetoh_dtrace()
{
- local name args argnames state nameupper
+ local name args argnames nameupper
name=$(get_name "$1")
args=$(get_args "$1")
argnames=$(get_argnames "$1", ",")
- state=$(get_state "$1")
- if [ "$state" = "0" ] ; then
- name=${name##disable }
- fi
nameupper=`echo $name | tr '[:lower:]' '[:upper:]'`
@@ -430,13 +428,9 @@ EOF
linetod_dtrace()
{
- local name args state
+ local name args
name=$(get_name "$1")
args=$(get_args "$1")
- state=$(get_state "$1")
- if [ "$state" = "0" ] ; then
- name=${name##disable }
- fi
# DTrace provider syntax expects foo() for empty
# params, not foo(void)
@@ -464,14 +458,10 @@ linetostap_begin_dtrace()
linetostap_dtrace()
{
- local i arg name args arglist state
+ local i arg name args arglist
name=$(get_name "$1")
args=$(get_args "$1")
arglist=$(get_argnames "$1", "")
- state=$(get_state "$1")
- if [ "$state" = "0" ] ; then
- name=${name##disable }
- fi
# Define prototype for probe arguments
cat <<EOF
@@ -517,9 +507,12 @@ convert()
test -z "${str%%#*}" && continue
# Process the line. The nop backend handles disabled lines.
- disable=${str%%disable *}
+ disable="0"
+ if has_property "$str" "disable"; then
+ disable="1"
+ fi
echo
- if test -z "$disable"; then
+ 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()
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH v2 07/11] trace-state: always use the "nop" backend on events with the "disable" keyword
2011-04-06 18:33 [Qemu-devel] [RFC][PATCH v2 00/11] trace-state: make the behaviour of "disable" consistent across all backends Lluís
` (5 preceding siblings ...)
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 06/11] trace: generalize the "property" concept in the trace-events file Lluís
@ 2011-04-06 18:34 ` Lluís
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 08/11] trace-state: [simple] disable all trace points by default Lluís
` (4 subsequent siblings)
11 siblings, 0 replies; 26+ messages in thread
From: Lluís @ 2011-04-06 18:34 UTC (permalink / raw)
To: qemu-devel; +Cc: stefanha, chouteau
Any event with the keyword/property "disable" generates an empty trace event
using the "nop" backend, regardless of the current backend.
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
docs/tracing.txt | 25 +++++++++++++++----------
scripts/tracetool | 15 ++-------------
2 files changed, 17 insertions(+), 23 deletions(-)
diff --git a/docs/tracing.txt b/docs/tracing.txt
index a9fd85b..9138dca 100644
--- a/docs/tracing.txt
+++ b/docs/tracing.txt
@@ -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
diff --git a/scripts/tracetool b/scripts/tracetool
index 6d8ead2..7506776 100755
--- a/scripts/tracetool
+++ b/scripts/tracetool
@@ -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
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH v2 08/11] trace-state: [simple] disable all trace points by default
2011-04-06 18:33 [Qemu-devel] [RFC][PATCH v2 00/11] trace-state: make the behaviour of "disable" consistent across all backends Lluís
` (6 preceding siblings ...)
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 07/11] trace-state: always use the "nop" backend on events with the "disable" keyword Lluís
@ 2011-04-06 18:34 ` Lluís
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 09/11] trace-state: [simple] add "-trace events" argument to control initial state Lluís
` (3 subsequent siblings)
11 siblings, 0 replies; 26+ messages in thread
From: Lluís @ 2011-04-06 18:34 UTC (permalink / raw)
To: qemu-devel; +Cc: stefanha, chouteau
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).
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
scripts/tracetool | 9 ++-------
trace-events | 3 ---
2 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/scripts/tracetool b/scripts/tracetool
index 7506776..e3aec89 100755
--- a/scripts/tracetool
+++ b/scripts/tracetool
@@ -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))
}
diff --git a/trace-events b/trace-events
index 9fcc3bb..61bb3fb 100644
--- a/trace-events
+++ b/trace-events
@@ -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.
#
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH v2 09/11] trace-state: [simple] add "-trace events" argument to control initial state
2011-04-06 18:33 [Qemu-devel] [RFC][PATCH v2 00/11] trace-state: make the behaviour of "disable" consistent across all backends Lluís
` (7 preceding siblings ...)
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 08/11] trace-state: [simple] disable all trace points by default Lluís
@ 2011-04-06 18:34 ` Lluís
2011-04-06 18:35 ` [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events Lluís
` (2 subsequent siblings)
11 siblings, 0 replies; 26+ messages in thread
From: Lluís @ 2011-04-06 18:34 UTC (permalink / raw)
To: qemu-devel; +Cc: stefanha, chouteau
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".
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
docs/tracing.txt | 5 +++++
qemu-config.c | 3 +++
qemu-options.hx | 18 ++++++++++++++----
vl.c | 26 ++++++++++++++++++++++++++
4 files changed, 48 insertions(+), 4 deletions(-)
diff --git a/docs/tracing.txt b/docs/tracing.txt
index 9138dca..26b221f 100644
--- a/docs/tracing.txt
+++ b/docs/tracing.txt
@@ -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
diff --git a/qemu-config.c b/qemu-config.c
index 8ba0804..7c7357f 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -306,6 +306,9 @@ static QemuOptsList qemu_trace_opts = {
{
.name = "file",
.type = QEMU_OPT_STRING,
+ },{
+ .name = "events",
+ .type = QEMU_OPT_STRING,
},
{ /* end if list */ }
},
diff --git a/qemu-options.hx b/qemu-options.hx
index ef60730..ff8e75d 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -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
diff --git a/vl.c b/vl.c
index 5a9ea51..35d440d 100644
--- a/vl.c
+++ b/vl.c
@@ -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
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events
2011-04-06 18:33 [Qemu-devel] [RFC][PATCH v2 00/11] trace-state: make the behaviour of "disable" consistent across all backends Lluís
` (8 preceding siblings ...)
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 09/11] trace-state: [simple] add "-trace events" argument to control initial state Lluís
@ 2011-04-06 18:35 ` Lluís
2011-04-23 14:31 ` Stefan Hajnoczi
2011-04-06 18:35 ` [Qemu-devel] [PATCH v2 11/11] trace: enable all events Lluís
2011-04-23 14:45 ` [Qemu-devel] [RFC][PATCH v2 00/11] trace-state: make the behaviour of "disable" consistent across all backends Stefan Hajnoczi
11 siblings, 1 reply; 26+ messages in thread
From: Lluís @ 2011-04-06 18:35 UTC (permalink / raw)
To: qemu-devel; +Cc: stefanha, chouteau
This includes all the control interfaces already provided by the "simple"
backend (i.e., command line, programmatic and monitor).
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
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
diff --git a/Makefile.objs b/Makefile.objs
index c05f5e5..f7cd67b 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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)
-
diff --git a/configure b/configure
index 8754060..7dc9bdc 100755
--- a/configure
+++ b/configure
@@ -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\""
diff --git a/docs/tracing.txt b/docs/tracing.txt
index 26b221f..51fe0ad 100644
--- a/docs/tracing.txt
+++ b/docs/tracing.txt
@@ -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 ===
diff --git a/hmp-commands.hx b/hmp-commands.hx
index c3be311..7cca351 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -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
diff --git a/monitor.c b/monitor.c
index 377424e..7991c6c 100644
--- a/monitor.c
+++ b/monitor.c
@@ -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 = "",
diff --git a/qemu-config.c b/qemu-config.c
index 7c7357f..7a20971 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -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,
diff --git a/qemu-options.hx b/qemu-options.hx
index ff8e75d..1bcc27b 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -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}.
diff --git a/scripts/tracetool b/scripts/tracetool
index e3aec89..17e3f37 100755
--- a/scripts/tracetool
+++ b/scripts/tracetool
@@ -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
diff --git a/stderrtrace.c b/stderrtrace.c
new file mode 100644
index 0000000..dac373c
--- /dev/null
+++ b/stderrtrace.c
@@ -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;
+}
diff --git a/stderrtrace.h b/stderrtrace.h
new file mode 100644
index 0000000..48ac36a
--- /dev/null
+++ b/stderrtrace.h
@@ -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_ */
diff --git a/vl.c b/vl.c
index 35d440d..67dc530 100644
--- a/vl.c
+++ b/vl.c
@@ -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) {
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [Qemu-devel] [PATCH v2 11/11] trace: enable all events
2011-04-06 18:33 [Qemu-devel] [RFC][PATCH v2 00/11] trace-state: make the behaviour of "disable" consistent across all backends Lluís
` (9 preceding siblings ...)
2011-04-06 18:35 ` [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events Lluís
@ 2011-04-06 18:35 ` Lluís
2011-04-23 14:45 ` [Qemu-devel] [RFC][PATCH v2 00/11] trace-state: make the behaviour of "disable" consistent across all backends Stefan Hajnoczi
11 siblings, 0 replies; 26+ messages in thread
From: Lluís @ 2011-04-06 18:35 UTC (permalink / raw)
To: qemu-devel; +Cc: stefanha, chouteau
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.
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
trace-events | 488 +++++++++++++++++++++++++++++-----------------------------
1 files changed, 244 insertions(+), 244 deletions(-)
diff --git a/trace-events b/trace-events
index 61bb3fb..cd8c9d9 100644
--- a/trace-events
+++ b/trace-events
@@ -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"
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH v2 01/11] minor whitespace/indentation fixes
2011-04-06 18:33 ` [Qemu-devel] [PATCH v2 01/11] minor whitespace/indentation fixes Lluís
@ 2011-04-23 14:19 ` Stefan Hajnoczi
2011-04-26 10:00 ` Markus Armbruster
0 siblings, 1 reply; 26+ messages in thread
From: Stefan Hajnoczi @ 2011-04-23 14:19 UTC (permalink / raw)
To: Lluís; +Cc: qemu-devel, chouteau
On Wed, Apr 6, 2011 at 7:33 PM, Lluís <xscript@gmx.net> wrote:
> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
> ---
> 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
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH v2 05/11] trace: [simple] minor code fixes on conditional compilation
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 05/11] trace: [simple] minor code fixes on conditional compilation Lluís
@ 2011-04-23 14:20 ` Stefan Hajnoczi
0 siblings, 0 replies; 26+ messages in thread
From: Stefan Hajnoczi @ 2011-04-23 14:20 UTC (permalink / raw)
To: Lluís; +Cc: qemu-devel, chouteau
On Wed, Apr 6, 2011 at 7:34 PM, Lluís <xscript@gmx.net> wrote:
> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
> ---
> 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
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH v2 06/11] trace: generalize the "property" concept in the trace-events file
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 06/11] trace: generalize the "property" concept in the trace-events file Lluís
@ 2011-04-23 14:22 ` Stefan Hajnoczi
0 siblings, 0 replies; 26+ messages in thread
From: Stefan Hajnoczi @ 2011-04-23 14:22 UTC (permalink / raw)
To: Lluís; +Cc: qemu-devel, chouteau
On Wed, Apr 6, 2011 at 7:34 PM, Lluís <xscript@gmx.net> wrote:
> diff --git a/docs/tracing.txt b/docs/tracing.txt
> index 34b0901..a9fd85b 100644
> --- a/docs/tracing.txt
> +++ b/docs/tracing.txt
> @@ -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 */
Tailing whitespace is there due to wiki formatting. Please do not remove it.
The rest looks good.
Stefan
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events
2011-04-06 18:35 ` [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events Lluís
@ 2011-04-23 14:31 ` Stefan Hajnoczi
2011-04-24 6:24 ` Paolo Bonzini
0 siblings, 1 reply; 26+ messages in thread
From: Stefan Hajnoczi @ 2011-04-23 14:31 UTC (permalink / raw)
To: Lluís; +Cc: qemu-devel, chouteau
On Wed, Apr 6, 2011 at 7:35 PM, Lluís <xscript@gmx.net> wrote:
> This includes all the control interfaces already provided by the "simple"
> backend (i.e., command line, programmatic and monitor).
>
> Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
> ---
> 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
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
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [RFC][PATCH v2 00/11] trace-state: make the behaviour of "disable" consistent across all backends
2011-04-06 18:33 [Qemu-devel] [RFC][PATCH v2 00/11] trace-state: make the behaviour of "disable" consistent across all backends Lluís
` (10 preceding siblings ...)
2011-04-06 18:35 ` [Qemu-devel] [PATCH v2 11/11] trace: enable all events Lluís
@ 2011-04-23 14:45 ` Stefan Hajnoczi
11 siblings, 0 replies; 26+ messages in thread
From: Stefan Hajnoczi @ 2011-04-23 14:45 UTC (permalink / raw)
To: Lluís; +Cc: qemu-devel, chouteau
On Wed, Apr 6, 2011 at 7:33 PM, Lluís <xscript@gmx.net> wrote:
> 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.
>
> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
> ---
>
> 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
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
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events
2011-04-23 14:31 ` Stefan Hajnoczi
@ 2011-04-24 6:24 ` Paolo Bonzini
2011-04-24 9:33 ` Stefan Hajnoczi
0 siblings, 1 reply; 26+ messages in thread
From: Paolo Bonzini @ 2011-04-24 6:24 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: Lluís, chouteau, qemu-devel
On 04/23/2011 04:31 PM, Stefan Hajnoczi wrote:
> 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
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events
2011-04-24 6:24 ` Paolo Bonzini
@ 2011-04-24 9:33 ` Stefan Hajnoczi
2011-04-25 10:27 ` Lluís
0 siblings, 1 reply; 26+ messages in thread
From: Stefan Hajnoczi @ 2011-04-24 9:33 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Lluís, chouteau, qemu-devel
On Sun, Apr 24, 2011 at 7:24 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 04/23/2011 04:31 PM, Stefan Hajnoczi wrote:
>>
>> 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
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events
2011-04-24 9:33 ` Stefan Hajnoczi
@ 2011-04-25 10:27 ` Lluís
2011-04-25 18:10 ` Paolo Bonzini
0 siblings, 1 reply; 26+ messages in thread
From: Lluís @ 2011-04-25 10:27 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: Paolo Bonzini, qemu-devel, chouteau
Stefan Hajnoczi writes:
> On Sun, Apr 24, 2011 at 7:24 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>> On 04/23/2011 04:31 PM, Stefan Hajnoczi wrote:
>>>
>>> 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.
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
--
"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
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events
2011-04-25 10:27 ` Lluís
@ 2011-04-25 18:10 ` Paolo Bonzini
2011-04-26 12:30 ` Fabien Chouteau
0 siblings, 1 reply; 26+ messages in thread
From: Paolo Bonzini @ 2011-04-25 18:10 UTC (permalink / raw)
To: Lluís; +Cc: Stefan Hajnoczi, qemu-devel, chouteau
On 04/25/2011 12:27 PM, Lluís wrote:
> 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
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH v2 01/11] minor whitespace/indentation fixes
2011-04-23 14:19 ` Stefan Hajnoczi
@ 2011-04-26 10:00 ` Markus Armbruster
0 siblings, 0 replies; 26+ messages in thread
From: Markus Armbruster @ 2011-04-26 10:00 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: Lluís, chouteau, qemu-devel
Stefan Hajnoczi <stefanha@gmail.com> writes:
> On Wed, Apr 6, 2011 at 7:33 PM, Lluís <xscript@gmx.net> wrote:
>> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
>> ---
>> 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".
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events
2011-04-25 18:10 ` Paolo Bonzini
@ 2011-04-26 12:30 ` Fabien Chouteau
2011-04-26 12:38 ` Stefan Hajnoczi
0 siblings, 1 reply; 26+ messages in thread
From: Fabien Chouteau @ 2011-04-26 12:30 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Stefan Hajnoczi, Lluís, qemu-devel
On 04/25/2011 08:10 PM, Paolo Bonzini wrote:
> On 04/25/2011 12:27 PM, Lluís wrote:
>> 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).
--
Fabien Chouteau
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events
2011-04-26 12:30 ` Fabien Chouteau
@ 2011-04-26 12:38 ` Stefan Hajnoczi
2011-04-26 12:59 ` Paolo Bonzini
2011-04-26 14:01 ` Lluís
0 siblings, 2 replies; 26+ messages in thread
From: Stefan Hajnoczi @ 2011-04-26 12:38 UTC (permalink / raw)
To: Fabien Chouteau; +Cc: Paolo Bonzini, Lluís, qemu-devel
On Tue, Apr 26, 2011 at 1:30 PM, Fabien Chouteau <chouteau@adacore.com> wrote:
> On 04/25/2011 08:10 PM, Paolo Bonzini wrote:
>> On 04/25/2011 12:27 PM, Lluís wrote:
>>> 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
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events
2011-04-26 12:38 ` Stefan Hajnoczi
@ 2011-04-26 12:59 ` Paolo Bonzini
2011-04-26 14:01 ` Lluís
1 sibling, 0 replies; 26+ messages in thread
From: Paolo Bonzini @ 2011-04-26 12:59 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: Lluís, Fabien Chouteau, qemu-devel
On 04/26/2011 02:38 PM, Stefan Hajnoczi wrote:
> 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
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events
2011-04-26 12:38 ` Stefan Hajnoczi
2011-04-26 12:59 ` Paolo Bonzini
@ 2011-04-26 14:01 ` Lluís
1 sibling, 0 replies; 26+ messages in thread
From: Lluís @ 2011-04-26 14:01 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: Paolo Bonzini, qemu-devel, Fabien Chouteau
Stefan Hajnoczi writes:
> On Tue, Apr 26, 2011 at 1:30 PM, Fabien Chouteau <chouteau@adacore.com> wrote:
>> On 04/25/2011 08:10 PM, Paolo Bonzini wrote:
>>> On 04/25/2011 12:27 PM, Lluís wrote:
>>>> 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.
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
--
"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
^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2011-04-26 14:01 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-06 18:33 [Qemu-devel] [RFC][PATCH v2 00/11] trace-state: make the behaviour of "disable" consistent across all backends Lluís
2011-04-06 18:33 ` [Qemu-devel] [PATCH v2 01/11] minor whitespace/indentation fixes Lluís
2011-04-23 14:19 ` Stefan Hajnoczi
2011-04-26 10:00 ` Markus Armbruster
2011-04-06 18:33 ` [Qemu-devel] [PATCH v2 02/11] docs/tracing.txt: minor documentation fixes Lluís
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 03/11] trace: [ust] fix generation of 'trace.c' on events without args Lluís
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 04/11] trace: [trace-events] fix print formats in some events Lluís
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 05/11] trace: [simple] minor code fixes on conditional compilation Lluís
2011-04-23 14:20 ` Stefan Hajnoczi
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 06/11] trace: generalize the "property" concept in the trace-events file Lluís
2011-04-23 14:22 ` Stefan Hajnoczi
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 07/11] trace-state: always use the "nop" backend on events with the "disable" keyword Lluís
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 08/11] trace-state: [simple] disable all trace points by default Lluís
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 09/11] trace-state: [simple] add "-trace events" argument to control initial state Lluís
2011-04-06 18:35 ` [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events Lluís
2011-04-23 14:31 ` Stefan Hajnoczi
2011-04-24 6:24 ` Paolo Bonzini
2011-04-24 9:33 ` Stefan Hajnoczi
2011-04-25 10:27 ` Lluís
2011-04-25 18:10 ` Paolo Bonzini
2011-04-26 12:30 ` Fabien Chouteau
2011-04-26 12:38 ` Stefan Hajnoczi
2011-04-26 12:59 ` Paolo Bonzini
2011-04-26 14:01 ` Lluís
2011-04-06 18:35 ` [Qemu-devel] [PATCH v2 11/11] trace: enable all events Lluís
2011-04-23 14:45 ` [Qemu-devel] [RFC][PATCH v2 00/11] trace-state: make the behaviour of "disable" consistent across all backends Stefan Hajnoczi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).