From: Jiri Olsa Date: Mon, 11 Aug 2014 08:50:05 +0000 (+0200) Subject: perf top: Join the display thread on exit X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ae256fa27118e54b0f093f0cfe2ada28f1704ef3;p=linux-beck.git perf top: Join the display thread on exit We create the display thread, but never join it. It gives the display thread a chance to quit and cleanup properly. Signed-off-by: Jiri Olsa Cc: Adrian Hunter Cc: Corey Ashford Cc: David Ahern Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: Jean Pihet Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1407747014-18394-12-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 4fb6f726271c..10fc7e844872 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -965,7 +965,7 @@ static int __cmd_top(struct perf_top *top) param.sched_priority = top->realtime_prio; if (sched_setscheduler(0, SCHED_FIFO, ¶m)) { ui__error("Could not set realtime priority.\n"); - goto out_delete; + goto out_join; } } @@ -979,6 +979,8 @@ static int __cmd_top(struct perf_top *top) } ret = 0; +out_join: + pthread_join(thread, NULL); out_delete: perf_session__delete(top->session); top->session = NULL;