Skip to content

Commit 42145d7

Browse files
changbinduacmel
authored andcommitted
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 <[email protected]> Acked-by: Namhyung Kim <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Steven Rostedt (VMware) <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 6555c2f commit 42145d7

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

tools/perf/Documentation/perf-ftrace.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ OPTIONS
3939
--pid=::
4040
Trace on existing process id (comma separated list).
4141

42+
--tid=::
43+
Trace on existing thread id (comma separated list).
44+
4245
-D::
4346
--delay::
4447
Time (ms) to wait before starting tracing after program start.

tools/perf/builtin-ftrace.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,9 @@ int cmd_ftrace(int argc, const char **argv)
812812
"Show available functions to filter"),
813813
OPT_STRING('p', "pid", &ftrace.target.pid, "pid",
814814
"trace on existing process id"),
815+
/* TODO: Add short option -t after -t/--tracer can be removed. */
816+
OPT_STRING(0, "tid", &ftrace.target.tid, "tid",
817+
"trace on existing thread id (exclusive to --pid)"),
815818
OPT_INCR('v', "verbose", &verbose,
816819
"be more verbose"),
817820
OPT_BOOLEAN('a', "all-cpus", &ftrace.target.system_wide,

0 commit comments

Comments
 (0)