diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 5125c2bbacaa06bddbec9c7ba5c9fa04c78f551c..2dab0e5a7f2f0ea448b2041a4d60b082d2da8129 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -963,8 +963,9 @@ double disasm__calc_percent(struct annotation *notes, int evidx, s64 offset, u64 period = 0; while (offset < end) { - hits += h->addr[offset++].nr_samples; - period += h->addr[offset++].period; + hits += h->addr[offset].nr_samples; + period += h->addr[offset].period; + ++offset; } if (h->nr_samples) {