perf ftrace: Add option --tid to filter by thread id

This allows us to trace single thread instead of the whole process.

Signed-off-by: Changbin Du <changbin.du@gmail.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Link: http://lore.kernel.org/lkml/20200808023141.14227-17-changbin.du@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Changbin Du 2020-08-08 10:31:39 +08:00 коммит произвёл Arnaldo Carvalho de Melo
Родитель 6555c2f6db
Коммит 42145d71dd
2 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -39,6 +39,9 @@ OPTIONS
--pid=::
Trace on existing process id (comma separated list).
--tid=::
Trace on existing thread id (comma separated list).
-D::
--delay::
Time (ms) to wait before starting tracing after program start.

Просмотреть файл

@ -812,6 +812,9 @@ 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"),
/* TODO: Add short option -t after -t/--tracer can be removed. */
OPT_STRING(0, "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,