aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/annotate.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2017-07-28 11:49:02 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-07-28 11:53:05 -0400
commit48cc33085253d607706e68a67ac98fe2a6abdd3d (patch)
tree07188372412d676ea9cb620b9b1406de68416c0e /tools/perf/util/annotate.c
parentce9ee4a2de20062a97ad50ecc11ebda7e7618fd1 (diff)
perf annotate: Fix storing per line sym_hist_entry
The existing loop incremented the offset while using it as the array index, when we went to an array of sym_hist_entry instances, we should've moved the increment to outside of the array element reference, oops, fix it. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Taeung Song <treeze.taeung@gmail.com> Cc: Wang Nan <wangnan0@huawei.com> Fixes: 461c17f00f40 ("perf annotate: Store the sample period in each histogram bucket") Link: http://lkml.kernel.org/n/tip-s3dm6uyrazlpag3f0psfia07@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/annotate.c')
-rw-r--r--tools/perf/util/annotate.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 5125c2bbacaa..2dab0e5a7f2f 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,
963 u64 period = 0; 963 u64 period = 0;
964 964
965 while (offset < end) { 965 while (offset < end) {
966 hits += h->addr[offset++].nr_samples; 966 hits += h->addr[offset].nr_samples;
967 period += h->addr[offset++].period; 967 period += h->addr[offset].period;
968 ++offset;
968 } 969 }
969 970
970 if (h->nr_samples) { 971 if (h->nr_samples) {