Merge branch 'for-5.10/core' into for-linus
[linux-2.6-microblaze.git] / tools / perf / builtin-sched.c
index 0c7d599..e6fc297 100644 (file)
@@ -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;
@@ -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;