[PATCH 2/7] perf stat: Remove unused default_null_attrs

From: James Clark
Date: Tue Aug 13 2024 - 09:25:47 EST


All current implementations of arch_evlist__add_default_attrs() do
nothing if nr_attrs is 0. To avoid confusion that it's used, remove it.

It appears that it used to be used as a mechanism to add topdown events,
but this is now done separately.

Signed-off-by: James Clark <james.clark@xxxxxxxxxx>
---
tools/perf/builtin-stat.c | 5 -----
1 file changed, 5 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index a65f58f8783f..cf6a1923811b 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -1930,7 +1930,6 @@ static int add_default_attributes(void)
(PERF_COUNT_HW_CACHE_RESULT_MISS << 16) },
};

- struct perf_event_attr default_null_attrs[] = {};
const char *pmu = parse_events_option_args.pmu_filter ?: "all";

/* Set attrs if no event is selected and !null_run: */
@@ -2072,10 +2071,6 @@ static int add_default_attributes(void)
evlist__splice_list_tail(evsel_list, &metric_evlist->core.entries);
evlist__delete(metric_evlist);
}
-
- /* Platform specific attrs */
- if (evlist__add_default_attrs(evsel_list, default_null_attrs) < 0)
- return -1;
}

/* Detailed events get appended to the event list: */
--
2.34.1