diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-03-15 12:41:39 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-03-20 13:19:28 -0300 |
commit | 6af612d2b10593cdd8bba4427741a981bdd57c86 (patch) | |
tree | 3b51019d57d237a6c196c59c66647176d7772b4d /tools/perf/util/annotate.h | |
parent | 16932d77050fb3d76bc265c21c53eeec14639d5e (diff) | |
download | linux-6af612d2b10593cdd8bba4427741a981bdd57c86.tar.bz2 |
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 <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-kh5bbbgd7l4agv9oc5hnw0ui@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/annotate.h')
-rw-r--r-- | tools/perf/util/annotate.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index 5936605b5dac..17cd5d274fe5 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) |