mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
drivers: uncore_pmu: add event type check
Need to check if the event type matches the pmu type and return ENOENT if there is a mismatch. Bug 5035098 Change-Id: I3d1341efd1ad59dec011527a730d702ed6dfea4a Signed-off-by: Eric Funsten <efunsten@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3279805 Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: Besar Wicaksono <bwicaksono@nvidia.com> GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
// SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
// SPDX-FileCopyrightText: Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||||
|
|
||||||
#include <nvidia/conftest.h>
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
@@ -500,6 +500,9 @@ static int scf_uncore_event_init(struct perf_event *event)
|
|||||||
uncore_pmu = to_uncore_pmu(event->pmu);
|
uncore_pmu = to_uncore_pmu(event->pmu);
|
||||||
pdev = uncore_pmu->pdev;
|
pdev = uncore_pmu->pdev;
|
||||||
|
|
||||||
|
if (event->attr.type != event->pmu->type)
|
||||||
|
return -ENOENT;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The uncore counters are shared by all CPU cores. Therefore it does not
|
* The uncore counters are shared by all CPU cores. Therefore it does not
|
||||||
* support sampling mode or attach to a task (per-process mode).
|
* support sampling mode or attach to a task (per-process mode).
|
||||||
|
|||||||
Reference in New Issue
Block a user