Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf diff: Support --pid/--tid filter options

Using the existing symbol_conf.pid_list_str and symbol_conf.tid_list_str
logic.

For example:

perf diff --tid 13965

It'll only diff the samples for thread 13965.

Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jin Yao <yao.jin@intel.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1551791143-10334-4-git-send-email-yao.jin@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Jin Yao and committed by
Arnaldo Carvalho de Melo
c1d3e633 daca23b2

+10
+6
tools/perf/Documentation/perf-diff.txt
··· 168 168 CPUs are specified with -: 0-2. Default is to report samples on all 169 169 CPUs. 170 170 171 + --pid=:: 172 + Only diff samples for given process ID (comma separated list). 173 + 174 + --tid=:: 175 + Only diff samples for given thread ID (comma separated list). 176 + 171 177 COMPARISON 172 178 ---------- 173 179 The comparison is governed by the baseline file. The baseline perf.data
+4
tools/perf/builtin-diff.c
··· 985 985 OPT_STRING(0, "time", &pdiff.time_str, "str", 986 986 "Time span (time percent or absolute timestamp)"), 987 987 OPT_STRING(0, "cpu", &cpu_list, "cpu", "list of cpus to profile"), 988 + OPT_STRING(0, "pid", &symbol_conf.pid_list_str, "pid[,pid...]", 989 + "only consider symbols in these pids"), 990 + OPT_STRING(0, "tid", &symbol_conf.tid_list_str, "tid[,tid...]", 991 + "only consider symbols in these tids"), 988 992 OPT_END() 989 993 }; 990 994