提交 c562d15d 编写于 作者: A Anthony Liguori

Merge remote-tracking branch 'stefanha/tracing' into staging

* stefanha/tracing:
  trace: Remove "info trace" from documents
  trace: document '-' syntax for disabling events
  trace: allow disabling events in events file
  Avoid all systemtap reserved words
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
...@@ -139,6 +139,10 @@ having a common prefix in a batch. For example, virtio-blk trace events could ...@@ -139,6 +139,10 @@ having a common prefix in a batch. For example, virtio-blk trace events could
be enabled using: be enabled using:
trace-event virtio_blk_* on 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 == == Trace backends ==
The "tracetool" script automates tedious trace event code generation and also The "tracetool" script automates tedious trace event code generation and also
...@@ -185,15 +189,6 @@ records the char* pointer value instead of the string that is pointed to. ...@@ -185,15 +189,6 @@ records the char* pointer value instead of the string that is pointed to.
==== Monitor commands ==== ==== 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> * trace-file on|off|flush|set <path>
Enable/disable/flush the trace file or set the trace file name. Enable/disable/flush the trace file or set the trace file name.
......
...@@ -1573,13 +1573,6 @@ show roms ...@@ -1573,13 +1573,6 @@ show roms
@end table @end table
ETEXI ETEXI
#ifdef CONFIG_TRACE_SIMPLE
STEXI
@item info trace
show contents of trace buffer
ETEXI
#endif
STEXI STEXI
@item info trace-events @item info trace-events
show available trace events and their state show available trace events and their state
......
...@@ -73,6 +73,15 @@ def d(events): ...@@ -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): def stap(events):
for e in events: for e in events:
# Define prototype for probe arguments # Define prototype for probe arguments
...@@ -87,7 +96,7 @@ def stap(events): ...@@ -87,7 +96,7 @@ def stap(events):
if len(e.args) > 0: if len(e.args) > 0:
for name in e.args.names(): for name in e.args.names():
# Append underscore to reserved keywords # Append underscore to reserved keywords
if name in ('limit', 'in', 'next', 'self', 'function'): if name in RESERVED_WORDS:
name += '_' name += '_'
out(' %s = $arg%d;' % (name, i)) out(' %s = $arg%d;' % (name, i))
i += 1 i += 1
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
void trace_backend_init_events(const char *fname) void trace_backend_init_events(const char *fname)
{ {
int ret;
if (fname == NULL) { if (fname == NULL) {
return; return;
} }
...@@ -30,7 +32,12 @@ void trace_backend_init_events(const char *fname) ...@@ -30,7 +32,12 @@ void trace_backend_init_events(const char *fname)
if ('#' == line_buf[0]) { /* skip commented lines */ if ('#' == line_buf[0]) { /* skip commented lines */
continue; 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, fprintf(stderr,
"error: trace event '%s' does not exist\n", line_buf); "error: trace event '%s' does not exist\n", line_buf);
exit(1); exit(1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册