From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53875) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWrYx-0001MH-5N for qemu-devel@nongnu.org; Tue, 22 May 2012 12:04:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SWrYq-0005Sw-Qf for qemu-devel@nongnu.org; Tue, 22 May 2012 12:03:54 -0400 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:35584) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWrYq-0005HM-Iw for qemu-devel@nongnu.org; Tue, 22 May 2012 12:03:48 -0400 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 22 May 2012 17:03:10 +0100 Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q4MG36i32338862 for ; Tue, 22 May 2012 17:03:06 +0100 Received: from d06av05.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q4MG35Tc028784 for ; Tue, 22 May 2012 10:03:06 -0600 From: Stefan Hajnoczi Date: Tue, 22 May 2012 17:03:02 +0100 Message-Id: <1337702582-26368-3-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1337702582-26368-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1337702582-26368-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 1.1 2/2] tracetool: allow parenthesis in trace-events format strings List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Llu=C3=ADs=20Vilanova?= , Stefan Hajnoczi The regular expression used to parse ./trace-events fails on the following input: test_paren(int n) "(%d)" The problem is that the regular expression uses greedy matching and '"' becomes the name of the event while 'test_paren(int n) ' becomes the properties of the event. Prevent greedy matching from going too far by explicitly saying the name cannot have a '"'. This forces the regular expression engine to backtrack to the desired match. Reported-by: Bob Breuer Signed-off-by: Stefan Hajnoczi --- scripts/tracetool/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py index 175df08..148f553 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -120,7 +120,7 @@ class Event(object): The event arguments. """ - _CRE = re.compile("((?P.*)\s+)?(?P[^(\s]+)\((?P[^)]*)\)\s*(?P\".*)?") + _CRE = re.compile("((?P.*)\s+)?(?P[^\"(\s]+)\((?P[^)]*)\)\s*(?P\".*)?") _VALID_PROPS = set(["disable"]) -- 1.7.10