Received: from eggs.gnu.org ([2001:4830:134:3::10]:44231) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WHerU-0001p0-BL for qemu-devel@nongnu.org; Sun, 23 Feb 2014 14:37:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WHerN-0005rg-Hy for qemu-devel@nongnu.org; Sun, 23 Feb 2014 14:37:16 -0500 Received: from roura.ac.upc.es ([147.83.33.10]:55364) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WHerN-0005rW-4v for qemu-devel@nongnu.org; Sun, 23 Feb 2014 14:37:09 -0500 From: =?utf-8?b?TGx1w61z?= Vilanova Date: Sun, 23 Feb 2014 20:37:08 +0100 Message-Id: <20140223193707.28465.16624.stgit@fimbulvetr.bsc.es> In-Reply-To: <20140223193656.28465.12158.stgit@fimbulvetr.bsc.es> References: <20140223193656.28465.12158.stgit@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 2/8] 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: Stefan Hajnoczi Signed-off-by: Llu=C3=ADs Vilanova --- 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.