Skip to content

Commit

Permalink
perf sched timehist: Fix use of CPU list with summary option
Browse files Browse the repository at this point in the history
Do not update thread stats or show idle summary unless CPU is in the
list of interest.

Fixes: c30d630 ("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>
  • Loading branch information
David Ahern authored and Arnaldo Carvalho de Melo committed Aug 21, 2020
1 parent 4b04e0d commit a74eaf1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/perf/builtin-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -2584,7 +2584,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;
Expand Down Expand Up @@ -2857,6 +2858,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;
Expand Down

0 comments on commit a74eaf1

Please sign in to comment.