summaryrefslogtreecommitdiffstats
path: root/tools/perf/ui
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2018-03-15 16:26:29 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-03-20 13:19:29 -0300
commitb8b0d819858e1140e98ce858a0c839f3d03cb0f5 (patch)
tree6cbfbaeb6a8ff6fbe3498d9edfe9e6ab81ab98da /tools/perf/ui
parent7232bf7a8954e4f6558e6b74fb6a2403e7a3b7be (diff)
downloadop-kernel-dev-b8b0d819858e1140e98ce858a0c839f3d03cb0f5.zip
op-kernel-dev-b8b0d819858e1140e98ce858a0c839f3d03cb0f5.tar.gz
perf annotate: Introduce init_column_widths() method out of TUI code
More non-TUI stuff goes to the UI-agnostic library 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-hngv7rpqvtta69ouj7ne770q@git.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.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index ab4d004..06ad5ec 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -905,15 +905,6 @@ int hist_entry__tui_annotate(struct hist_entry *he, struct perf_evsel *evsel,
return map_symbol__tui_annotate(&he->ms, evsel, hbt);
}
-static inline int width_jumps(int n)
-{
- if (n >= 100)
- return 5;
- if (n / 10)
- return 2;
- return 1;
-}
-
int symbol__tui_annotate(struct symbol *sym, struct map *map,
struct perf_evsel *evsel,
struct hist_browser_timer *hbt)
@@ -974,10 +965,7 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map,
browser.b.width = notes->max_line_len;
annotation__mark_jump_targets(notes, sym);
annotation__compute_ipc(notes, size);
-
- notes->widths.addr = notes->widths.target = notes->widths.min_addr = hex_width(size);
- notes->widths.max_addr = hex_width(sym->end);
- notes->widths.jumps = width_jumps(notes->max_jump_sources);
+ annotation__init_column_widths(notes, sym);
notes->nr_events = nr_pcnt;
browser.b.nr_entries = notes->nr_entries;
browser.b.entries = &notes->src->source,
OpenPOWER on IntegriCloud