This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH tracing/kprobes v2 1/5] tracing/kprobes: Rename special variables syntax
- From: Frederic Weisbecker <fweisbec at gmail dot com>
- To: Steven Rostedt <rostedt at goodmis dot org>
- Cc: Masami Hiramatsu <mhiramat at redhat dot com>, Ingo Molnar <mingo at elte dot hu>, lkml <linux-kernel at vger dot kernel dot org>, systemtap <systemtap at sources dot redhat dot com>, DLE <dle-develop at lists dot sourceforge dot net>, Thomas Gleixner <tglx at linutronix dot de>, Arnaldo Carvalho de Melo <acme at redhat dot com>, Mike Galbraith <efault at gmx dot de>, Paul Mackerras <paulus at samba dot org>, Peter Zijlstra <a dot p dot zijlstra at chello dot nl>, Christoph Hellwig <hch at infradead dot org>, Ananth N Mavinakayanahalli <ananth at in dot ibm dot com>, Jim Keniston <jkenisto at us dot ibm dot com>, "Frank Ch. Eigler" <fche at redhat dot com>
- Date: Wed, 7 Oct 2009 00:42:53 +0200
- Subject: Re: [PATCH tracing/kprobes v2 1/5] tracing/kprobes: Rename special variables syntax
- References: <20091002214834.30906.86502.stgit@dhcp-100-2-132.bos.redhat.com> <20091002214842.30906.49220.stgit@dhcp-100-2-132.bos.redhat.com> <20091003015444.GE4828@nowhere> <4AC830F0.2010003@redhat.com> <4ACA25D5.10703@redhat.com> <20091005192609.GB6071@nowhere> <1254787973.13160.195.camel@gandalf.stny.rr.com>
On Mon, Oct 05, 2009 at 08:12:53PM -0400, Steven Rostedt wrote:
> On Mon, 2009-10-05 at 21:26 +0200, Frederic Weisbecker wrote:
> > On Mon, Oct 05, 2009 at 12:59:01PM -0400, Masami Hiramatsu wrote:
> > > As far as I can see in arch/*/include/asm/ptrace.h, all registers start with
> > > alphabets :-). So, I'd like to suggest renaming sp-vars to '_sp-vars'.
> > >
> > > Then, we will have;
> > > - $local-vars
> >
> >
> > There is a risk of bash collision.
>
> I actually prefer the "$" notation. As for bash collision, it is common
> for shell script writers to be able to distinguish a variable from bash.
> Yes we can backslash it, or quote it. But when I see a $var it sticks
> out to me that it is a variable. It's not hard to get around. For
> example, type:
>
> $ echo "hello $DISPLAY"' or $DISPLAY'
>
> and see what you get.
>
> Makefiles and Perl use '$' for variables those that need to handle it
> with bash can easily cope with it.
>
> So my vote is to keep the '$'. It is the most intuitive to what it
> means.
Hrrmm...
I fear about future complains, but I may be somehow biased in
that my usual usecases of bash don't involve '$' characters to
protect, so it's not something I'm used to.
Whatever choice we make, there are either downsides in the prefix
self meaning, the collisions or the shell intrpretation.
Now you are two who prefer that, let's pick this one :)