aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/tests/task-exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/tests/task-exit.c')
-rw-r--r--tools/perf/tests/task-exit.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c
index e92fa6029ac7..3986fd162a7e 100644
--- a/tools/perf/tests/task-exit.c
+++ b/tools/perf/tests/task-exit.c
@@ -48,6 +48,7 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused
struct cpu_map *cpus;
struct thread_map *threads;
struct perf_mmap *md;
+ int retry_count = 0;
signal(SIGCHLD, sig_handler);
@@ -105,6 +106,7 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused
if (perf_evlist__mmap(evlist, 128) < 0) {
pr_debug("failed to mmap events: %d (%s)\n", errno,
str_error_r(errno, sbuf, sizeof(sbuf)));
+ err = -1;
goto out_delete_evlist;
}
@@ -126,6 +128,13 @@ retry:
out_init:
if (!exited || !nr_exit) {
perf_evlist__poll(evlist, -1);
+
+ if (retry_count++ > 1000) {
+ pr_debug("Failed after retrying 1000 times\n");
+ err = -1;
+ goto out_free_maps;
+ }
+
goto retry;
}