aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJiri Olsa <[email protected]>2014-08-11 10:50:05 +0200
committerArnaldo Carvalho de Melo <[email protected]>2014-08-13 11:14:21 -0300
commitae256fa27118e54b0f093f0cfe2ada28f1704ef3 (patch)
tree55497b0eca8235382697c788cad80c12c0b92a93 /tools
parente0336ed66f5dd974e02b1af4a81bb567a2391e45 (diff)
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 <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Corey Ashford <[email protected]> Cc: David Ahern <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jean Pihet <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/builtin-top.c4
1 files changed, 3 insertions, 1 deletions
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, &param)) {
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;