summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLluís Vilanova <vilanova@ac.upc.edu>2016-02-25 14:06:30 +0100
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:49:12 -0600
commit69175169c10494a813ea0c266e0268fcc0cc0e64 (patch)
tree1eab67a5b5b79b89830ca5f285ce775703575685 /scripts
parent5c824303d89c7dbae646dcda060d30379fd87898 (diff)
downloadhqemu-69175169c10494a813ea0c266e0268fcc0cc0e64.zip
hqemu-69175169c10494a813ea0c266e0268fcc0cc0e64.tar.gz
trace: Add a proper API to manage auto-generated events from the 'tcg' property
Formalizes the existence of the 'event_trans' and 'event_exec' event attributes, which until now were monkey-patched only when necessary. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Message-id: 145640558759.20978.6374959404425591089.stgit@localhost Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/tracetool/__init__.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index 23caba0..be24039 100644
--- a/scripts/tracetool/__init__.py
+++ b/scripts/tracetool/__init__.py
@@ -163,7 +163,8 @@ class Event(object):
_VALID_PROPS = set(["disable", "tcg", "tcg-trans", "tcg-exec", "vcpu"])
- def __init__(self, name, props, fmt, args, orig=None):
+ def __init__(self, name, props, fmt, args, orig=None,
+ event_trans=None, event_exec=None):
"""
Parameters
----------
@@ -176,13 +177,19 @@ class Event(object):
args : Arguments
Event arguments.
orig : Event or None
- Original Event before transformation.
+ Original Event before transformation/generation.
+ event_trans : Event or None
+ Generated translation-time event ("tcg" property).
+ event_exec : Event or None
+ Generated execution-time event ("tcg" property).
"""
self.name = name
self.properties = props
self.fmt = fmt
self.args = args
+ self.event_trans = event_trans
+ self.event_exec = event_exec
if orig is None:
self.original = weakref.ref(self)
@@ -198,7 +205,7 @@ class Event(object):
def copy(self):
"""Create a new copy."""
return Event(self.name, list(self.properties), self.fmt,
- self.args.copy(), self)
+ self.args.copy(), self, self.event_trans, self.event_exec)
@staticmethod
def build(line_str):
OpenPOWER on IntegriCloud