Skip to content

Commit 90befef

Browse files
namhyungPeter Zijlstra
authored andcommitted
perf/x86: Fix missing sample size update on AMD BRS
It missed to convert a PERF_SAMPLE_BRANCH_STACK user to call the new perf_sample_save_brstack() helper in order to update the dyn_size. This affects AMD Zen3 machines with the branch-brs event. Fixes: eb55b45 ("perf/core: Add perf_sample_save_brstack() helper") Signed-off-by: Namhyung Kim <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected]
1 parent 1d1bfe3 commit 90befef

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

arch/x86/events/core.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,10 +1703,8 @@ int x86_pmu_handle_irq(struct pt_regs *regs)
17031703

17041704
perf_sample_data_init(&data, 0, event->hw.last_period);
17051705

1706-
if (has_branch_stack(event)) {
1707-
data.br_stack = &cpuc->lbr_stack;
1708-
data.sample_flags |= PERF_SAMPLE_BRANCH_STACK;
1709-
}
1706+
if (has_branch_stack(event))
1707+
perf_sample_save_brstack(&data, event, &cpuc->lbr_stack);
17101708

17111709
if (perf_event_overflow(event, &data, regs))
17121710
x86_pmu_stop(event, 0);

0 commit comments

Comments
 (0)