Received: from eggs.gnu.org ([2001:4830:134:3::10]:44866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWNQB-000550-Bs for qemu-devel@nongnu.org; Tue, 23 Sep 2014 06:34:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWNQ5-0001Be-BK for qemu-devel@nongnu.org; Tue, 23 Sep 2014 06:34:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWNQ5-0001BK-3u for qemu-devel@nongnu.org; Tue, 23 Sep 2014 06:34:05 -0400 Date: Tue, 23 Sep 2014 11:33:56 +0100 From: Stefan Hajnoczi Message-ID: <20140923103356.GM2713@stefanha-thinkpad.redhat.com> References: <1411402514-24137-1-git-send-email-stefanha@redhat.com> <87lhpb5zj9.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RXc6EO4W1yUvSQ0X" Content-Disposition: inline In-Reply-To: <87lhpb5zj9.fsf@fimbulvetr.bsc.es> 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: qemu-devel@nongnu.org, Eric Auger --RXc6EO4W1yUvSQ0X Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 22, 2014 at 12:35:22PM -0500, Llu=EDs Vilanova wrote: > Stefan Hajnoczi writes: >=20 > > Use \w for properties and trace event names since they are both drawn > > from [a-zA-Z0-9_] character sets. >=20 > > The .* for matching properties was too aggressive and caused the > > following failure with foo(int rc) "(this is a test)": >=20 > > Traceback (most recent call last): > > File "scripts/tracetool.py", line 139, in > > main(sys.argv) > > File "scripts/tracetool.py", line 134, in main > > binary=3Dbinary, probe_prefix=3Dprobe_prefix) > > File "scripts/tracetool/__init__.py", line 334, in generate > > events =3D _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) >=20 > > Cc: Llu=EDs Vilanova > > Reported-by: Eric Auger > > Signed-off-by: Stefan Hajnoczi > > --- > > scripts/tracetool/__init__.py | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > > diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__= =2Epy > > 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. > > """ > =20 > > - _CRE =3D re.compile("((?P.*)\s+)?" > > - "(?P[^(\s]+)" > > + _CRE =3D re.compile("((?P\w*)\s+)?" > > + "(?P\w+)" > > "\((?P[^)]*)\)" > > "\s*" > > "(?:(?:(?P\".+),)?\s*(?P\".+))?" >=20 > The previous implementation allowed multiple properties. Maybe this shoul= d be > instead (which still allows multiple properties): >=20 > "((?P[\w\s]+)\s+)?" > "(?P\w+)\s*" > ... Ooops, good point! I will send v2. Stefan --RXc6EO4W1yUvSQ0X Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUIUyUAAoJEJykq7OBq3PIteQH/2iK+0j+r3w2zAurLcG7Y50r zGftsQnuCcCWHIkPzNp17ZRGM3BMLoGZHmxUQNEFQMUYhGfX5t0/01cy/m6QUszx 3XqzX5TwhDhzhglHtcEMZw32TG2tvew2tQjLy8l+eY8z9imJ/odXoxoDUA5ZSCuS XmSu0P8iTWd1nVwi/l38cbjl9hrp44F/fwUkpliQK0cINyzAms62KKcHxQiWUFYH v3JrBfuJJ3ZOnItx+TjvqkbtOVkTzhHAbjNyc8BXDNWJOeTjv3Q+CKNpOvmXYiyL DgcHKDG8NRaKYYPq1NY0AMLSYxM46Zxxes4wqO9a3P+UGv97WW0SsoESGH4i4R8= =4wy9 -----END PGP SIGNATURE----- --RXc6EO4W1yUvSQ0X--