aboutsummaryrefslogtreecommitdiff
path: root/scripts/tracetool/backend/dtrace.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/tracetool/backend/dtrace.py')
-rw-r--r--scripts/tracetool/backend/dtrace.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/tracetool/backend/dtrace.py b/scripts/tracetool/backend/dtrace.py
index 9cab75cde8..ad5eb3b0ab 100644
--- a/scripts/tracetool/backend/dtrace.py
+++ b/scripts/tracetool/backend/dtrace.py
@@ -37,7 +37,7 @@ def c(events):
def h(events):
- out('#include "trace-dtrace.h"',
+ out('#include "trace/generated-tracers-dtrace.h"',
'')
for e in events:
@@ -73,6 +73,15 @@ def d(events):
'};')
+# Technically 'self' is not used by systemtap yet, but
+# they recommended we keep it in the reserved list anyway
+RESERVED_WORDS = (
+ 'break', 'catch', 'continue', 'delete', 'else', 'for',
+ 'foreach', 'function', 'global', 'if', 'in', 'limit',
+ 'long', 'next', 'probe', 'return', 'self', 'string',
+ 'try', 'while'
+ )
+
def stap(events):
for e in events:
# Define prototype for probe arguments
@@ -87,7 +96,7 @@ def stap(events):
if len(e.args) > 0:
for name in e.args.names():
# Append underscore to reserved keywords
- if name in ('limit', 'in', 'next', 'self'):
+ if name in RESERVED_WORDS:
name += '_'
out(' %s = $arg%d;' % (name, i))
i += 1