Re: [PATCH] perf hist: Fix branch_info index for sample weight
From: Namhyung Kim
Date: Mon Nov 09 2026 - 21:57:18 EST
On Wed, 04 Nov 2026 17:02:28 +0800, Gu Bin wrote:
> iter_add_next_branch_entry() is called once per branch and uses &bi[i]
> for the hist entry, but reads the weight from bi->flags.cycles (i.e.
> bi[0]) for every branch, so every entry is weighted with the first
> branch's cycle count. This is incorrect when the branch stack contains
> more than one entry with different cycle counts, as the weight of each
> hist entry fails to reflect the cycles of its own branch.
>
> [...]
Applied to perf-tools-next, thanks!
Best regards,
Namhyung