From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58223) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWHo8-0000Rl-3Y for qemu-devel@nongnu.org; Tue, 23 Sep 2014 00:34:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWHo3-0001T2-6X for qemu-devel@nongnu.org; Tue, 23 Sep 2014 00:34:32 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:37233) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWHo3-0001Rl-19 for qemu-devel@nongnu.org; Tue, 23 Sep 2014 00:34:27 -0400 Received: by mail-pa0-f42.google.com with SMTP id et14so5794101pad.15 for ; Mon, 22 Sep 2014 21:34:20 -0700 (PDT) Message-ID: <5420F825.3040600@linaro.org> Date: Tue, 23 Sep 2014 06:33:41 +0200 From: Eric Auger MIME-Version: 1.0 References: <1411402514-24137-1-git-send-email-stefanha@redhat.com> <87lhpb5zj9.fsf@fimbulvetr.bsc.es> In-Reply-To: <87lhpb5zj9.fsf@fimbulvetr.bsc.es> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] 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, vilanova@ac.upc.edu, Alexander Graf Dear all, Many thanks for the fix. I am currently travelling but I will test it early next week with vfio PCI & platform case. Also following Alex advises, I will move [RFC] vfio: migration to trace points into a PATCH. Best Regards Eric On 09/22/2014 07:35 PM, Lluís Vilanova wrote: > Stefan Hajnoczi writes: > >> 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 >> --- >> 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..474f11b 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+)?" >> + "(?P\w+)" >> "\((?P[^)]*)\)" >> "\s*" >> "(?:(?:(?P\".+),)?\s*(?P\".+))?" > > The previous implementation allowed multiple properties. Maybe this should be > instead (which still allows multiple properties): > > "((?P[\w\s]+)\s+)?" > "(?P\w+)\s*" > ... > > > Thanks, > Lluis >