From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiLO3-0007GR-De for qemu-devel@nongnu.org; Thu, 08 May 2014 06:17:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WiLNy-0003Yq-Di for qemu-devel@nongnu.org; Thu, 08 May 2014 06:17:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39599) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiLNy-0003Ye-5m for qemu-devel@nongnu.org; Thu, 08 May 2014 06:17:06 -0400 From: Stefan Hajnoczi Date: Wed, 7 May 2014 19:16:39 +0200 Message-Id: <1399483006-17781-3-git-send-email-stefanha@redhat.com> In-Reply-To: <1399483006-17781-1-git-send-email-stefanha@redhat.com> References: <1399483006-17781-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 2/9] trace: [tracetool] Add methods 'Event.copy' and 'Arguments.copy' 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 Signed-off-by: Llu=C3=ADs Vilanova Signed-off-by: Stefan Hajnoczi --- scripts/tracetool/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.p= y index 305b99e..bfe44bd 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -52,6 +52,10 @@ class Arguments: """ self._args =3D args =20 + def copy(self): + """Create a new copy.""" + return Arguments(list(self._args)) + @staticmethod def build(arg_str): """Build and Arguments instance from an argument string. @@ -146,6 +150,11 @@ class Event(object): if len(unknown_props) > 0: raise ValueError("Unknown properties: %s" % ", ".join(unknow= n_props)) =20 + def copy(self): + """Create a new copy.""" + return Event(self.name, list(self.properties), self.fmt, + self.args.copy(), self) + @staticmethod def build(line_str): """Build an Event instance from a string. --=20 1.9.0