From 794b1f962eb3b1ceb6bbb98dd7a57f62fc0fbc11 Mon Sep 17 00:00:00 2001 From: Alexey Kardashevskiy Date: Thu, 14 Jun 2012 14:41:40 +1000 Subject: 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 Signed-off-by: Stefan Hajnoczi --- trace/control.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'trace') 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); -- cgit v1.2.1