diff options
author | David Ahern <dsahern@kernel.org> | 2020-08-17 11:09:42 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-09-09 19:14:14 +0200 |
commit | 06a1d6e334b0a36edcc52d8841a71674af6640e6 (patch) | |
tree | 1a63b2d676bd538c6ff7f54553dca6d3bd6ea510 /tools | |
parent | b1c9e29c933e06b54ff2ffce634ba7806cea8a62 (diff) |
perf sched timehist: Fix use of CPU list with summary option
[ Upstream commit a74eaf1605d42391c2357a70e94e5a2c7780fea9 ]
Do not update thread stats or show idle summary unless CPU is in the
list of interest.
Fixes: c30d630d1bcfad8d ("perf sched timehist: Add support for filtering on CPU")
Signed-off-by: David Ahern <dsahern@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Link: http://lore.kernel.org/lkml/20200817170943.1486-1-dsahern@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-sched.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 459e4229945e..7b9511e59b43 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c @@ -2575,7 +2575,8 @@ static int timehist_sched_change_event(struct perf_tool *tool, } if (!sched->idle_hist || thread->tid == 0) { - timehist_update_runtime_stats(tr, t, tprev); + if (!cpu_list || test_bit(sample->cpu, cpu_bitmap)) + timehist_update_runtime_stats(tr, t, tprev); if (sched->idle_hist) { struct idle_thread_runtime *itr = (void *)tr; @@ -2848,6 +2849,9 @@ static void timehist_print_summary(struct perf_sched *sched, printf("\nIdle stats:\n"); for (i = 0; i < idle_max_cpu; ++i) { + if (cpu_list && !test_bit(i, cpu_bitmap)) + continue; + t = idle_threads[i]; if (!t) continue; |