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>
This commit is contained in:
Arnaldo Carvalho de Melo
2010-07-30 18:31:28 -03:00
parent 591765fdaf
commit d65a458b34
7 changed files with 70 additions and 3 deletions

View File

@ -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;
}