perf evlist: Move destruction of maps to evlist destructor
Instead of requiring tools to do an extra destructor call just before calling perf_evlist__delete. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-0jd2ptzyikxb5wp7inzz2ah2@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@@ -1782,14 +1782,14 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused)
|
||||
if (interval && interval < 100) {
|
||||
pr_err("print interval must be >= 100ms\n");
|
||||
parse_options_usage(stat_usage, options, "I", 1);
|
||||
goto out_free_maps;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (perf_evlist__alloc_stats(evsel_list, interval))
|
||||
goto out_free_maps;
|
||||
goto out;
|
||||
|
||||
if (perf_stat_init_aggr_mode())
|
||||
goto out_free_maps;
|
||||
goto out;
|
||||
|
||||
/*
|
||||
* We dont want to block the signals - that would cause
|
||||
@@ -1821,8 +1821,6 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused)
|
||||
print_stat(argc, argv);
|
||||
|
||||
perf_evlist__free_stats(evsel_list);
|
||||
out_free_maps:
|
||||
perf_evlist__delete_maps(evsel_list);
|
||||
out:
|
||||
perf_evlist__delete(evsel_list);
|
||||
return status;
|
||||
|
Reference in New Issue
Block a user