Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf annotate: Fix title line after return from call

The second title line which shows symbol and DSO name is broken after
moving to another function at 'callq' instruction.

The ui_browser__show_title() is used for the first line which shows
global sample count and event name so it doesn't change across the
functions.

What it needs after processing 'call' instruction is to update the
second line onlly. Add a comment and call appropriate function.

You can verify the change by pressing ENTER on a 'call' instruction and
then ESC.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Namhyung Kim and committed by
Arnaldo Carvalho de Melo
1e5881b1 7eabedef

+7 -3
+7 -3
tools/perf/ui/browsers/annotate.c
··· 585 585 struct map_symbol *ms = browser->b.priv, target_ms; 586 586 struct disasm_line *dl = disasm_line(browser->selection); 587 587 struct annotation *notes; 588 - char title[SYM_TITLE_MAX_SIZE]; 589 588 590 589 if (!dl->ops.target.sym) { 591 590 ui_helpline__puts("The called function was not found."); ··· 606 607 target_ms.sym = dl->ops.target.sym; 607 608 annotation__unlock(notes); 608 609 __hist_entry__tui_annotate(browser->he, &target_ms, evsel, hbt); 609 - sym_title(ms->sym, ms->map, title, sizeof(title), annotate_opts.percent_type); 610 - ui_browser__show_title(&browser->b, title); 610 + 611 + /* 612 + * The annotate_browser above changed the title with the target function 613 + * and now it's back to the original function. Refresh the header line 614 + * for the original function again. 615 + */ 616 + annotate_browser__show_function_title(browser); 611 617 return true; 612 618 } 613 619