perf pmu: Remove perf_pmu__hybrid_pmus list
authorIan Rogers <irogers@google.com>
Sat, 27 May 2023 07:22:00 +0000 (00:22 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sat, 27 May 2023 12:41:13 +0000 (09:41 -0300)
Rather than iterate hybrid PMUs, inhererently Intel specific, iterate
all PMUs checking whether they are core. To only get hybrid cores,
first call perf_pmu__has_hybrid.

Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ali Saidi <alisaidi@amazon.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Dmitrii Dolgov <9erthalion6@gmail.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jing Zhang <renyu.zj@linux.alibaba.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Kang Minchul <tegongkang@gmail.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Ming Wang <wangming01@loongson.cn>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Sandipan Das <sandipan.das@amd.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
Cc: coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/20230527072210.2900565-25-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-record.c
tools/perf/util/Build
tools/perf/util/pmu-hybrid.c [deleted file]
tools/perf/util/pmu-hybrid.h [deleted file]
tools/perf/util/pmu.c
tools/perf/util/pmu.h
tools/perf/util/print-events.c
tools/perf/util/python-ext-sources

index e30e8d6a6575896c8b2357d6d9129eee68863a88..2abcad2998f69e6eb7f1daef6264d5d5059d7bcd 100644 (file)
@@ -49,7 +49,6 @@
 #include "util/util.h"
 #include "util/pfm.h"
 #include "util/clockid.h"
-#include "util/pmu-hybrid.h"
 #include "util/off_cpu.h"
 #include "util/bpf-filter.h"
 #include "asm/bug.h"
index 21e4cdcba504e5645b25dc3487a234d54df92894..0d68be51a739a438b17cba8a25b5e8bda1583d91 100644 (file)
@@ -73,7 +73,6 @@ perf-y += pmu.o
 perf-y += pmus.o
 perf-y += pmu-flex.o
 perf-y += pmu-bison.o
-perf-y += pmu-hybrid.o
 perf-y += svghelper.o
 perf-$(CONFIG_LIBTRACEEVENT) += trace-event-info.o
 perf-y += trace-event-scripting.o
diff --git a/tools/perf/util/pmu-hybrid.c b/tools/perf/util/pmu-hybrid.c
deleted file mode 100644 (file)
index 7fe943d..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-#include <linux/list.h>
-#include <linux/compiler.h>
-#include <linux/string.h>
-#include <linux/zalloc.h>
-#include <sys/types.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <stdbool.h>
-#include <stdarg.h>
-#include <locale.h>
-#include <api/fs/fs.h>
-#include "fncache.h"
-#include "pmu-hybrid.h"
-
-LIST_HEAD(perf_pmu__hybrid_pmus);
-
-static struct perf_pmu *perf_pmu__find_hybrid_pmu(const char *name)
-{
-       struct perf_pmu *pmu;
-
-       if (!name)
-               return NULL;
-
-       perf_pmu__for_each_hybrid_pmu(pmu) {
-               if (!strcmp(name, pmu->name))
-                       return pmu;
-       }
-
-       return NULL;
-}
-
-bool perf_pmu__is_hybrid(const char *name)
-{
-       return perf_pmu__find_hybrid_pmu(name) != NULL;
-}
diff --git a/tools/perf/util/pmu-hybrid.h b/tools/perf/util/pmu-hybrid.h
deleted file mode 100644 (file)
index 8dbcae9..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __PMU_HYBRID_H
-#define __PMU_HYBRID_H
-
-#include <linux/perf_event.h>
-#include <linux/compiler.h>
-#include <linux/list.h>
-#include <stdbool.h>
-#include "pmu.h"
-
-extern struct list_head perf_pmu__hybrid_pmus;
-
-#define perf_pmu__for_each_hybrid_pmu(pmu)     \
-       list_for_each_entry(pmu, &perf_pmu__hybrid_pmus, hybrid_list)
-
-bool perf_pmu__is_hybrid(const char *name);
-
-static inline int perf_pmu__hybrid_pmu_num(void)
-{
-       struct perf_pmu *pmu;
-       int num = 0;
-
-       perf_pmu__for_each_hybrid_pmu(pmu)
-               num++;
-
-       return num;
-}
-
-#endif /* __PMU_HYBRID_H */
index 65daa0cc71d61dbbfd004b6b5d83c1144601ad11..21ee23b78f5a990a71bf2193648dfe638798e696 100644 (file)
@@ -32,7 +32,6 @@
 #include "string2.h"
 #include "strbuf.h"
 #include "fncache.h"
-#include "pmu-hybrid.h"
 #include "util/evsel_config.h"
 
 struct perf_pmu perf_pmu__fake;
@@ -954,11 +953,6 @@ static struct perf_pmu *pmu_lookup(int dirfd, const char *lookup_name)
        list_splice(&aliases, &pmu->aliases);
        list_add_tail(&pmu->list, &pmus);
 
-       if (!strcmp(name, "cpu_core") || !strcmp(name, "cpu_atom"))
-               list_add_tail(&pmu->hybrid_list, &perf_pmu__hybrid_pmus);
-       else
-               INIT_LIST_HEAD(&pmu->hybrid_list);
-
        pmu->default_config = perf_pmu__get_default_config(pmu);
 
        return pmu;
@@ -2131,7 +2125,6 @@ void perf_pmu__destroy(void)
 
        list_for_each_entry_safe(pmu, tmp, &pmus, list) {
                list_del(&pmu->list);
-               list_del(&pmu->hybrid_list);
 
                perf_pmu__delete(pmu);
        }
index 5f5de7c20ab6ae85203657d9d0a6e593010df81f..cb51ad6e40fa911ef7e6b705578f5b7661ad6fe2 100644 (file)
@@ -119,8 +119,6 @@ struct perf_pmu {
        struct list_head caps;
        /** @list: Element on pmus list in pmu.c. */
        struct list_head list;
-       /** @hybrid_list: Element on perf_pmu__hybrid_pmus. */
-       struct list_head hybrid_list;
 
        /**
         * @missing_features: Features to inhibit when events on this PMU are
index 69492cbd69218ab33b36f3df19451bc3e111f153..8d823bc906e618885509e768a9a4b17d0b743132 100644 (file)
@@ -26,7 +26,6 @@
 #include "strlist.h"
 #include "tracepoint.h"
 #include "pfm.h"
-#include "pmu-hybrid.h"
 #include "thread_map.h"
 
 #define MAX_NAME_LEN 100
index aa5156c2bcff5cda3a9733951e0b2e5488d43703..d4c9b4cd35efa556a1b3f4bc2629fe809f361b76 100644 (file)
@@ -39,5 +39,4 @@ util/affinity.c
 util/rwsem.c
 util/hashmap.c
 util/perf_regs.c
-util/pmu-hybrid.c
 util/fncache.c