On Tue, Jun 07, 2016 at 05:02:32PM +0900, Masami Hiramatsu wrote:
> On Thu,  2 Jun 2016 18:11:03 -0700
> Omar Sandoval <osan...@osandov.com> wrote:
> 
> > From: Omar Sandoval <osan...@fb.com>
> > 
> > You'd only ever want $comm as a string, but the default is still u64.
> > Push the type parsing later so we can decide based on the actual
> > fetcharg and make "string" the default for $comm.
> 
> Hmm, at this moment, I'd rather like a small hack in 
> traceprobe_parse_probe_arg() as like below:
> 
> --- a/kernel/trace/trace_probe.c
> +++ b/kernel/trace/trace_probe.c
> @@ -522,6 +522,12 @@ int traceprobe_parse_probe_arg(char *arg, ssize_t *size,
>                 arg[t - parg->comm] = '\0';
>                 t++;
>         }
> +       /*
> +        * The default type of "$comm" should be a string, and it must not
> +        * be dereferred
> +        */
> +       if (!t && strcmp("$comm", arg))
> +               t = "string";
>         parg->type = find_fetch_type(t, ftbl);
>         if (!parg->type) {
>                 pr_info("Unsupported type: %s\n", t);
> 
> This is not general, but easy to review :)

+1


Thanks,
Namhyung

Reply via email to