mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
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>
This commit is contained in:
parent
9898370497
commit
7d08f0da90
6 changed files with 27 additions and 17 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue