Commit b226a5a7 authored by David Ahern's avatar David Ahern Committed by Arnaldo Carvalho de Melo

perf report: Allow user to specify path to kallsyms file

This is useful for analyzing a perf data file on a different system than
the one data was collected on and still include symbols from loaded
kernel modules in the output.

Commiter note: Updated the man page accordingly.

LKML-Reference: <1291775986-16475-1-git-send-email-daahern@cisco.com>
Signed-off-by: default avatarDavid Ahern <daahern@cisco.com>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 2c6cb105
...@@ -104,6 +104,9 @@ OPTIONS ...@@ -104,6 +104,9 @@ OPTIONS
--vmlinux=<file>:: --vmlinux=<file>::
vmlinux pathname vmlinux pathname
--kallsyms=<file>::
kallsyms pathname
-m:: -m::
--modules:: --modules::
Load module symbols. WARNING: This should only be used with -k and Load module symbols. WARNING: This should only be used with -k and
......
...@@ -443,6 +443,8 @@ static const struct option options[] = { ...@@ -443,6 +443,8 @@ static const struct option options[] = {
"dump raw trace in ASCII"), "dump raw trace in ASCII"),
OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name, OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name,
"file", "vmlinux pathname"), "file", "vmlinux pathname"),
OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name,
"file", "kallsyms pathname"),
OPT_BOOLEAN('f', "force", &force, "don't complain, do it"), OPT_BOOLEAN('f', "force", &force, "don't complain, do it"),
OPT_BOOLEAN('m', "modules", &symbol_conf.use_modules, OPT_BOOLEAN('m', "modules", &symbol_conf.use_modules,
"load module symbols - WARNING: use only with -k and LIVE kernel"), "load module symbols - WARNING: use only with -k and LIVE kernel"),
......
...@@ -1830,8 +1830,8 @@ static int dso__load_kernel_sym(struct dso *self, struct map *map, ...@@ -1830,8 +1830,8 @@ static int dso__load_kernel_sym(struct dso *self, struct map *map,
const char *kallsyms_filename = NULL; const char *kallsyms_filename = NULL;
char *kallsyms_allocated_filename = NULL; char *kallsyms_allocated_filename = NULL;
/* /*
* Step 1: if the user specified a vmlinux filename, use it and only * Step 1: if the user specified a kallsyms or vmlinux filename, use
* it, reporting errors to the user if it cannot be used. * it and only it, reporting errors to the user if it cannot be used.
* *
* For instance, try to analyse an ARM perf.data file _without_ a * For instance, try to analyse an ARM perf.data file _without_ a
* build-id, or if the user specifies the wrong path to the right * build-id, or if the user specifies the wrong path to the right
...@@ -1844,6 +1844,11 @@ static int dso__load_kernel_sym(struct dso *self, struct map *map, ...@@ -1844,6 +1844,11 @@ static int dso__load_kernel_sym(struct dso *self, struct map *map,
* validation in dso__load_vmlinux and will bail out if they don't * validation in dso__load_vmlinux and will bail out if they don't
* match. * match.
*/ */
if (symbol_conf.kallsyms_name != NULL) {
kallsyms_filename = symbol_conf.kallsyms_name;
goto do_kallsyms;
}
if (symbol_conf.vmlinux_name != NULL) { if (symbol_conf.vmlinux_name != NULL) {
err = dso__load_vmlinux(self, map, err = dso__load_vmlinux(self, map,
symbol_conf.vmlinux_name, filter); symbol_conf.vmlinux_name, filter);
......
...@@ -72,6 +72,7 @@ struct symbol_conf { ...@@ -72,6 +72,7 @@ struct symbol_conf {
show_cpu_utilization, show_cpu_utilization,
initialized; initialized;
const char *vmlinux_name, const char *vmlinux_name,
*kallsyms_name,
*source_prefix, *source_prefix,
*field_sep; *field_sep;
const char *default_guest_vmlinux_name, const char *default_guest_vmlinux_name,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment