]> www.infradead.org Git - users/hch/misc.git/commitdiff
perf annotate: Fix title line after return from call
authorNamhyung Kim <namhyung@kernel.org>
Mon, 8 Sep 2025 06:10:50 +0000 (23:10 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 9 Sep 2025 18:12:33 +0000 (15:12 -0300)
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>
tools/perf/ui/browsers/annotate.c

index 39f042837d4385592407ce35a36691a0ec18bcf5..8fe699f985423eab44b4080b915ac6d8a329165b 100644 (file)
@@ -585,7 +585,6 @@ static bool annotate_browser__callq(struct annotate_browser *browser,
        struct map_symbol *ms = browser->b.priv, target_ms;
        struct disasm_line *dl = disasm_line(browser->selection);
        struct annotation *notes;
-       char title[SYM_TITLE_MAX_SIZE];
 
        if (!dl->ops.target.sym) {
                ui_helpline__puts("The called function was not found.");
@@ -607,8 +606,13 @@ static bool annotate_browser__callq(struct annotate_browser *browser,
        target_ms.sym = dl->ops.target.sym;
        annotation__unlock(notes);
        __hist_entry__tui_annotate(browser->he, &target_ms, evsel, hbt);
-       sym_title(ms->sym, ms->map, title, sizeof(title), annotate_opts.percent_type);
-       ui_browser__show_title(&browser->b, title);
+
+       /*
+        * The annotate_browser above changed the title with the target function
+        * and now it's back to the original function.  Refresh the header line
+        * for the original function again.
+        */
+       annotate_browser__show_function_title(browser);
        return true;
 }