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>
This commit is contained in:
Alexey Kardashevskiy 2012-06-14 14:41:40 +10:00 committed by Stefan Hajnoczi
parent dfe1ce5d80
commit 794b1f962e
1 changed files with 3 additions and 0 deletions

View File

@ -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);