From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SroMX-0001Y5-2W for qemu-devel@nongnu.org; Thu, 19 Jul 2012 06:53:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SroMQ-0000UG-BW for qemu-devel@nongnu.org; Thu, 19 Jul 2012 06:53:41 -0400 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:33653) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SroMQ-0000Tx-0c for qemu-devel@nongnu.org; Thu, 19 Jul 2012 06:53:34 -0400 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 19 Jul 2012 11:53:32 +0100 Received: from d06av06.portsmouth.uk.ibm.com (d06av06.portsmouth.uk.ibm.com [9.149.37.217]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6JArTEd2613282 for ; Thu, 19 Jul 2012 11:53:29 +0100 Received: from d06av06.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6JArSJh014197 for ; Thu, 19 Jul 2012 04:53:29 -0600 From: Stefan Hajnoczi Date: Thu, 19 Jul 2012 11:52:50 +0100 Message-Id: <1342695173-32010-2-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1342695173-32010-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1342695173-32010-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 1/4] trace: added ability to comment out events in the list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Alexey Kardashevskiy , qemu-devel@nongnu.org, Stefan Hajnoczi From: 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. Signed-off-by: Alexey Kardashevskiy Signed-off-by: Stefan Hajnoczi --- trace/control.c | 3 +++ 1 file changed, 3 insertions(+) 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.10.4