From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYr0X-0004t2-Fm for qemu-devel@nongnu.org; Tue, 30 Sep 2014 02:34:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XYr0N-0004GH-DE for qemu-devel@nongnu.org; Tue, 30 Sep 2014 02:33:57 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:61745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYr0N-0004DW-7H for qemu-devel@nongnu.org; Tue, 30 Sep 2014 02:33:47 -0400 Received: by mail-wi0-f170.google.com with SMTP id n3so826661wiv.1 for ; Mon, 29 Sep 2014 23:33:40 -0700 (PDT) Message-ID: <542A4E9A.5010600@linaro.org> Date: Tue, 30 Sep 2014 08:32:58 +0200 From: Eric Auger MIME-Version: 1.0 References: <1411468626-20450-1-git-send-email-stefanha@redhat.com> In-Reply-To: <1411468626-20450-1-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v2] trace: tighten up trace-events regex to fix bad parse List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: =?UTF-8?B?TGx1w61zIFZpbGFub3Zh?= Dear all, this patch fixes the issues I reported (related to VFIO trace points). Many thanks for that. Best Regards Eric On 09/23/2014 12:37 PM, Stefan Hajnoczi wrote: > Use \w for properties and trace event names since they are both drawn > from [a-zA-Z0-9_] character sets. > > The .* for matching properties was too aggressive and caused the > following failure with foo(int rc) "(this is a test)": > > Traceback (most recent call last): > File "scripts/tracetool.py", line 139, in > main(sys.argv) > File "scripts/tracetool.py", line 134, in main > binary=binary, probe_prefix=probe_prefix) > File "scripts/tracetool/__init__.py", line 334, in generate > events = _read_events(fevents) > File "scripts/tracetool/__init__.py", line 262, in _read_events > res.append(Event.build(line)) > File "scripts/tracetool/__init__.py", line 225, in build > return Event(name, props, fmt, args, arg_fmts) > File "scripts/tracetool/__init__.py", line 185, in __init__ > % ", ".join(unknown_props)) > ValueError: Unknown properties: foo(int, rc) > > Cc: Lluís Vilanova > Reported-by: Eric Auger > Signed-off-by: Stefan Hajnoczi > --- > v2: > * Fix regex to allow multiple properties [Lluís] > > scripts/tracetool/__init__.py | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py > index 36c789d..6ee6af7 100644 > --- a/scripts/tracetool/__init__.py > +++ b/scripts/tracetool/__init__.py > @@ -140,8 +140,8 @@ class Event(object): > The format strings for each argument. > """ > > - _CRE = re.compile("((?P.*)\s+)?" > - "(?P[^(\s]+)" > + _CRE = re.compile("((?P[\w\s]+)\s+)?" > + "(?P\w+)" > "\((?P[^)]*)\)" > "\s*" > "(?:(?:(?P\".+),)?\s*(?P\".+))?" >