Skip to content

Commit 9794563

Browse files
anakryikoingomolnar
authored andcommitted
perf/x86/amd: Don't reject non-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 just 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). Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Sandipan Das <sandipan.das@amd.com> Link: https://lore.kernel.org/r/20240402022118.1046049-5-andrii@kernel.org
1 parent a4d1811 commit 9794563

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

arch/x86/events/amd/lbr.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,6 @@ int amd_pmu_lbr_hw_config(struct perf_event *event)
310310
{
311311
int ret = 0;
312312

313-
/* LBR is not recommended in counting mode */
314-
if (!is_sampling_event(event))
315-
return -EINVAL;
316-
317313
ret = amd_pmu_lbr_setup_filter(event);
318314
if (!ret)
319315
event->attach_state |= PERF_ATTACH_SCHED_CB;

0 commit comments

Comments
 (0)