diff mbox

[02/12] trace: [tracetool, tcg] Allow TCG types in trace event declarations

Message ID 20140131160914.32741.10373.stgit@fimbulvetr.bsc.es
State New
Headers show

Commit Message

Lluís Vilanova Jan. 31, 2014, 4:09 p.m. UTC
When found, TCG types are translated into the host native types when declaring
and defining the tracing routines not used during TCG code translation (e.g.,
"trace.h").


Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
 scripts/tracetool/__init__.py |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index 175df08..c76f648 100644
--- a/scripts/tracetool/__init__.py
+++ b/scripts/tracetool/__init__.py
@@ -18,6 +18,7 @@  import sys
 
 import tracetool.format
 import tracetool.backend
+import tracetool.transform
 
 
 def error_write(*lines):
@@ -122,7 +123,7 @@  class Event(object):
 
     _CRE = re.compile("((?P<props>.*)\s+)?(?P<name>[^(\s]+)\((?P<args>[^)]*)\)\s*(?P<fmt>\".*)?")
 
-    _VALID_PROPS = set(["disable"])
+    _VALID_PROPS = set(["disable", "tcg"])
 
     def __init__(self, name, props, fmt, args):
         """
@@ -259,6 +260,11 @@  def generate(fevents, format, backend,
 
     events = _read_events(fevents)
 
+    # transform arguments to host type by default
+    # (otherwise use event.original)
+    events = [e.transform(tracetool.transform.TCG_2_HOST(backend))
+              for e in events]
+
     if backend == "nop":
         ( e.properies.add("disable") for e in events )