From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aamXZ-0007OY-8g for qemu-devel@nongnu.org; Tue, 01 Mar 2016 10:48:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aamXV-0003Bp-AA for qemu-devel@nongnu.org; Tue, 01 Mar 2016 10:48:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43178) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aamXV-0003Bg-5a for qemu-devel@nongnu.org; Tue, 01 Mar 2016 10:48:45 -0500 From: Stefan Hajnoczi Date: Tue, 1 Mar 2016 15:48:14 +0000 Message-Id: <1456847294-13576-14-git-send-email-stefanha@redhat.com> In-Reply-To: <1456847294-13576-1-git-send-email-stefanha@redhat.com> References: <1456847294-13576-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 13/13] 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: Peter Maydell , =?UTF-8?q?Llu=C3=ADs=20Vilanova?= , Stefan Hajnoczi From: Llu=C3=ADs Vilanova 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 Message-id: 145640558759.20978.6374959404425591089.stgit@localhost Signed-off-by: Stefan Hajnoczi --- 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): --=20 2.5.0