Skip to content

Commit 209f4e7

Browse files
committed
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>
1 parent 632003f commit 209f4e7

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎tools/perf/ui/browsers/hists.c‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
#include "../../util/evlist.h"
1919
#include "../../util/header.h"
2020
#include "../../util/hist.h"
21+
#include "../../util/machine.h"
2122
#include "../../util/map.h"
23+
#include "../../util/maps.h"
2224
#include "../../util/symbol.h"
2325
#include "../../util/map_symbol.h"
2426
#include "../../util/branch.h"
@@ -2566,7 +2568,7 @@ add_dso_opt(struct hist_browser *browser, struct popup_action *act,
25662568
if (!hists__has(browser->hists, dso) || map == NULL)
25672569
return 0;
25682570

2569-
if (asprintf(optstr, "Zoom %s %s DSO",
2571+
if (asprintf(optstr, "Zoom %s %s DSO (use the 'k' hotkey to zoom directly into the kernel)",
25702572
browser->hists->dso_filter ? "out of" : "into",
25712573
__map__is_kernel(map) ? "the Kernel" : map->dso->short_name) < 0)
25722574
return 0;
@@ -2936,6 +2938,7 @@ static int perf_evsel__hists_browse(struct evsel *evsel, int nr_events,
29362938
"E Expand all callchains\n" \
29372939
"F Toggle percentage of filtered entries\n" \
29382940
"H Display column headers\n" \
2941+
"k Zoom into the kernel map\n" \
29392942
"L Change percent limit\n" \
29402943
"m Display context menu\n" \
29412944
"S Zoom into current Processor Socket\n" \
@@ -3033,6 +3036,10 @@ static int perf_evsel__hists_browse(struct evsel *evsel, int nr_events,
30333036
actions->ms.map = map;
30343037
do_zoom_dso(browser, actions);
30353038
continue;
3039+
case 'k':
3040+
if (browser->selection != NULL)
3041+
hists_browser__zoom_map(browser, browser->selection->maps->machine->vmlinux_map);
3042+
continue;
30363043
case 'V':
30373044
verbose = (verbose + 1) % 4;
30383045
browser->show_dso = verbose > 0;

0 commit comments

Comments
 (0)