File perf-annotate-fix-storing-per-line-sym_hist_entry.patch of Package perf
44
1
From: Arnaldo Carvalho de Melo <acme@redhat.com>
2
Date: Fri, 28 Jul 2017 12:49:02 -0300
3
Subject: perf annotate: Fix storing per line sym_hist_entry
4
Git-commit: 48cc33085253d607706e68a67ac98fe2a6abdd3d
5
Patch-mainline: v4.14-rc1
6
References: bsc#1083691
7
8
The existing loop incremented the offset while using it as the array
9
index, when we went to an array of sym_hist_entry instances, we
10
should've moved the increment to outside of the array element reference,
11
oops, fix it.
12
13
Cc: Adrian Hunter <adrian.hunter@intel.com>
14
Cc: David Ahern <dsahern@gmail.com>
15
Cc: Jiri Olsa <jolsa@kernel.org>
16
Cc: Namhyung Kim <namhyung@kernel.org>
17
Cc: Taeung Song <treeze.taeung@gmail.com>
18
Cc: Wang Nan <wangnan0@huawei.com>
19
Fixes: 461c17f00f40 ("perf annotate: Store the sample period in each histogram bucket")
20
Link: http://lkml.kernel.org/n/tip-s3dm6uyrazlpag3f0psfia07@git.kernel.org
21
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
22
Signed-off-by: Tony Jones <tonyj@suse.de>
23
---
24
tools/perf/util/annotate.c | 5 +++--
25
1 file changed, 3 insertions(+), 2 deletions(-)
26
27
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
28
index 5125c2bbacaa..2dab0e5a7f2f 100644
29
--- a/tools/perf/util/annotate.c
30
+++ b/tools/perf/util/annotate.c
31
32
u64 period = 0;
33
34
while (offset < end) {
35
- hits += h->addr[offset++].nr_samples;
36
- period += h->addr[offset++].period;
37
+ hits += h->addr[offset].nr_samples;
38
+ period += h->addr[offset].period;
39
+ ++offset;
40
}
41
42
if (h->nr_samples) {
43
44