qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 13/13] trace: Rename C++-specific names in event arg


From: Lluís Vilanova
Subject: [Qemu-devel] [PATCH 13/13] trace: Rename C++-specific names in event arguments
Date: Mon, 24 Jul 2017 20:54:54 +0300
User-agent: StGit/0.17.1-dirty

Allows instrumentation clients in C++ to use the auto-generated headers.

Signed-off-by: Lluís Vilanova <address@hidden>
---
 scripts/tracetool/__init__.py |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index 7c19dc8c94..be7f28d2be 100644
--- a/scripts/tracetool/__init__.py
+++ b/scripts/tracetool/__init__.py
@@ -42,6 +42,8 @@ def out(*lines, **kwargs):
     sys.stdout.writelines("\n".join(lines) + "\n")
 
 
+FORBIDDEN = ["new", "class"]
+
 class Arguments:
     """Event arguments description."""
 
@@ -85,6 +87,9 @@ class Arguments:
             else:
                 arg_type, identifier = arg.rsplit(None, 1)
 
+            if identifier in FORBIDDEN:
+                identifier += "_"
+
             res.append((arg_type, identifier))
         return Arguments(res)
 
@@ -230,7 +235,10 @@ class Event(object):
         fmt_trans = groups["fmt_trans"]
         if len(fmt_trans) > 0:
             fmt = [fmt_trans, fmt]
-        args = Arguments.build(groups["args"])
+        try:
+            args = Arguments.build(groups["args"])
+        except ForbiddenArgumentError as e:
+            error("Error: event '%s' uses forbidden argument name '%s'" % 
(name, e.name))
 
         if "tcg-trans" in props:
             raise ValueError("Invalid property 'tcg-trans'")




reply via email to

[Prev in Thread] Current Thread [Next in Thread]