qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] trace: added ability to comment out events in the list
@ 2012-06-14  4:41 Alexey Kardashevskiy
  2012-06-14 13:18 ` Stefan Hajnoczi
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Kardashevskiy @ 2012-06-14  4:41 UTC (permalink / raw)
  To: kvm-ppc, qemu-devel@nongnu.org, Benjamin Herrenschmidt

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>
---
 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-06-15  8:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-14  4:41 [Qemu-devel] [PATCH] trace: added ability to comment out events in the list Alexey Kardashevskiy
2012-06-14 13:18 ` Stefan Hajnoczi
2012-06-15  4:36   ` Alexey Kardashevskiy
2012-06-15  8:35     ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).