From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>,
Ian Rogers <irogers@google.com>,
Kan Liang <kan.liang@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-perf-users@vger.kernel.org
Subject: [PATCH 2/3] perf annotate: Factor out annotate_browser__show_function_title()
Date: Sun, 7 Sep 2025 23:10:49 -0700 [thread overview]
Message-ID: <20250908061050.27517-2-namhyung@kernel.org> (raw)
In-Reply-To: <20250908061050.27517-1-namhyung@kernel.org>
It'll be used in other places.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/ui/browsers/annotate.c | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 6fd4c3483c5068ae..39f042837d438559 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -555,6 +555,20 @@ static int sym_title(struct symbol *sym, struct map *map, char *title,
annotate_opts.code_with_type ? "[Type]" : "");
}
+static void annotate_browser__show_function_title(struct annotate_browser *browser)
+{
+ struct ui_browser *b = &browser->b;
+ struct map_symbol *ms = b->priv;
+ struct symbol *sym = ms->sym;
+ char title[SYM_TITLE_MAX_SIZE];
+
+ sym_title(sym, ms->map, title, sizeof(title), annotate_opts.percent_type);
+
+ ui_browser__gotorc_title(b, 0, 0);
+ ui_browser__set_color(b, HE_COLORSET_ROOT);
+ ui_browser__write_nstring(b, title, b->width + 1);
+}
+
/*
* This can be called from external jumps, i.e. jumps from one function
* to another, like from the kernel's entry_SYSCALL_64 function to the
@@ -768,19 +782,10 @@ bool annotate_browser__continue_search_reverse(struct annotate_browser *browser,
static int annotate_browser__show(struct annotate_browser *browser, char *title, const char *help)
{
- struct ui_browser *b = &browser->b;
- struct map_symbol *ms = b->priv;
- struct symbol *sym = ms->sym;
- char symbol_dso[SYM_TITLE_MAX_SIZE];
-
- if (ui_browser__show(b, title, help) < 0)
+ if (ui_browser__show(&browser->b, title, help) < 0)
return -1;
- sym_title(sym, ms->map, symbol_dso, sizeof(symbol_dso), annotate_opts.percent_type);
-
- ui_browser__gotorc_title(b, 0, 0);
- ui_browser__set_color(b, HE_COLORSET_ROOT);
- ui_browser__write_nstring(b, symbol_dso, b->width + 1);
+ annotate_browser__show_function_title(browser);
return 0;
}
--
2.51.0
next prev parent reply other threads:[~2025-09-08 6:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-08 6:10 [PATCH 1/3] perf annotate: Fix signatue of annotate_browser__show() Namhyung Kim
2025-09-08 6:10 ` Namhyung Kim [this message]
2025-09-08 6:10 ` [PATCH 3/3] perf annotate: Fix title line after return from call Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250908061050.27517-2-namhyung@kernel.org \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®