From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WtztR-0006pL-D7 for qemu-devel@nongnu.org; Mon, 09 Jun 2014 09:45:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WtztK-00044P-U6 for qemu-devel@nongnu.org; Mon, 09 Jun 2014 09:45:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3412) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WtztK-00044B-Ee for qemu-devel@nongnu.org; Mon, 09 Jun 2014 09:45:38 -0400 From: Stefan Hajnoczi Date: Mon, 9 Jun 2014 15:45:12 +0200 Message-Id: <1402321522-18408-5-git-send-email-stefanha@redhat.com> In-Reply-To: <1402321522-18408-1-git-send-email-stefanha@redhat.com> References: <1402321522-18408-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