Commit 794b1f96 authored by Alexey Kardashevskiy's avatar Alexey Kardashevskiy Committed by Stefan Hajnoczi
Browse files

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: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: default avatarStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
parent dfe1ce5d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);