* [Qemu-devel] [PATCH trace] Avoid all systemtap reserved words
@ 2012-11-02 12:00 Daniel P. Berrange
2012-11-05 7:43 ` Stefan Hajnoczi
0 siblings, 1 reply; 2+ messages in thread
From: Daniel P. Berrange @ 2012-11-02 12:00 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Hajnoczi
From: "Daniel P. Berrange" <berrange@redhat.com>
Over time various systemtap reserved words have been blacklisted
in the trace backend generator. The list is not complete though,
so there is continued risk of problems in the future. Preempt
such problems by specifying the full list of systemtap keywords
listed in its parser as identified here:
http://sourceware.org/ml/systemtap/2012-q4/msg00157.html
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
scripts/tracetool/backend/dtrace.py | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/scripts/tracetool/backend/dtrace.py b/scripts/tracetool/backend/dtrace.py
index 6be7047..23c43e2 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
--
1.7.11.7
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH trace] Avoid all systemtap reserved words
2012-11-02 12:00 [Qemu-devel] [PATCH trace] Avoid all systemtap reserved words Daniel P. Berrange
@ 2012-11-05 7:43 ` Stefan Hajnoczi
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2012-11-05 7:43 UTC (permalink / raw)
To: Daniel P. Berrange; +Cc: qemu-devel, Stefan Hajnoczi
On Fri, Nov 02, 2012 at 12:00:53PM +0000, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@redhat.com>
>
> Over time various systemtap reserved words have been blacklisted
> in the trace backend generator. The list is not complete though,
> so there is continued risk of problems in the future. Preempt
> such problems by specifying the full list of systemtap keywords
> listed in its parser as identified here:
>
> http://sourceware.org/ml/systemtap/2012-q4/msg00157.html
>
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
> scripts/tracetool/backend/dtrace.py | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
Thanks, applied to the tracing tree:
https://github.com/stefanha/qemu/commits/tracing
Stefan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-05 7:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-02 12:00 [Qemu-devel] [PATCH trace] Avoid all systemtap reserved words Daniel P. Berrange
2012-11-05 7:43 ` Stefan Hajnoczi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).