Re: [PATCH v3] tracing: expose current->comm to [ku]probe events
From: Steven Rostedt
Date: Fri Jun 17 2016 - 12:19:39 EST
On Thu, 9 Jun 2016 11:55:34 +0900
Masami Hiramatsu <mhiramat@xxxxxxxxxx> wrote:
> On Wed, 8 Jun 2016 18:38:02 -0700
> Omar Sandoval <osandov@xxxxxxxxxxx> wrote:
>
> > From: Omar Sandoval <osandov@xxxxxx>
> >
> > ftrace is very quick to give up on saving the task command line (see
> > `trace_save_cmdline()`). The workaround for events which really care
> > about the command line is to explicitly assign it as part of the entry.
> > However, this doesn't work for kprobe events, as there's no
> > straightforward way to get access to current->comm. Add a kprobe/uprobe
> > event variable $comm which provides exactly that.
> >
> > Signed-off-by: Omar Sandoval <osandov@xxxxxx>
>
> Looks good to me:)
>
> Acked-by: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
>
> > ---
> > Alexei pointed out to me that this same functionality can be acheived
> > with BPF and the bpf_get_current_comm() helper, so strictly speaking,
> > this patch isn't necessary. It's still convenient for ad-hoc stuff,
> > though, so I figured I'd throw this up and see what everyone thought.
>
> Anyway, I'd like to pull this patch since this still be useful
> in handy way to get comm on ftrace :)
>
I pulled it.
Thanks!
-- Steve