diff options
Diffstat (limited to 'tools/perf/util/annotate.c')
-rw-r--r-- | tools/perf/util/annotate.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 11af5f0d56cc..a37032bd137d 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c | |||
@@ -1665,7 +1665,7 @@ static int symbol__get_source_line(struct symbol *sym, struct map *map, | |||
1665 | start = map__rip_2objdump(map, sym->start); | 1665 | start = map__rip_2objdump(map, sym->start); |
1666 | 1666 | ||
1667 | for (i = 0; i < len; i++) { | 1667 | for (i = 0; i < len; i++) { |
1668 | u64 offset; | 1668 | u64 offset, nr_samples; |
1669 | double percent_max = 0.0; | 1669 | double percent_max = 0.0; |
1670 | 1670 | ||
1671 | src_line->nr_pcnt = nr_pcnt; | 1671 | src_line->nr_pcnt = nr_pcnt; |
@@ -1674,12 +1674,14 @@ static int symbol__get_source_line(struct symbol *sym, struct map *map, | |||
1674 | double percent = 0.0; | 1674 | double percent = 0.0; |
1675 | 1675 | ||
1676 | h = annotation__histogram(notes, evidx + k); | 1676 | h = annotation__histogram(notes, evidx + k); |
1677 | nr_samples = h->addr[i]; | ||
1677 | if (h->sum) | 1678 | if (h->sum) |
1678 | percent = 100.0 * h->addr[i] / h->sum; | 1679 | percent = 100.0 * nr_samples / h->sum; |
1679 | 1680 | ||
1680 | if (percent > percent_max) | 1681 | if (percent > percent_max) |
1681 | percent_max = percent; | 1682 | percent_max = percent; |
1682 | src_line->samples[k].percent = percent; | 1683 | src_line->samples[k].percent = percent; |
1684 | src_line->samples[k].nr = nr_samples; | ||
1683 | } | 1685 | } |
1684 | 1686 | ||
1685 | if (percent_max <= 0.5) | 1687 | if (percent_max <= 0.5) |