Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Dr. David Alan Gilbert and committed by
Namhyung Kim
e032e7a7 f9864686

-30
-29
tools/perf/util/pmus.c
··· 714 714 return perf_pmus__do_support_extended_type; 715 715 } 716 716 717 - char *perf_pmus__default_pmu_name(void) 718 - { 719 - int fd; 720 - struct io_dir dir; 721 - struct io_dirent64 *dent; 722 - char *result = NULL; 723 - 724 - if (!list_empty(&core_pmus)) 725 - return strdup(list_first_entry(&core_pmus, struct perf_pmu, list)->name); 726 - 727 - fd = perf_pmu__event_source_devices_fd(); 728 - if (fd < 0) 729 - return strdup("cpu"); 730 - 731 - io_dir__init(&dir, fd); 732 - 733 - while ((dent = io_dir__readdir(&dir)) != NULL) { 734 - if (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, "..")) 735 - continue; 736 - if (is_pmu_core(dent->d_name)) { 737 - result = strdup(dent->d_name); 738 - break; 739 - } 740 - } 741 - 742 - close(fd); 743 - return result ?: strdup("cpu"); 744 - } 745 - 746 717 struct perf_pmu *evsel__find_pmu(const struct evsel *evsel) 747 718 { 748 719 struct perf_pmu *pmu = evsel->pmu;
-1
tools/perf/util/pmus.h
··· 27 27 bool perf_pmus__have_event(const char *pname, const char *name); 28 28 int perf_pmus__num_core_pmus(void); 29 29 bool perf_pmus__supports_extended_type(void); 30 - char *perf_pmus__default_pmu_name(void); 31 30 32 31 struct perf_pmu *perf_pmus__add_test_pmu(int test_sysfs_dirfd, const char *name); 33 32 struct perf_pmu *perf_pmus__add_test_hwmon_pmu(int hwmon_dir,