lkml.org 
[lkml]   [2009]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [PATCH tracing/kprobes v3 3/7] tracing/kprobes: Rename special variables
    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,&param);
    > - 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,&param);
    ^^^^^^^ 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])) {
    > + ret = strict_strtoul(arg + 1, 10,&param);
    ^^^^^^^ here too, arg + 3.

    Thank you,

    --
    Masami Hiramatsu

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

    e-mail: mhiramat@redhat.com



    \
     
     \ /
      Last update: 2009-10-12 23:23    [W:4.113 / U:0.472 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site