mirror of
https://github.com/torvalds/linux.git
synced 2026-06-05 04:56:13 +02:00
perf annotate: Add 'T' hot key to toggle data type display
Support data type display with a key press so that users can toggle the output dynamically on TUI. Also display "[Type]" in the title line if it's enabled. 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> Link: https://lore.kernel.org/r/20250816031635.25318-9-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
7dbe89ca3d
commit
1d4374afd0
|
|
@ -533,9 +533,10 @@ static void ui_browser__init_asm_mode(struct ui_browser *browser)
|
||||||
static int sym_title(struct symbol *sym, struct map *map, char *title,
|
static int sym_title(struct symbol *sym, struct map *map, char *title,
|
||||||
size_t sz, int percent_type)
|
size_t sz, int percent_type)
|
||||||
{
|
{
|
||||||
return snprintf(title, sz, "%s %s [Percent: %s]", sym->name,
|
return snprintf(title, sz, "%s %s [Percent: %s] %s", sym->name,
|
||||||
dso__long_name(map__dso(map)),
|
dso__long_name(map__dso(map)),
|
||||||
percent_type_str(percent_type));
|
percent_type_str(percent_type),
|
||||||
|
annotate_opts.code_with_type ? "[Type]" : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -909,7 +910,8 @@ static int annotate_browser__run(struct annotate_browser *browser,
|
||||||
"b Toggle percent base [period/hits]\n"
|
"b Toggle percent base [period/hits]\n"
|
||||||
"B Branch counter abbr list (Optional)\n"
|
"B Branch counter abbr list (Optional)\n"
|
||||||
"? Search string backwards\n"
|
"? Search string backwards\n"
|
||||||
"f Toggle showing offsets to full address\n");
|
"f Toggle showing offsets to full address\n"
|
||||||
|
"T Toggle data type display\n");
|
||||||
continue;
|
continue;
|
||||||
case 'r':
|
case 'r':
|
||||||
script_browse(NULL, NULL);
|
script_browse(NULL, NULL);
|
||||||
|
|
@ -1029,6 +1031,12 @@ static int annotate_browser__run(struct annotate_browser *browser,
|
||||||
case 'f':
|
case 'f':
|
||||||
annotation__toggle_full_addr(notes, ms);
|
annotation__toggle_full_addr(notes, ms);
|
||||||
continue;
|
continue;
|
||||||
|
case 'T':
|
||||||
|
annotate_opts.code_with_type ^= 1;
|
||||||
|
if (browser->dbg == NULL)
|
||||||
|
browser->dbg = debuginfo__new(dso__long_name(map__dso(ms->map)));
|
||||||
|
annotate_browser__show(&browser->b, title, help);
|
||||||
|
continue;
|
||||||
case K_LEFT:
|
case K_LEFT:
|
||||||
case '<':
|
case '<':
|
||||||
case '>':
|
case '>':
|
||||||
|
|
@ -1133,8 +1141,7 @@ int __hist_entry__tui_annotate(struct hist_entry *he, struct map_symbol *ms,
|
||||||
|
|
||||||
ret = annotate_browser__run(&browser, evsel, hbt);
|
ret = annotate_browser__run(&browser, evsel, hbt);
|
||||||
|
|
||||||
if (annotate_opts.code_with_type)
|
debuginfo__delete(browser.dbg);
|
||||||
debuginfo__delete(browser.dbg);
|
|
||||||
if (not_annotated && !notes->src->tried_source)
|
if (not_annotated && !notes->src->tried_source)
|
||||||
annotated_source__purge(notes->src);
|
annotated_source__purge(notes->src);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user