perf evsel: Delete the event selectors at exit
Freeing all the possibly allocated resources, reducing complexity on each tool exit path. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@ -982,3 +982,14 @@ int perf_evsel_list__create_default(void)
|
||||
++nr_counters;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void perf_evsel_list__delete(void)
|
||||
{
|
||||
struct perf_evsel *pos, *n;
|
||||
|
||||
list_for_each_entry_safe(pos, n, &evsel_list, node) {
|
||||
list_del_init(&pos->node);
|
||||
perf_evsel__delete(pos);
|
||||
}
|
||||
nr_counters = 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user