diff options
| -rw-r--r-- | tools/perf/builtin-top.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 9ebd67a42ede..4e913d852518 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
| @@ -1231,6 +1231,12 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) | |||
| 1231 | if (argc) | 1231 | if (argc) |
| 1232 | usage_with_options(top_usage, options); | 1232 | usage_with_options(top_usage, options); |
| 1233 | 1233 | ||
| 1234 | if (!top.evlist->nr_entries && | ||
| 1235 | perf_evlist__add_default(top.evlist) < 0) { | ||
| 1236 | pr_err("Not enough memory for event selector list\n"); | ||
| 1237 | goto out_delete_evlist; | ||
| 1238 | } | ||
| 1239 | |||
| 1234 | sort__mode = SORT_MODE__TOP; | 1240 | sort__mode = SORT_MODE__TOP; |
| 1235 | /* display thread wants entries to be collapsed in a different tree */ | 1241 | /* display thread wants entries to be collapsed in a different tree */ |
| 1236 | sort__need_collapse = 1; | 1242 | sort__need_collapse = 1; |
| @@ -1277,12 +1283,6 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) | |||
| 1277 | goto out_delete_evlist; | 1283 | goto out_delete_evlist; |
| 1278 | } | 1284 | } |
| 1279 | 1285 | ||
| 1280 | if (!top.evlist->nr_entries && | ||
| 1281 | perf_evlist__add_default(top.evlist) < 0) { | ||
| 1282 | ui__error("Not enough memory for event selector list\n"); | ||
| 1283 | goto out_delete_evlist; | ||
| 1284 | } | ||
| 1285 | |||
| 1286 | symbol_conf.nr_events = top.evlist->nr_entries; | 1286 | symbol_conf.nr_events = top.evlist->nr_entries; |
| 1287 | 1287 | ||
| 1288 | if (top.delay_secs < 1) | 1288 | if (top.delay_secs < 1) |
