[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/8] trace: [tracetool] Add methods 'Event.copy' and
From: |
Lluís Vilanova |
Subject: |
[Qemu-devel] [PATCH 2/8] trace: [tracetool] Add methods 'Event.copy' and 'Arguments.copy' |
Date: |
Sun, 23 Feb 2014 20:37:08 +0100 |
User-agent: |
StGit/0.16 |
Signed-off-by: Lluís Vilanova <address@hidden>
---
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.
- [Qemu-devel] [PATCH 0/8] Tracetool cleanup, Lluís Vilanova, 2014/02/23
- [Qemu-devel] [PATCH 1/8] trace: [tracetool] Add method 'Event.api' to build event names, Lluís Vilanova, 2014/02/23
- [Qemu-devel] [PATCH 2/8] trace: [tracetool] Add methods 'Event.copy' and 'Arguments.copy',
Lluís Vilanova <=
- [Qemu-devel] [PATCH 3/8] trace: [tracetool] Spacing changes, Lluís Vilanova, 2014/02/23
- [Qemu-devel] [PATCH 4/8] trace: [tracetool] Cosmetic changes, Lluís Vilanova, 2014/02/23
- [Qemu-devel] [PATCH 6/8] trace: [tracetool] Change format docs to point to the generated file, Lluís Vilanova, 2014/02/23
- [Qemu-devel] [PATCH 5/8] trace: [tracetool] Show list of frontends and backends sorted by name, Lluís Vilanova, 2014/02/23
- [Qemu-devel] [PATCH 7/8] trace: [simple] Bump up log version number, Lluís Vilanova, 2014/02/23
- [Qemu-devel] [PATCH 8/8] trace: [tracetool] Minimize the amount of per-backend code, Lluís Vilanova, 2014/02/23