diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-01-03 13:56:06 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-01-13 08:06:21 -0500 |
commit | 03ad9747c5f2169556467101e96bc390c5aa4b83 (patch) | |
tree | c60f2e8ad184a10ed493de0d6db07d2f03aae130 /tools/perf/builtin-top.c | |
parent | 3e2be2da8f76ef5b2e8e59c3dc8acd24640b4af4 (diff) |
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>
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r-- | tools/perf/builtin-top.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 172e91a9ce62..e0fd0aa57f06 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -1171,7 +1171,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) | |||
1171 | if (!top.evlist->nr_entries && | 1171 | if (!top.evlist->nr_entries && |
1172 | perf_evlist__add_default(top.evlist) < 0) { | 1172 | perf_evlist__add_default(top.evlist) < 0) { |
1173 | ui__error("Not enough memory for event selector list\n"); | 1173 | ui__error("Not enough memory for event selector list\n"); |
1174 | goto out_delete_maps; | 1174 | goto out_delete_evlist; |
1175 | } | 1175 | } |
1176 | 1176 | ||
1177 | symbol_conf.nr_events = top.evlist->nr_entries; | 1177 | symbol_conf.nr_events = top.evlist->nr_entries; |
@@ -1181,7 +1181,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) | |||
1181 | 1181 | ||
1182 | if (record_opts__config(opts)) { | 1182 | if (record_opts__config(opts)) { |
1183 | status = -EINVAL; | 1183 | status = -EINVAL; |
1184 | goto out_delete_maps; | 1184 | goto out_delete_evlist; |
1185 | } | 1185 | } |
1186 | 1186 | ||
1187 | top.sym_evsel = perf_evlist__first(top.evlist); | 1187 | top.sym_evsel = perf_evlist__first(top.evlist); |
@@ -1206,8 +1206,6 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) | |||
1206 | 1206 | ||
1207 | status = __cmd_top(&top); | 1207 | status = __cmd_top(&top); |
1208 | 1208 | ||
1209 | out_delete_maps: | ||
1210 | perf_evlist__delete_maps(top.evlist); | ||
1211 | out_delete_evlist: | 1209 | out_delete_evlist: |
1212 | perf_evlist__delete(top.evlist); | 1210 | perf_evlist__delete(top.evlist); |
1213 | 1211 | ||