perf intel-pt: Move PMU initialization from default config code
authorIan Rogers <irogers@google.com>
Thu, 12 Oct 2023 17:56:40 +0000 (10:56 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Tue, 17 Oct 2023 19:40:50 +0000 (12:40 -0700)
Avoid setting PMU values in intel_pt_pmu_default_config, move to
perf_pmu__arch_init.

Signed-off-by: Ian Rogers <irogers@google.com>
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: James Clark <james.clark@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Yang Jihong <yangjihong1@huawei.com>
Cc: Will Deacon <will@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Jing Zhang <renyu.zj@linux.alibaba.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: John Garry <john.g.garry@oracle.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: coresight@lists.linaro.org
Link: https://lore.kernel.org/r/20231012175645.1849503-3-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/arch/x86/util/intel-pt.c
tools/perf/arch/x86/util/pmu.c

index b923bca939d92f3b753e7fab922bd91df0227cb3..6d6cd8f9133cb1709e5456dd22b31b574f56fbe3 100644 (file)
@@ -267,8 +267,6 @@ intel_pt_pmu_default_config(struct perf_pmu *intel_pt_pmu)
 
        attr->config = intel_pt_default_config(intel_pt_pmu);
 
-       intel_pt_pmu->selectable = true;
-
        return attr;
 }
 
index 811e2377d2d5faa23f0f54a794acf95a89badffc..949b3e2c67bdc52b05d4655d01d875e1baaa0805 100644 (file)
@@ -22,6 +22,7 @@ void perf_pmu__arch_init(struct perf_pmu *pmu __maybe_unused)
 #ifdef HAVE_AUXTRACE_SUPPORT
        if (!strcmp(pmu->name, INTEL_PT_PMU_NAME)) {
                pmu->auxtrace = true;
+               pmu->selectable = true;
                pmu->default_config = intel_pt_pmu_default_config(pmu);
        }
        if (!strcmp(pmu->name, INTEL_BTS_PMU_NAME)) {