Skip to contentSkip to conversation

trace: added ability to comment out events in the list

PATCH Applied Alexey Kardashevskiy 2 participants 4 messages Jun 14, 2012 – Jun 15, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 trace/control.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
trace/control.c +3 -0
index 4c5527d..22d5863 100644
@@ -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);
Signature · 1 line
1.7.7.3
#1 lore raw
Quoted 10 lines · Alexey Kardashevskiy

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.

---
 trace/control.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Thanks, applied to the tracing patches tree:
https://github.com/stefanha/qemu/commits/tracing

Stefan

#2 lore raw
Quoted 7 lines · Stefan Hajnoczi
Quoted 6 lines · Alexey Kardashevskiy

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.

Quoted 7 lines
Quoted 4 lines
---
 trace/control.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Thanks, applied to the tracing patches tree:
https://github.com/stefanha/qemu/commits/tracing

Cannot find it there though :)

Signature · 1 line
Alexey
#3 lore raw
Quoted 13 lines · Alexey Kardashevskiy
Quoted 12 lines · Stefan Hajnoczi
Quoted 10 lines · Alexey Kardashevskiy

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.

---
 trace/control.c |    3 +++

 1 files changed, 3 insertions(+), 0 deletions(-)
Quoted 4 lines
Quoted 2 lines

Thanks, applied to the tracing patches tree:
https://github.com/stefanha/qemu/commits/tracing

Cannot find it there though :)

I just pushed the 'tracing' branch, sorry for the delay!

Stefan