perf stat: Move target check to loop control statement

Check for target existence in loop control statement jointly external
asynchronous 'done' signal.

Signed-off-by: Alexey Budankov <alexey.budankov@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/79037528-578c-af64-f06c-a644b7f5ba6a@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Alexey Budankov 2020-07-17 10:02:42 +03:00 committed by Arnaldo Carvalho de Melo
parent dece3a4d33
commit 7bb4ff05c0
1 changed files with 1 additions and 3 deletions

View File

@ -815,10 +815,8 @@ try_again_reset:
psignal(WTERMSIG(status), argv[0]); psignal(WTERMSIG(status), argv[0]);
} else { } else {
enable_counters(); enable_counters();
while (!done) { while (!done && is_target_alive(&target, evsel_list->core.threads)) {
nanosleep(&ts, NULL); nanosleep(&ts, NULL);
if (!is_target_alive(&target, evsel_list->core.threads))
break;
if (timeout || handle_interval(interval, &times)) if (timeout || handle_interval(interval, &times))
break; break;
} }