aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/perf/ui
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2018-08-04 15:05:09 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-08-08 15:55:48 -0300
commit6d9f0c2d5ef7568c29fa5927748c4915a9c7760a (patch)
tree632c0bc56a8edd9297aa5390aac20ff27063f52d /tools/perf/ui
parentperf annotate: Loop group events directly in annotation__calc_percent() (diff)
downloadwireguard-linux-6d9f0c2d5ef7568c29fa5927748c4915a9c7760a.tar.xz
wireguard-linux-6d9f0c2d5ef7568c29fa5927748c4915a9c7760a.zip
perf annotate: Switch struct annotation_data::percent to array
So we can hold multiple percent values for annotation line. The first member of this array is current local hits percent value (PERCENT_HITS_LOCAL index), so no functional change is expected. Adding annotation_data__percent function to return requested percent value from struct annotation_data. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/20180804130521.11408-9-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui')
-rw-r--r--tools/perf/ui/browsers/annotate.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index d648d1e153f3..81876c3923d2 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -315,10 +315,13 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser,
}
for (i = 0; i < pos->al.data_nr; i++) {
- struct annotation_data *sample = &pos->al.data[i];
+ double percent;
- if (max_percent < sample->percent)
- max_percent = sample->percent;
+ percent = annotation_data__percent(&pos->al.data[i],
+ PERCENT_HITS_LOCAL);
+
+ if (max_percent < percent)
+ max_percent = percent;
}
if (max_percent < 0.01 && pos->al.ipc == 0) {