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

perf report/top: Add 'k' hotkey to zoom directly into the kernel map

As a convenience, equivalent to pressing Enter in a line with a kernel
symbol and then selecting "Zoom" into the kernel DSO.

Reviewed-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-vbnlnrpyfvz9deqoobtc3dz7@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+8 -1
+8 -1
tools/perf/ui/browsers/hists.c
··· 18 18 #include "../../util/evlist.h" 19 19 #include "../../util/header.h" 20 20 #include "../../util/hist.h" 21 + #include "../../util/machine.h" 21 22 #include "../../util/map.h" 23 + #include "../../util/maps.h" 22 24 #include "../../util/symbol.h" 23 25 #include "../../util/map_symbol.h" 24 26 #include "../../util/branch.h" ··· 2568 2566 if (!hists__has(browser->hists, dso) || map == NULL) 2569 2567 return 0; 2570 2568 2571 - if (asprintf(optstr, "Zoom %s %s DSO", 2569 + if (asprintf(optstr, "Zoom %s %s DSO (use the 'k' hotkey to zoom directly into the kernel)", 2572 2570 browser->hists->dso_filter ? "out of" : "into", 2573 2571 __map__is_kernel(map) ? "the Kernel" : map->dso->short_name) < 0) 2574 2572 return 0; ··· 2938 2936 "E Expand all callchains\n" \ 2939 2937 "F Toggle percentage of filtered entries\n" \ 2940 2938 "H Display column headers\n" \ 2939 + "k Zoom into the kernel map\n" \ 2941 2940 "L Change percent limit\n" \ 2942 2941 "m Display context menu\n" \ 2943 2942 "S Zoom into current Processor Socket\n" \ ··· 3035 3032 case 'd': 3036 3033 actions->ms.map = map; 3037 3034 do_zoom_dso(browser, actions); 3035 + continue; 3036 + case 'k': 3037 + if (browser->selection != NULL) 3038 + hists_browser__zoom_map(browser, browser->selection->maps->machine->vmlinux_map); 3038 3039 continue; 3039 3040 case 'V': 3040 3041 verbose = (verbose + 1) % 4;