Re: [PATCH tracing/kprobes v2 1/5] tracing/kprobes: Rename specialvariables syntax

From: Masami Hiramatsu
Date: Tue Oct 06 2009 - 10:23:36 EST


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.
>
> Just my 0.02€

OK, so here are syntax ideas

* current syntax
<Ftrace>
- $sp_var
- %regs
- @symbol
<Perf>
- local_var

* $local syntax
<Ftrace>
- sp_var
- %regs
- @symbol
<Perf>
- $local_var

* non $ syntax 1
<Ftrace>
- %sp_var
- %regs
- @symbol
<Perf>
- local_var

* non $ syntax 2
<Ftrace>
- %%sp_var or %@sp_var
- %regs
- @symbol
<Perf>
- local_var

So, which one do you like to use? :-)

Thank you,

--
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division

e-mail: mhiramat@xxxxxxxxxx

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/