[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] trace: added ability to comment out events in the l
From: |
Alexey Kardashevskiy |
Subject: |
[Qemu-devel] [PATCH] trace: added ability to comment out events in the list |
Date: |
Thu, 14 Jun 2012 14:41:40 +1000 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 |
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>
---
trace/control.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
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.7.3
- [Qemu-devel] [PATCH] trace: added ability to comment out events in the list,
Alexey Kardashevskiy <=