summaryrefslogtreecommitdiff
path: root/drivers/perf
diff options
context:
space:
mode:
authorBesar Wicaksono <bwicaksono@nvidia.com>2024-10-31 14:21:18 +0000
committerWill Deacon <will@kernel.org>2024-12-09 15:07:49 +0000
commitbce61d5c57647ca4565847217fe811260cc60173 (patch)
tree86f8868a66cfbd217bfa6453a65a0a4d0ef35ec5 /drivers/perf
parentca26df4b1036bcad326170a6ddb5245f6d6e8d82 (diff)
perf: arm_cspmu: nvidia: monitor all ports by default
Some NVIDIA PMUs like the NVLINK-C2C, CNVLINK, and PCIE PMU provide port filtering. If the port filter is set to zero, the counter of these PMUs will not capture any event. To avoid meaningless experiment, the driver sets the port filter value to a default non-zero value. Signed-off-by: Besar Wicaksono <bwicaksono@nvidia.com> Link: https://lore.kernel.org/r/20241031142118.1865965-5-bwicaksono@nvidia.com Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'drivers/perf')
-rw-r--r--drivers/perf/arm_cspmu/nvidia_cspmu.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/perf/arm_cspmu/nvidia_cspmu.c b/drivers/perf/arm_cspmu/nvidia_cspmu.c
index 7ab7d76e4ca1..8116c7846a46 100644
--- a/drivers/perf/arm_cspmu/nvidia_cspmu.c
+++ b/drivers/perf/arm_cspmu/nvidia_cspmu.c
@@ -175,10 +175,12 @@ static u32 nv_cspmu_event_filter(const struct perf_event *event)
const struct nv_cspmu_ctx *ctx =
to_nv_cspmu_ctx(to_arm_cspmu(event->pmu));
- if (ctx->filter_mask == 0)
+ const u32 filter_val = event->attr.config1 & ctx->filter_mask;
+
+ if (filter_val == 0)
return ctx->filter_default_val;
- return event->attr.config1 & ctx->filter_mask;
+ return filter_val;
}
enum nv_cspmu_name_fmt {