Commit ec0479a6 authored by Jin Yao's avatar Jin Yao Committed by Arnaldo Carvalho de Melo

perf report/top TUI: Support hotkey 'a' for annotation of unresolved addresses

In previous patch, we have supported the annotation functionality even
without symbols.

For this patch, it supports the hotkey 'a' on address in report view.
Note that, for branch mode, we only support the annotation for "branch
to" address.
Signed-off-by: default avatarJin Yao <yao.jin@linux.intel.com>
Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20200227043939.4403-4-yao.jin@linux.intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 7b0a0dcb
......@@ -3061,11 +3061,33 @@ static int perf_evsel__hists_browse(struct evsel *evsel, int nr_events,
continue;
}
if (browser->selection == NULL ||
browser->selection->sym == NULL ||
browser->selection->map->dso->annotate_warned)
if (!browser->selection ||
!browser->selection->map ||
!browser->selection->map->dso ||
browser->selection->map->dso->annotate_warned) {
continue;
}
if (!browser->selection->sym) {
if (!browser->he_selection)
continue;
if (sort__mode == SORT_MODE__BRANCH) {
bi = browser->he_selection->branch_info;
if (!bi || !bi->to.ms.map)
continue;
actions->ms.sym = symbol__new_unresolved(bi->to.al_addr, bi->to.ms.map);
actions->ms.map = bi->to.ms.map;
} else {
actions->ms.sym = symbol__new_unresolved(browser->he_selection->ip,
browser->selection->map);
actions->ms.map = browser->selection->map;
}
if (!actions->ms.sym)
continue;
} else {
if (symbol__annotation(browser->selection->sym)->src == NULL) {
ui_browser__warning(&browser->b, delay_secs * 2,
"No samples for the \"%s\" symbol.\n\n"
......@@ -3076,6 +3098,8 @@ static int perf_evsel__hists_browse(struct evsel *evsel, int nr_events,
actions->ms.map = browser->selection->map;
actions->ms.sym = browser->selection->sym;
}
do_annotate(browser, actions);
continue;
case 'P':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment