perf record: Use evlist__new_default when no events specified

Rather than distributing the code doing similar things to
evlist__new_default, use the one implementation so that paranoia and
wildcard scanning can be optimized.

Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: James Clark <james.clark@linaro.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
Ian Rogers 2025-10-05 11:24:20 -07:00 committed by Namhyung Kim
parent b1c5efbfd9
commit 3d3056a105

View file

@ -4341,9 +4341,13 @@ int cmd_record(int argc, const char **argv)
record.opts.tail_synthesize = true;
if (rec->evlist->core.nr_entries == 0) {
err = parse_event(rec->evlist, "cycles:P");
if (err)
struct evlist *def_evlist = evlist__new_default();
if (!def_evlist)
goto out;
evlist__splice_list_tail(rec->evlist, &def_evlist->core.entries);
evlist__delete(def_evlist);
}
if (rec->opts.target.tid && !rec->opts.no_inherit_set)