[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240329163722.2776730-2-andrii@kernel.org>
Date: Fri, 29 Mar 2024 09:37:22 -0700
From: Andrii Nakryiko <andrii@...nel.org>
To: x86@...nel.org,
peterz@...radead.org,
mingo@...hat.com,
tglx@...utronix.de
Cc: bpf@...r.kernel.org,
linux-kernel@...r.kernel.org,
jolsa@...nel.org,
song@...nel.org,
kernel-team@...a.com,
Andrii Nakryiko <andrii@...nel.org>,
Sandipan Das <sandipan.das@....com>
Subject: [PATCH v3 2/2] perf/x86/amd: don't reject sampling events with configured LBR
Now that it's possible to capture LBR on AMD CPU from BPF at arbitrary
point, there is no reason to artificially limit this feature to sampling
events. So corresponding check is removed. AFAIU, there is no
correctness implications of doing this (and it was possible to bypass
this check by just setting perf_event's sample_period to 1 anyways, so
it doesn't guard all that much).
Reviewed-by: Sandipan Das <sandipan.das@....com>
Signed-off-by: Andrii Nakryiko <andrii@...nel.org>
---
arch/x86/events/amd/lbr.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/x86/events/amd/lbr.c b/arch/x86/events/amd/lbr.c
index 0e4de028590d..75920f895d67 100644
--- a/arch/x86/events/amd/lbr.c
+++ b/arch/x86/events/amd/lbr.c
@@ -310,10 +310,6 @@ int amd_pmu_lbr_hw_config(struct perf_event *event)
{
int ret = 0;
- /* LBR is not recommended in counting mode */
- if (!is_sampling_event(event))
- return -EINVAL;
-
ret = amd_pmu_lbr_setup_filter(event);
if (!ret)
event->attach_state |= PERF_ATTACH_SCHED_CB;
--
2.43.0
Powered by blists - more mailing lists