drivers/perf: hisi: Advertise the PERF_PMU_CAP_NO_EXCLUDE capability
authorJunhao He <hejunhao3@huawei.com>
Thu, 19 Jan 2023 10:03:05 +0000 (18:03 +0800)
committerWill Deacon <will@kernel.org>
Thu, 19 Jan 2023 18:30:20 +0000 (18:30 +0000)
Missed initialization the variable of pmu::capabilities when extract
the initialization code of hisi_pmu->pmu into a function.

HISI UNCORE PMU drivers counters that not support context exclusion.
So we have to advertise the PERF_PMU_CAP_NO_EXCLUDE capability.
This ensures that perf will prevent us from handling events where
any exclusion flags are set.

Signed-off-by: Junhao He <hejunhao3@huawei.com>
Link: https://lore.kernel.org/r/20230119100307.3660-2-hejunhao3@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/hisilicon/hisi_uncore_pmu.c

index fbc8a93..2a46647 100644 (file)
@@ -546,6 +546,7 @@ void hisi_pmu_init(struct pmu *pmu, const char *name,
        pmu->stop               = hisi_uncore_pmu_stop;
        pmu->read               = hisi_uncore_pmu_read;
        pmu->attr_groups        = attr_groups;
+       pmu->capabilities       = PERF_PMU_CAP_NO_EXCLUDE;
 }
 EXPORT_SYMBOL_GPL(hisi_pmu_init);