Received: from eggs.gnu.org ([140.186.70.92]:52078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rvoym-0004Ee-5T for qemu-devel@nongnu.org; Fri, 10 Feb 2012 06:49:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rvoyk-0001eX-Pd for qemu-devel@nongnu.org; Fri, 10 Feb 2012 06:49:28 -0500 Received: from gw.ac.upc.edu ([147.83.30.3]:55450) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rvoyk-0001eM-5b for qemu-devel@nongnu.org; Fri, 10 Feb 2012 06:49:26 -0500 From: =?utf-8?b?TGx1w61z?= Vilanova Date: Fri, 10 Feb 2012 12:49:17 +0100 Message-ID: <20120210114917.5104.36728.stgit@ginnungagap.bsc.es> In-Reply-To: <20120210114849.5104.63589.stgit@ginnungagap.bsc.es> References: <20120210114849.5104.63589.stgit@ginnungagap.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v3 05/11] trace: [tracetool] Add support for event properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: stefanha@gmail.com, harsh@linux.vnet.ibm.com Signed-off-by: Llu=C3=ADs Vilanova --- scripts/tracetool.py | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/scripts/tracetool.py b/scripts/tracetool.py index 67a2f23..e35eb68 100755 --- a/scripts/tracetool.py +++ b/scripts/tracetool.py @@ -472,7 +472,9 @@ trace_gen =3D { =20 # A trace event import re -cre =3D re.compile("(?P[^(\s]+)\((?P[^)]*)\)\s*(?P\".*)= ?") +cre =3D re.compile("((?P.*)\s+)?(?P[^(\s]+)\((?P[^)]*= )\)\s*(?P\".*)?") + +VALID_PROPS =3D set(["disable"]) =20 class Event(object): def __init__(self, line): @@ -491,6 +493,10 @@ class Event(object): self.argnames =3D get_argnames(self.args) self.sizestr =3D calc_sizeofargs(self.args, self.argc) self.fmt =3D groups["fmt"] + self.properties =3D groups["props"].split() + unknown_props =3D set(self.properties) - VALID_PROPS + if len(unknown_props) > 0: + raise ValueError("Unknown properties: %s" % ", ".join(unknow= n_props)) =20 # Generator that yields Event objects given a trace-events file object def read_events(fobj):