From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sf1sR-000089-8U for qemu-devel@nongnu.org; Thu, 14 Jun 2012 00:41:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sf1sP-00029R-Fu for qemu-devel@nongnu.org; Thu, 14 Jun 2012 00:41:46 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:41700) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sf1sP-00029B-9X for qemu-devel@nongnu.org; Thu, 14 Jun 2012 00:41:45 -0400 Received: by dadn2 with SMTP id n2so961242dad.4 for ; Wed, 13 Jun 2012 21:41:43 -0700 (PDT) Message-ID: <4FD96B84.6080907@ozlabs.ru> Date: Thu, 14 Jun 2012 14:41:40 +1000 From: Alexey Kardashevskiy MIME-Version: 1.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] trace: added ability to comment out events in the list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: kvm-ppc@vger.kernel.org, "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 --- 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