diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-07-30 17:31:28 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-07-30 17:31:28 -0400 |
commit | d65a458b348cd458413b3cfec66e43ebd0367646 (patch) | |
tree | 984d730e5a81e4ae7c04b9f664d8a1cacdd0c6e6 /tools/perf/builtin-record.c | |
parent | 591765fdaf7ea1888157f342b67b0461f2e5ed9b (diff) |
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 <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r-- | tools/perf/builtin-record.c | 5 |
1 files changed, 4 insertions, 1 deletions
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) | |||
440 | process_buildids(); | 440 | process_buildids(); |
441 | perf_header__write(&session->header, output, true); | 441 | perf_header__write(&session->header, output, true); |
442 | perf_session__delete(session); | 442 | perf_session__delete(session); |
443 | symbol__exit(); | ||
443 | } | 444 | } |
444 | } | 445 | } |
445 | 446 | ||
@@ -871,7 +872,7 @@ int cmd_record(int argc, const char **argv, const char *prefix __used) | |||
871 | } else { | 872 | } else { |
872 | all_tids=malloc(sizeof(pid_t)); | 873 | all_tids=malloc(sizeof(pid_t)); |
873 | if (!all_tids) | 874 | if (!all_tids) |
874 | return -ENOMEM; | 875 | goto out_symbol_exit; |
875 | 876 | ||
876 | all_tids[0] = target_tid; | 877 | all_tids[0] = target_tid; |
877 | thread_num = 1; | 878 | thread_num = 1; |
@@ -918,5 +919,7 @@ out_free_fd: | |||
918 | } | 919 | } |
919 | free(all_tids); | 920 | free(all_tids); |
920 | all_tids = NULL; | 921 | all_tids = NULL; |
922 | out_symbol_exit: | ||
923 | symbol__exit(); | ||
921 | return err; | 924 | return err; |
922 | } | 925 | } |