diff options
author | Jiri Olsa <jolsa@kernel.org> | 2014-08-11 04:50:05 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-08-13 10:14:21 -0400 |
commit | ae256fa27118e54b0f093f0cfe2ada28f1704ef3 (patch) | |
tree | 55497b0eca8235382697c788cad80c12c0b92a93 | |
parent | e0336ed66f5dd974e02b1af4a81bb567a2391e45 (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 <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jean Pihet <jean.pihet@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1407747014-18394-12-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/builtin-top.c | 4 |
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) | |||
965 | param.sched_priority = top->realtime_prio; | 965 | param.sched_priority = top->realtime_prio; |
966 | if (sched_setscheduler(0, SCHED_FIFO, ¶m)) { | 966 | if (sched_setscheduler(0, SCHED_FIFO, ¶m)) { |
967 | ui__error("Could not set realtime priority.\n"); | 967 | ui__error("Could not set realtime priority.\n"); |
968 | goto out_delete; | 968 | goto out_join; |
969 | } | 969 | } |
970 | } | 970 | } |
971 | 971 | ||
@@ -979,6 +979,8 @@ static int __cmd_top(struct perf_top *top) | |||
979 | } | 979 | } |
980 | 980 | ||
981 | ret = 0; | 981 | ret = 0; |
982 | out_join: | ||
983 | pthread_join(thread, NULL); | ||
982 | out_delete: | 984 | out_delete: |
983 | perf_session__delete(top->session); | 985 | perf_session__delete(top->session); |
984 | top->session = NULL; | 986 | top->session = NULL; |