diff options
| author | Gu Bin <gubin@cmss.chinamobile.com> | 2026-11-04 17:02:28 +0800 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-11-07 17:31:37 -0300 |
| commit | 0e263803702d7cdc182f3f9f81f721cdf7569664 (patch) | |
| tree | fcfc893a9d1187426f8f0c5a3496d80457470ca7 /tools/perf/scripts/python | |
| parent | f88e617ea4590d80e4a144c69d6326c04fe2a357 (diff) | |
perf hist: Fix branch_info index for sample weight
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.
Use bi[i].flags.cycles, as the surrounding code already does.
Fixes: 0e332f033a8216fa ("perf tools: Add support for cycles, weight branch_info field")
Reviewed-by: James Clark <james.clark@linaro.org>
Signed-off-by: Gu Bin <gubin@cmss.chinamobile.com>
Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
