Received: from eggs.gnu.org ([2001:4830:134:3::10]:60260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYvct-0007z6-6l for qemu-devel@nongnu.org; Thu, 25 Feb 2016 08:06:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYvcn-0001cH-HA for qemu-devel@nongnu.org; Thu, 25 Feb 2016 08:06:39 -0500 Received: from roura.ac.upc.edu ([147.83.33.10]:44289 helo=roura.ac.upc.es) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYvcn-0001c7-4z for qemu-devel@nongnu.org; Thu, 25 Feb 2016 08:06:33 -0500 From: =?utf-8?b?TGx1w61z?= Vilanova Date: Thu, 25 Feb 2016 14:06:30 +0100 Message-Id: <145640558759.20978.6374959404425591089.stgit@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] [trivial] trace: Add a proper API to manage auto-generated events from the 'tcg' property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi Formalizes the existence of the 'event_trans' and 'event_exec' event attributes, which until now were monkey-patched only when necessary. Signed-off-by: Llu=C3=ADs Vilanova --- scripts/tracetool/__init__.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.p= y index 23caba0..be24039 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -163,7 +163,8 @@ class Event(object): =20 _VALID_PROPS =3D set(["disable", "tcg", "tcg-trans", "tcg-exec", "vc= pu"]) =20 - def __init__(self, name, props, fmt, args, orig=3DNone): + def __init__(self, name, props, fmt, args, orig=3DNone, + event_trans=3DNone, event_exec=3DNone): """ Parameters ---------- @@ -176,13 +177,19 @@ class Event(object): args : Arguments Event arguments. orig : Event or None - Original Event before transformation. + Original Event before transformation/generation. + event_trans : Event or None + Generated translation-time event ("tcg" property). + event_exec : Event or None + Generated execution-time event ("tcg" property). =20 """ self.name =3D name self.properties =3D props self.fmt =3D fmt self.args =3D args + self.event_trans =3D event_trans + self.event_exec =3D event_exec =20 if orig is None: self.original =3D weakref.ref(self) @@ -198,7 +205,7 @@ class Event(object): def copy(self): """Create a new copy.""" return Event(self.name, list(self.properties), self.fmt, - self.args.copy(), self) + self.args.copy(), self, self.event_trans, self.even= t_exec) =20 @staticmethod def build(line_str):