This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH tracing/kprobes v3 3/7] tracing/kprobes: Rename special variables
- From: Frederic Weisbecker <fweisbec at gmail dot com>
- To: Masami Hiramatsu <mhiramat at redhat dot com>
- Cc: Steven Rostedt <rostedt at goodmis dot org>, 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: Mon, 12 Oct 2009 23:28:26 +0200
- Subject: Re: [PATCH tracing/kprobes v3 3/7] tracing/kprobes: Rename special variables
- References: <20091007222733.1684.32035.stgit@dhcp-100-2-132.bos.redhat.com> <20091007222759.1684.3319.stgit@dhcp-100-2-132.bos.redhat.com> <4AD39D89.6070609@redhat.com>
On Mon, Oct 12, 2009 at 05:20:09PM -0400, Masami Hiramatsu wrote:
> Masami Hiramatsu wrote:
>> @@ -427,28 +427,17 @@ static int parse_probe_vars(char *arg, struct fetch_func *ff, int is_return)
>> int ret = 0;
>> unsigned long param;
>>
>> - switch (arg[0]) {
>> - case 'a': /* argument */
>> - ret = strict_strtoul(arg + 1, 10,¶m);
>> - if (ret || param> PARAM_MAX_ARGS)
>> - ret = -EINVAL;
>> - else {
>> - ff->func = fetch_argument;
>> - ff->data = (void *)param;
>> - }
>> - break;
>> - case 'r': /* retval or retaddr */
>> - if (is_return&& arg[1] == 'v') {
>> + if (strcmp(arg, "retval") == 0) {
>> + if (is_return) {
>> ff->func = fetch_retvalue;
>> ff->data = NULL;
>> } else
>> ret = -EINVAL;
>> - break;
>> - case 's': /* stack */
>> - if (arg[1] == 'a') {
>> + } else if (strncmp(arg, "stack", 5) == 0) {
>> + if (arg[5] == '\0') {
>> ff->func = fetch_stack_address;
>> ff->data = NULL;
>> - } else {
>> + } else if (isdigit(arg[5])) {
>> ret = strict_strtoul(arg + 1, 10,¶m);
> ^^^^^^^ this should be arg + 5.
>
>> @@ -456,11 +445,18 @@ static int parse_probe_vars(char *arg, struct fetch_func *ff, int is_return)
>> ff->func = fetch_stack;
>> ff->data = (void *)param;
>> }
>> + } else
>> + ret = -EINVAL;
>> + } else if (strncmp(arg, "arg", 3) == 0&& isdigit(arg[4])) {
And this should be isdigit(arg[3]) actually, what you want to test is the
first character after arg, right?
>> + ret = strict_strtoul(arg + 1, 10,¶m);
> ^^^^^^^ here too, arg + 3.