From d65a458b348cd458413b3cfec66e43ebd0367646 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Fri, 30 Jul 2010 18:31:28 -0300 Subject: perf tools: Release session and symbol resources on exit So that we reduce the noise when looking for leaks using tools such as valgrind. Cc: Frederic Weisbecker Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Stephane Eranian LKML-Reference: Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-record.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools/perf/builtin-record.c') diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 5ae0d93d8597..ff77b805de71 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -440,6 +440,7 @@ static void atexit_header(void) process_buildids(); perf_header__write(&session->header, output, true); perf_session__delete(session); + symbol__exit(); } } @@ -871,7 +872,7 @@ int cmd_record(int argc, const char **argv, const char *prefix __used) } else { all_tids=malloc(sizeof(pid_t)); if (!all_tids) - return -ENOMEM; + goto out_symbol_exit; all_tids[0] = target_tid; thread_num = 1; @@ -918,5 +919,7 @@ out_free_fd: } free(all_tids); all_tids = NULL; +out_symbol_exit: + symbol__exit(); return err; } -- cgit v1.2.3-59-g8ed1b