* [Qemu-devel] [PATCH 1/4] Avoid all systemtap reserved words
2012-11-16 13:19 [Qemu-devel] [PULL 0/4] Tracing patches Stefan Hajnoczi
@ 2012-11-16 13:19 ` Stefan Hajnoczi
2012-11-16 13:19 ` [Qemu-devel] [PATCH 2/4] trace: allow disabling events in events file Stefan Hajnoczi
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2012-11-16 13:19 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Hajnoczi
From: "Daniel P. Berrange" <berrange@redhat.com>
Over time various systemtap reserved words have been blacklisted
in the trace backend generator. The list is not complete though,
so there is continued risk of problems in the future. Preempt
such problems by specifying the full list of systemtap keywords
listed in its parser as identified here:
http://sourceware.org/ml/systemtap/2012-q4/msg00157.html
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
scripts/tracetool/backend/dtrace.py | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/scripts/tracetool/backend/dtrace.py b/scripts/tracetool/backend/dtrace.py
index 6be7047..23c43e2 100644
--- a/scripts/tracetool/backend/dtrace.py
+++ b/scripts/tracetool/backend/dtrace.py
@@ -73,6 +73,15 @@ def d(events):
'};')
+# Technically 'self' is not used by systemtap yet, but
+# they recommended we keep it in the reserved list anyway
+RESERVED_WORDS = (
+ 'break', 'catch', 'continue', 'delete', 'else', 'for',
+ 'foreach', 'function', 'global', 'if', 'in', 'limit',
+ 'long', 'next', 'probe', 'return', 'self', 'string',
+ 'try', 'while'
+ )
+
def stap(events):
for e in events:
# Define prototype for probe arguments
@@ -87,7 +96,7 @@ def stap(events):
if len(e.args) > 0:
for name in e.args.names():
# Append underscore to reserved keywords
- if name in ('limit', 'in', 'next', 'self', 'function'):
+ if name in RESERVED_WORDS:
name += '_'
out(' %s = $arg%d;' % (name, i))
i += 1
--
1.8.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH 2/4] trace: allow disabling events in events file
2012-11-16 13:19 [Qemu-devel] [PULL 0/4] Tracing patches Stefan Hajnoczi
2012-11-16 13:19 ` [Qemu-devel] [PATCH 1/4] Avoid all systemtap reserved words Stefan Hajnoczi
@ 2012-11-16 13:19 ` Stefan Hajnoczi
2012-11-16 13:19 ` [Qemu-devel] [PATCH 3/4] trace: document '-' syntax for disabling events Stefan Hajnoczi
2012-11-16 13:19 ` [Qemu-devel] [PATCH 4/4] trace: Remove "info trace" from documents Stefan Hajnoczi
3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2012-11-16 13:19 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann, Stefan Hajnoczi
From: Gerd Hoffmann <kraxel@redhat.com>
Disable trace events prefixed with a '-'. Useful
to enable a group of tracepoints with exceptions,
like this:
usb_xhci_port_*
-usb_xhci_port_read
which will enable all xhci port tracepoints except reads.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
trace/control.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/trace/control.c b/trace/control.c
index 22d5863..be05efb 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -12,6 +12,8 @@
void trace_backend_init_events(const char *fname)
{
+ int ret;
+
if (fname == NULL) {
return;
}
@@ -30,7 +32,12 @@ void trace_backend_init_events(const char *fname)
if ('#' == line_buf[0]) { /* skip commented lines */
continue;
}
- if (!trace_event_set_state(line_buf, true)) {
+ if ('-' == line_buf[0]) {
+ ret = trace_event_set_state(line_buf+1, false);
+ } else {
+ ret = trace_event_set_state(line_buf, true);
+ }
+ if (!ret) {
fprintf(stderr,
"error: trace event '%s' does not exist\n", line_buf);
exit(1);
--
1.8.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH 3/4] trace: document '-' syntax for disabling events
2012-11-16 13:19 [Qemu-devel] [PULL 0/4] Tracing patches Stefan Hajnoczi
2012-11-16 13:19 ` [Qemu-devel] [PATCH 1/4] Avoid all systemtap reserved words Stefan Hajnoczi
2012-11-16 13:19 ` [Qemu-devel] [PATCH 2/4] trace: allow disabling events in events file Stefan Hajnoczi
@ 2012-11-16 13:19 ` Stefan Hajnoczi
2012-11-16 13:19 ` [Qemu-devel] [PATCH 4/4] trace: Remove "info trace" from documents Stefan Hajnoczi
3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2012-11-16 13:19 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
docs/tracing.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/tracing.txt b/docs/tracing.txt
index c541133..7901409 100644
--- a/docs/tracing.txt
+++ b/docs/tracing.txt
@@ -139,6 +139,10 @@ having a common prefix in a batch. For example, virtio-blk trace events could
be enabled using:
trace-event virtio_blk_* on
+If a line in the "-trace events=<file>" file begins with a '-', the trace event
+will be disabled instead of enabled. This is useful when a wildcard was used
+to enable an entire family of events but one noisy event needs to be disabled.
+
== Trace backends ==
The "tracetool" script automates tedious trace event code generation and also
--
1.8.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH 4/4] trace: Remove "info trace" from documents
2012-11-16 13:19 [Qemu-devel] [PULL 0/4] Tracing patches Stefan Hajnoczi
` (2 preceding siblings ...)
2012-11-16 13:19 ` [Qemu-devel] [PATCH 3/4] trace: document '-' syntax for disabling events Stefan Hajnoczi
@ 2012-11-16 13:19 ` Stefan Hajnoczi
3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2012-11-16 13:19 UTC (permalink / raw)
To: qemu-devel; +Cc: Liming Wang, Stefan Hajnoczi
From: Liming Wang <walimisdev@gmail.com>
commit 88affa1c monitor: remove unused do_info_trace
has removed "info trace" function from monitor, so remove it from documents.
Signed-off-by: Liming Wang <walimisdev@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
docs/tracing.txt | 9 ---------
hmp-commands.hx | 7 -------
2 files changed, 16 deletions(-)
diff --git a/docs/tracing.txt b/docs/tracing.txt
index 7901409..453cc4a 100644
--- a/docs/tracing.txt
+++ b/docs/tracing.txt
@@ -189,15 +189,6 @@ records the char* pointer value instead of the string that is pointed to.
==== Monitor commands ====
-* info trace
- Display the contents of trace buffer. This command dumps the trace buffer
- with simple formatting. For full pretty-printing, use the simpletrace.py
- script on a binary trace file.
-
- The trace buffer is written into until full. The full trace buffer is
- flushed and emptied. This means the 'info trace' will display few or no
- entries if the buffer has just been flushed.
-
* trace-file on|off|flush|set <path>
Enable/disable/flush the trace file or set the trace file name.
diff --git a/hmp-commands.hx b/hmp-commands.hx
index b74ef75..010b8c9 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1573,13 +1573,6 @@ show roms
@end table
ETEXI
-#ifdef CONFIG_TRACE_SIMPLE
-STEXI
-@item info trace
-show contents of trace buffer
-ETEXI
-#endif
-
STEXI
@item info trace-events
show available trace events and their state
--
1.8.0
^ permalink raw reply related [flat|nested] 5+ messages in thread