On Thu, Jul 16, 2020 at 12:36:30PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Sat, Jul 11, 2020 at 08:40:21PM +0800, Changbin Du escreveu:
> > This allows us to trace single thread instead of the whole process.
> > 
> > Signed-off-by: Changbin Du <changbin...@gmail.com>
> > ---
> >  tools/perf/Documentation/perf-ftrace.txt | 4 ++++
> >  tools/perf/builtin-ftrace.c              | 2 ++
> >  2 files changed, 6 insertions(+)
> > 
> > diff --git a/tools/perf/Documentation/perf-ftrace.txt 
> > b/tools/perf/Documentation/perf-ftrace.txt
> > index d79560dea19f..e204bf6d50d8 100644
> > --- a/tools/perf/Documentation/perf-ftrace.txt
> > +++ b/tools/perf/Documentation/perf-ftrace.txt
> > @@ -38,6 +38,10 @@ OPTIONS
> >  --pid=::
> >     Trace on existing process id (comma separated list).
> >  
> > +-t::
> > +--tid=::
> > +   Trace on existing thread id (comma separated list).
> > +
> 
> 
> Humm, I just  tried:
> 
> [root@five ~]# yes > /dev/null &
> [1] 18265
> [root@five ~]# perf ftrace --tid 18265
> ^C[root@five ~]#
> 
> After waiting for a while, nothing, what am I doing wrong?
>
I got it wrong. Currently ftrace only can filter by pid. If the pid is not
the main thread it won't work.

So this patch makes no sense. will drop this.

> - Arnaldo
> 
> 
> >  -a::
> >  --all-cpus::
> >     Force system-wide collection.  Scripts run without a <command>
> > diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c
> > index 244cc8e6bd60..1188b82c6541 100644
> > --- a/tools/perf/builtin-ftrace.c
> > +++ b/tools/perf/builtin-ftrace.c
> > @@ -515,6 +515,8 @@ int cmd_ftrace(int argc, const char **argv)
> >                 "Show available functions to filter"),
> >     OPT_STRING('p', "pid", &ftrace.target.pid, "pid",
> >                "trace on existing process id"),
> > +   OPT_STRING('t', "tid", &ftrace.target.tid, "tid",
> > +              "trace on existing thread id (exclusive to --pid)"),
> >     OPT_INCR('v', "verbose", &verbose,
> >              "be more verbose"),
> >     OPT_BOOLEAN('a', "all-cpus", &ftrace.target.system_wide,
> > -- 
> > 2.25.1
> > 
> 
> -- 
> 
> - Arnaldo

-- 
Cheers,
Changbin Du

Reply via email to