Skip to contentSkip to conversation

perf top: Allow passing a kallsyms file

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Dec 14, 2018 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  5f71b002bbc6d73b875f250db9a8093feac0d1cc
Gitweb:     https://git.kernel.org/tip/5f71b002bbc6d73b875f250db9a8093feac0d1cc
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Tue, 27 Nov 2018 10:31:03 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Thu, 29 Nov 2018 20:42:49 -0300

perf top: Allow passing a kallsyms file

This basically replicates what was done for 'perf report' in:

b226a5a72901 ("perf report: Allow user to specify path to kallsyms file")

This should help with resolving eBPF symbols, that are in kallsyms but, of course, not in vmlinux.

---
 tools/perf/Documentation/perf-top.txt | 3 +++
 tools/perf/builtin-top.c              | 2 ++
 2 files changed, 5 insertions(+)
tools/perf/Documentation/perf-top.txt +3 -0
index 808b664343c9..44d89fb9c788 100644
@@ -70,6 +70,9 @@ Default is to monitor all CPUS.
 --ignore-vmlinux::
 	Ignore vmlinux files.
 
+--kallsyms=<file>::
+	kallsyms pathname
+
 -m <pages>::
 --mmap-pages=<pages>::
 	Number of mmap data pages (must be a power of two) or size
tools/perf/builtin-top.c +2 -0
index aa0c73e57924..1252d1759064 100644
@@ -1289,6 +1289,8 @@ int cmd_top(int argc, const char **argv)
 		   "file", "vmlinux pathname"),
 	OPT_BOOLEAN(0, "ignore-vmlinux", &symbol_conf.ignore_vmlinux,
 		    "don't load vmlinux even if found"),
+	OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name,
+		   "file", "kallsyms pathname"),
 	OPT_BOOLEAN('K', "hide_kernel_symbols", &top.hide_kernel_symbols,
 		    "hide kernel symbols"),
 	OPT_CALLBACK('m', "mmap-pages", &opts->mmap_pages, "pages",