diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-03-15 10:35:04 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-03-20 13:19:28 -0300 |
commit | 0e83a7e9e592cdf60696076071b2629adc569826 (patch) | |
tree | 96c2064d593559a2e06d240bdf4d532c7034acd1 /tools/perf/util | |
parent | 00ea0eb21e9ba38636608e3eb0ac332fc022d5bb (diff) | |
download | op-kernel-dev-0e83a7e9e592cdf60696076071b2629adc569826.zip op-kernel-dev-0e83a7e9e592cdf60696076071b2629adc569826.tar.gz |
perf annotate tui: Move have_cycles to struct annotation
This is to pave the way to have more functions shared between TUI, stdio
and the upcoming stdio2 formatting, that will use the __scnprintf
functions used by --tui in a --stdio fashion.
This partially addresses the comments added in cset 30e863bb6f70 ("perf
annotate: Compute IPC and basic block cycles"):
/*
* This should probably be in util/annotate.c to share with the tty
* annotate, but right now we need the per byte offsets arrays,
* which are only here.
*/
The following patches will address the rest.
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-yftvybgx1s8sevs6kp1an0ft@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/annotate.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index 0407234..23d2f32 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h @@ -164,9 +164,15 @@ struct annotated_source { struct annotation { pthread_mutex_t lock; u64 max_coverage; + bool have_cycles; struct annotated_source *src; }; +static inline int annotation__cycles_width(struct annotation *notes) +{ + return notes->have_cycles ? ANNOTATION__IPC_WIDTH + ANNOTATION__CYCLES_WIDTH : 0; +} + static inline struct sym_hist *annotation__histogram(struct annotation *notes, int idx) { return (((void *)¬es->src->histograms) + |