diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2012-11-19 08:32:03 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-11-19 08:32:03 -0600 |
commit | c562d15d318e4ad9293032553472da71039a270f (patch) | |
tree | 90f67af2cabd386408bf071e1b44b876f423a857 /scripts/tracetool/backend/dtrace.py | |
parent | 698229eb284ae29dcaae2c686cbf5dcf02f783ad (diff) | |
parent | e94c4c9287392e9c4de5e9cc3a0fa40da959ccb5 (diff) |
Merge remote-tracking branch 'stefanha/tracing' into staging
* stefanha/tracing:
trace: Remove "info trace" from documents
trace: document '-' syntax for disabling events
trace: allow disabling events in events file
Avoid all systemtap reserved words
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'scripts/tracetool/backend/dtrace.py')
-rw-r--r-- | scripts/tracetool/backend/dtrace.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/tracetool/backend/dtrace.py b/scripts/tracetool/backend/dtrace.py index 6be7047018..23c43e2772 100644 --- a/scripts/tracetool/backend/dtrace.py +++ b/scripts/tracetool/backend/dtrace.py @@ -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', 'function'): + if name in RESERVED_WORDS: name += '_' out(' %s = $arg%d;' % (name, i)) i += 1 |