aboutsummaryrefslogtreecommitdiff
path: root/scripts/tracetool/__init__.py
diff options
context:
space:
mode:
authorLluís Vilanova <vilanova@ac.upc.edu>2014-02-23 20:37:08 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2014-05-07 19:07:17 +0200
commitad7443e40af63053a5eb0d44b16379875daa855e (patch)
treef85906f9fcf00829755e350c64d5c5b5c23421b1 /scripts/tracetool/__init__.py
parent7d08f0da901db4e9a36e17164bc77941cbcd87b7 (diff)
trace: [tracetool] Add methods 'Event.copy' and 'Arguments.copy'
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'scripts/tracetool/__init__.py')
-rw-r--r--scripts/tracetool/__init__.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index 305b99e4b9..bfe44bd6be 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.