From 6af612d2b10593cdd8bba4427741a981bdd57c86 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Thu, 15 Mar 2018 12:41:39 -0300 Subject: perf annotate: Move pcnt_with() to the annotation library Out of the TUI code, since now all it touches is what is in 'struct annotation'. Cc: Adrian Hunter Cc: Andi Kleen Cc: David Ahern Cc: Jin Yao Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-kh5bbbgd7l4agv9oc5hnw0ui@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/annotate.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tools/perf/util/annotate.h') diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index 5936605..17cd5d2 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h @@ -176,6 +176,11 @@ static inline int annotation__cycles_width(struct annotation *notes) return notes->have_cycles ? ANNOTATION__IPC_WIDTH + ANNOTATION__CYCLES_WIDTH : 0; } +static inline int annotation__pcnt_width(struct annotation *notes) +{ + return (notes->options->show_total_period ? 12 : 7) * notes->nr_events; +} + void annotation__compute_ipc(struct annotation *notes, size_t size); static inline struct sym_hist *annotation__histogram(struct annotation *notes, int idx) -- cgit v1.1