aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/event.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-07-30 17:31:28 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-07-30 17:31:28 -0400
commitd65a458b348cd458413b3cfec66e43ebd0367646 (patch)
tree984d730e5a81e4ae7c04b9f664d8a1cacdd0c6e6 /tools/perf/util/event.c
parent591765fdaf7ea1888157f342b67b0461f2e5ed9b (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/util/event.c')
-rw-r--r--tools/perf/util/event.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 8151d23664c7..6b0db5577929 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -515,12 +515,13 @@ int event__process_mmap(event_t *self, struct perf_session *session)
515 if (machine == NULL) 515 if (machine == NULL)
516 goto out_problem; 516 goto out_problem;
517 thread = perf_session__findnew(session, self->mmap.pid); 517 thread = perf_session__findnew(session, self->mmap.pid);
518 if (thread == NULL)
519 goto out_problem;
518 map = map__new(&machine->user_dsos, self->mmap.start, 520 map = map__new(&machine->user_dsos, self->mmap.start,
519 self->mmap.len, self->mmap.pgoff, 521 self->mmap.len, self->mmap.pgoff,
520 self->mmap.pid, self->mmap.filename, 522 self->mmap.pid, self->mmap.filename,
521 MAP__FUNCTION); 523 MAP__FUNCTION);
522 524 if (map == NULL)
523 if (thread == NULL || map == NULL)
524 goto out_problem; 525 goto out_problem;
525 526
526 thread__insert_map(thread, map); 527 thread__insert_map(thread, map);