Browse Source

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>
Jiri Olsa 11 years ago
parent
commit
ae256fa271
1 changed files with 3 additions and 1 deletions
  1. 3 1
      tools/perf/builtin-top.c

+ 3 - 1
tools/perf/builtin-top.c

@@ -965,7 +965,7 @@ static int __cmd_top(struct perf_top *top)
 		param.sched_priority = top->realtime_prio;
 		param.sched_priority = top->realtime_prio;
 		if (sched_setscheduler(0, SCHED_FIFO, &param)) {
 		if (sched_setscheduler(0, SCHED_FIFO, &param)) {
 			ui__error("Could not set realtime priority.\n");
 			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;
 	ret = 0;
+out_join:
+	pthread_join(thread, NULL);
 out_delete:
 out_delete:
 	perf_session__delete(top->session);
 	perf_session__delete(top->session);
 	top->session = NULL;
 	top->session = NULL;