summaryrefslogtreecommitdiff
path: root/tools/perf/ui/browsers
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2018-03-15 15:59:01 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-03-20 13:19:29 -0300
commit5bc49f6120203c9fbe8e63fdcb9598e0ba615de7 (patch)
tree3732bbc5f5671e6289477c79138796e78a8a73c9 /tools/perf/ui/browsers
parent1cf5f98a5edbb4b628349bea37da0aa259ded07c (diff)
perf annotate: Introduce set_offsets() method out of TUI code
More non-strictly TUI code being moved to the UI neutral annotation library, to be used in the upcoming --stdio2 output 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-ek20dnd8z2y5v54pcepihybz@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/browsers')
-rw-r--r--tools/perf/ui/browsers/annotate.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 00b88349a3c2..977c7e9fdadb 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -938,7 +938,6 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map,
struct perf_evsel *evsel,
struct hist_browser_timer *hbt)
{
- struct annotation_line *al;
struct annotation *notes = symbol__annotation(sym);
size_t size;
struct map_symbol ms = {
@@ -991,27 +990,8 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map,
notes->start = map__rip_2objdump(map, sym->start);
- list_for_each_entry(al, &notes->src->source, node) {
- size_t line_len = strlen(al->line);
-
- if (browser.b.width < line_len)
- browser.b.width = line_len;
- al->idx = notes->nr_entries++;
- if (al->offset != -1) {
- al->idx_asm = notes->nr_asm_entries++;
- /*
- * FIXME: short term bandaid to cope with assembly
- * routines that comes with labels in the same column
- * as the address in objdump, sigh.
- *
- * E.g. copy_user_generic_unrolled
- */
- if (al->offset < (s64)size)
- notes->offsets[al->offset] = al;
- } else
- al->idx_asm = -1;
- }
-
+ annotation__set_offsets(notes, size);
+ browser.b.width = notes->max_line_len;
annotation__mark_jump_targets(notes, sym);
annotation__compute_ipc(notes, size);