aboutsummaryrefslogtreecommitdiff
path: root/trace/control.c
diff options
context:
space:
mode:
authorAlexey Kardashevskiy <aik@ozlabs.ru>2012-06-14 14:41:40 +1000
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>2012-07-19 11:30:37 +0100
commit794b1f962eb3b1ceb6bbb98dd7a57f62fc0fbc11 (patch)
tree9b7b3215dca607b8a1b6ba4119b9eed42fff5d3a /trace/control.c
parentdfe1ce5d80cba603bafaac91b239d683abe19cf7 (diff)
trace: added ability to comment out events in the list
It is convenient for debug to be able to switch on/off some events easily. The only possibility now is to remove event name from the file completely and type it again when we want it back. The patch adds '#' symbol handling as a comment specifier. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Diffstat (limited to 'trace/control.c')
-rw-r--r--trace/control.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/trace/control.c b/trace/control.c
index 4c5527d20a..22d5863eeb 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -27,6 +27,9 @@ void trace_backend_init_events(const char *fname)
size_t len = strlen(line_buf);
if (len > 1) { /* skip empty lines */
line_buf[len - 1] = '\0';
+ if ('#' == line_buf[0]) { /* skip commented lines */
+ continue;
+ }
if (!trace_event_set_state(line_buf, true)) {
fprintf(stderr,
"error: trace event '%s' does not exist\n", line_buf);