qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 1/4] trace: added ability to comment out events in t


From: Stefan Hajnoczi
Subject: [Qemu-devel] [PATCH 1/4] trace: added ability to comment out events in the list
Date: Thu, 19 Jul 2012 11:52:50 +0100

From: Alexey Kardashevskiy <address@hidden>

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 <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
 trace/control.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/trace/control.c b/trace/control.c
index 4c5527d..22d5863 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);
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]