aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/annotate.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2018-03-15 16:04:53 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-03-20 12:19:30 -0400
commit2f025ea0bac2f99a2800f43f139f57c226d3b08b (patch)
treee4b822464fe8c388f59961398cdb62fdb64dcbd2 /tools/perf/util/annotate.c
parentecda45bd6cfe0badda0e8215c5a008eaf7647716 (diff)
perf annotate: Introduce annotation_line__max_percent()
Out of the annotate_browser__write() routine, to be used in the --stdio2 mode. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: https://lkml.kernel.org/n/tip-0he0wyy4haswqi1qb35x37do@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.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 7ad6400a0d4f..3bd6f9b0147f 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -2184,6 +2184,20 @@ bool ui__has_annotation(void)
2184 return use_browser == 1 && perf_hpp_list.sym; 2184 return use_browser == 1 && perf_hpp_list.sym;
2185} 2185}
2186 2186
2187
2188double annotation_line__max_percent(struct annotation_line *al, struct annotation *notes)
2189{
2190 double percent_max = 0.0;
2191 int i;
2192
2193 for (i = 0; i < notes->nr_events; i++) {
2194 if (al->samples[i].percent > percent_max)
2195 percent_max = al->samples[i].percent;
2196 }
2197
2198 return percent_max;
2199}
2200
2187int symbol__annotate2(struct symbol *sym, struct map *map, struct perf_evsel *evsel, 2201int symbol__annotate2(struct symbol *sym, struct map *map, struct perf_evsel *evsel,
2188 struct annotation_options *options, struct arch **parch) 2202 struct annotation_options *options, struct arch **parch)
2189{ 2203{