From 7d08f0da901db4e9a36e17164bc77941cbcd87b7 Mon Sep 17 00:00:00 2001 From: Lluís Vilanova Date: Sun, 23 Feb 2014 20:37:02 +0100 Subject: trace: [tracetool] Add method 'Event.api' to build event names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Makes it easier to ensure proper naming across the different frontends and backends. Signed-off-by: Lluís Vilanova Signed-off-by: Stefan Hajnoczi --- scripts/tracetool/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'scripts/tracetool/__init__.py') 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 " -__copyright__ = "Copyright 2012, Lluís Vilanova " +__copyright__ = "Copyright 2012-2014, Lluís Vilanova " __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: -- cgit 1.4.1