qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: kvm-ppc@vger.kernel.org,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: [Qemu-devel] [PATCH] trace: added ability to comment out events in the list
Date: Thu, 14 Jun 2012 14:41:40 +1000	[thread overview]
Message-ID: <4FD96B84.6080907@ozlabs.ru> (raw)

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

             reply	other threads:[~2012-06-14  4:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-14  4:41 Alexey Kardashevskiy [this message]
2012-06-14 13:18 ` [Qemu-devel] [PATCH] trace: added ability to comment out events in the list Stefan Hajnoczi
2012-06-15  4:36   ` Alexey Kardashevskiy
2012-06-15  8:35     ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FD96B84.6080907@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=benh@kernel.crashing.org \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).