From patchwork Mon Jun 9 13:45:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 357471 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0596A140078 for ; Mon, 9 Jun 2014 23:50:14 +1000 (EST) Received: from localhost ([::1]:33126 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wtzxj-0004pJ-TR for incoming@patchwork.ozlabs.org; Mon, 09 Jun 2014 09:50:11 -0400 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 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s59DjYDP023151 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 9 Jun 2014 09:45:34 -0400 Received: from localhost (ovpn-112-36.ams2.redhat.com [10.36.112.36]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s59DjXfq029262; Mon, 9 Jun 2014 09:45:34 -0400 From: Stefan Hajnoczi To: 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 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id s59DjYDP023151 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell , =?UTF-8?q?Llu=C3=ADs=20Vilanova?= , Stefan Hajnoczi Subject: [Qemu-devel] [PULL 2/9] trace: [tracetool] Add methods 'Event.copy' and 'Arguments.copy' X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Lluís Vilanova Signed-off-by: Lluís 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__.py index 305b99e..bfe44bd 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -52,6 +52,10 @@ class Arguments: """ self._args = args + 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(unknown_props)) + 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.