out_free_event_array:
free(event_array);
out_free_fd:
- list_for_each_entry(pos, &evsel_list, node)
- perf_evsel__free_fd(pos);
free(all_tids);
all_tids = NULL;
out_symbol_exit:
if (status != -1)
print_stat(argc, argv);
out_free_fd:
- list_for_each_entry(pos, &evsel_list, node) {
- perf_evsel__free_fd(pos);
+ list_for_each_entry(pos, &evsel_list, node)
perf_evsel__free_stat_priv(pos);
- }
out:
return status;
}
status = __cmd_top();
out_free_fd:
- list_for_each_entry(pos, &evsel_list, node) {
- perf_evsel__free_fd(pos);
+ list_for_each_entry(pos, &evsel_list, node)
perf_evsel__free_mmap(pos);
- }
return status;
}
status = p->fn(argc, argv, prefix);
exit_browser(status);
+ perf_evsel_list__delete();
+
if (status)
return status & 0xff;
++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;
+}
extern struct list_head evsel_list;
int perf_evsel_list__create_default(void);
+void perf_evsel_list__delete(void);
struct option;