diff options
author | Dr. David Alan Gilbert <linux@treblig.org> | 2025-03-05 02:31:19 +0000 |
---|---|---|
committer | Namhyung Kim <namhyung@kernel.org> | 2025-03-10 11:31:24 -0700 |
commit | e032e7a77583740abf127d069c643a1df40dc9a4 (patch) | |
tree | 68872f24d5d78229318c39818a3f2f1d656dd490 | |
parent | f9864686414f9841730c48f9c0292c8e7874caa4 (diff) |
perf util: Remove unused perf_pmus__default_pmu_name
perf_pmus__default_pmu_name() last use was removed by 2023's
commit e3edd6cf6399 ("perf pmu-events: Reduce processed events by passing
PMU")
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250305023120.155420-6-linux@treblig.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
-rw-r--r-- | tools/perf/util/pmus.c | 29 | ||||
-rw-r--r-- | tools/perf/util/pmus.h | 1 |
2 files changed, 0 insertions, 30 deletions
diff --git a/tools/perf/util/pmus.c b/tools/perf/util/pmus.c index dd7c2ffdab38..9b5a63ecb249 100644 --- a/tools/perf/util/pmus.c +++ b/tools/perf/util/pmus.c @@ -714,35 +714,6 @@ bool perf_pmus__supports_extended_type(void) return perf_pmus__do_support_extended_type; } -char *perf_pmus__default_pmu_name(void) -{ - int fd; - struct io_dir dir; - struct io_dirent64 *dent; - char *result = NULL; - - if (!list_empty(&core_pmus)) - return strdup(list_first_entry(&core_pmus, struct perf_pmu, list)->name); - - fd = perf_pmu__event_source_devices_fd(); - if (fd < 0) - return strdup("cpu"); - - io_dir__init(&dir, fd); - - while ((dent = io_dir__readdir(&dir)) != NULL) { - if (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, "..")) - continue; - if (is_pmu_core(dent->d_name)) { - result = strdup(dent->d_name); - break; - } - } - - close(fd); - return result ?: strdup("cpu"); -} - struct perf_pmu *evsel__find_pmu(const struct evsel *evsel) { struct perf_pmu *pmu = evsel->pmu; diff --git a/tools/perf/util/pmus.h b/tools/perf/util/pmus.h index a0cb0eb2ff97..8def20e615ad 100644 --- a/tools/perf/util/pmus.h +++ b/tools/perf/util/pmus.h @@ -27,7 +27,6 @@ void perf_pmus__print_raw_pmu_events(const struct print_callbacks *print_cb, voi bool perf_pmus__have_event(const char *pname, const char *name); int perf_pmus__num_core_pmus(void); bool perf_pmus__supports_extended_type(void); -char *perf_pmus__default_pmu_name(void); struct perf_pmu *perf_pmus__add_test_pmu(int test_sysfs_dirfd, const char *name); struct perf_pmu *perf_pmus__add_test_hwmon_pmu(int hwmon_dir, |