[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 9/9] tracetool: handle DTrace keywords 'in', 'next',
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH 9/9] tracetool: handle DTrace keywords 'in', 'next', 'self' |
Date: |
Wed, 18 Apr 2012 15:07:24 +0100 |
Language keywords cannot be used as argument names. The DTrace backend
appends an underscore to the argument name in order to make the argument
name legal.
This patch adds 'in', 'next', and 'self' keywords to dtrace.py.
Also drop the unnecessary argument name lstrip() call. The
Arguments.build() method already ensures there is no space around
argument names. Furthermore it is misleading to do the lstrip() *after*
checking against keywords because the keyword check would not match if
spaces were in the name.
Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Alon Levy <address@hidden>
Reviewed-by: Lluís Vilanova <address@hidden>
---
scripts/tracetool/backend/dtrace.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/tracetool/backend/dtrace.py
b/scripts/tracetool/backend/dtrace.py
index cebbd57..9cab75c 100644
--- a/scripts/tracetool/backend/dtrace.py
+++ b/scripts/tracetool/backend/dtrace.py
@@ -86,10 +86,10 @@ def stap(events):
i = 1
if len(e.args) > 0:
for name in e.args.names():
- # 'limit' is a reserved keyword
- if name == 'limit':
- name = '_limit'
- out(' %s = $arg%d;' % (name.lstrip(), i))
+ # Append underscore to reserved keywords
+ if name in ('limit', 'in', 'next', 'self'):
+ name += '_'
+ out(' %s = $arg%d;' % (name, i))
i += 1
out('}')
--
1.7.9.5
- [Qemu-devel] [PULL 0/9] Tracing patches, Stefan Hajnoczi, 2012/04/18
- [Qemu-devel] [PATCH 5/9] tracetool: Add support for the 'simple' backend, Stefan Hajnoczi, 2012/04/18
- [Qemu-devel] [PATCH 6/9] tracetool: Add support for the 'ust' backend, Stefan Hajnoczi, 2012/04/18
- [Qemu-devel] [PATCH 9/9] tracetool: handle DTrace keywords 'in', 'next', 'self',
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH 7/9] tracetool: Add support for the 'dtrace' backend, Stefan Hajnoczi, 2012/04/18
- [Qemu-devel] [PATCH 2/9] tracetool: Add module for the 'c' format, Stefan Hajnoczi, 2012/04/18
- [Qemu-devel] [PATCH 8/9] tracetool: Add MAINTAINERS info, Stefan Hajnoczi, 2012/04/18
- [Qemu-devel] [PATCH 1/9] tracetool: Rewrite infrastructure as python modules, Stefan Hajnoczi, 2012/04/18
- [Qemu-devel] [PATCH 4/9] tracetool: Add support for the 'stderr' backend, Stefan Hajnoczi, 2012/04/18
- [Qemu-devel] [PATCH 3/9] tracetool: Add module for the 'h' format, Stefan Hajnoczi, 2012/04/18
- Re: [Qemu-devel] [PULL 0/9] Tracing patches, Andreas Färber, 2012/04/24