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

perf annotate: Factor out annotate_browser__show_function_title()

It'll be used in other places.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
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
7eabedef 48330efa

+16 -11
+16 -11
tools/perf/ui/browsers/annotate.c
··· 555 555 annotate_opts.code_with_type ? "[Type]" : ""); 556 556 } 557 557 558 + static void annotate_browser__show_function_title(struct annotate_browser *browser) 559 + { 560 + struct ui_browser *b = &browser->b; 561 + struct map_symbol *ms = b->priv; 562 + struct symbol *sym = ms->sym; 563 + char title[SYM_TITLE_MAX_SIZE]; 564 + 565 + sym_title(sym, ms->map, title, sizeof(title), annotate_opts.percent_type); 566 + 567 + ui_browser__gotorc_title(b, 0, 0); 568 + ui_browser__set_color(b, HE_COLORSET_ROOT); 569 + ui_browser__write_nstring(b, title, b->width + 1); 570 + } 571 + 558 572 /* 559 573 * This can be called from external jumps, i.e. jumps from one function 560 574 * to another, like from the kernel's entry_SYSCALL_64 function to the ··· 782 768 783 769 static int annotate_browser__show(struct annotate_browser *browser, char *title, const char *help) 784 770 { 785 - struct ui_browser *b = &browser->b; 786 - struct map_symbol *ms = b->priv; 787 - struct symbol *sym = ms->sym; 788 - char symbol_dso[SYM_TITLE_MAX_SIZE]; 789 - 790 - if (ui_browser__show(b, title, help) < 0) 771 + if (ui_browser__show(&browser->b, title, help) < 0) 791 772 return -1; 792 773 793 - sym_title(sym, ms->map, symbol_dso, sizeof(symbol_dso), annotate_opts.percent_type); 794 - 795 - ui_browser__gotorc_title(b, 0, 0); 796 - ui_browser__set_color(b, HE_COLORSET_ROOT); 797 - ui_browser__write_nstring(b, symbol_dso, b->width + 1); 774 + annotate_browser__show_function_title(browser); 798 775 return 0; 799 776 } 800 777