diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 80aea49e4dac..87eebf3f55ae 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -815,10 +815,8 @@ try_again_reset: psignal(WTERMSIG(status), argv[0]); } else { enable_counters(); - while (!done) { + while (!done && is_target_alive(&target, evsel_list->core.threads)) { nanosleep(&ts, NULL); - if (!is_target_alive(&target, evsel_list->core.threads)) - break; if (timeout || handle_interval(interval, ×)) break; }