aboutsummaryrefslogtreecommitdiff
path: root/scripts/tracetool/__init__.py
diff options
context:
space:
mode:
authorLluís Vilanova <vilanova@ac.upc.edu>2014-02-23 20:37:02 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2014-05-07 19:07:17 +0200
commit7d08f0da901db4e9a36e17164bc77941cbcd87b7 (patch)
treeff4b2759c0fc021d1dbe13a8f2f581a57f05bad5 /scripts/tracetool/__init__.py
parent9898370497da3f18e0c9555b65c858eabc78ab50 (diff)
trace: [tracetool] Add method 'Event.api' to build event names
Makes it easier to ensure proper naming across the different frontends and backends. 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__.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index 175df08005..305b99e4b9 100644
--- a/scripts/tracetool/__init__.py
+++ b/scripts/tracetool/__init__.py
@@ -6,7 +6,7 @@ Machinery for generating tracing-related intermediate files.
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
-__copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>"
+__copyright__ = "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajnoczi"
@@ -173,6 +173,14 @@ class Event(object):
self.args,
self.fmt)
+ QEMU_TRACE = "trace_%(name)s"
+
+ def api(self, fmt=None):
+ if fmt is None:
+ fmt = Event.QEMU_TRACE
+ return fmt % {"name": self.name}
+
+
def _read_events(fobj):
res = []
for line in fobj: