aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorDavid Ahern <daahern@cisco.com>2010-12-07 21:39:46 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-12-09 08:07:07 -0500
commitb226a5a72901bc9c73d639ea2e53e6c304bf3b74 (patch)
tree3cc388b8450f95af1909c1ce00978b5db6ed17a5 /tools/perf
parent2c6cb1053ad8b61ab9fb50b578d0ffea959f7583 (diff)
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: David Ahern <daahern@cisco.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/Documentation/perf-report.txt3
-rw-r--r--tools/perf/builtin-report.c2
-rw-r--r--tools/perf/util/symbol.c9
-rw-r--r--tools/perf/util/symbol.h1
4 files changed, 13 insertions, 2 deletions
diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index 59a1f57f2bb7..fefea77ec6e9 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -104,6 +104,9 @@ OPTIONS
104--vmlinux=<file>:: 104--vmlinux=<file>::
105 vmlinux pathname 105 vmlinux pathname
106 106
107--kallsyms=<file>::
108 kallsyms pathname
109
107-m:: 110-m::
108--modules:: 111--modules::
109 Load module symbols. WARNING: This should only be used with -k and 112 Load module symbols. WARNING: This should only be used with -k and
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 904519fba434..b6a2a899aa8f 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -443,6 +443,8 @@ static const struct option options[] = {
443 "dump raw trace in ASCII"), 443 "dump raw trace in ASCII"),
444 OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name, 444 OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name,
445 "file", "vmlinux pathname"), 445 "file", "vmlinux pathname"),
446 OPT_STRING(0, "kallsyms", &symbol_conf.kallsyms_name,
447 "file", "kallsyms pathname"),
446 OPT_BOOLEAN('f', "force", &force, "don't complain, do it"), 448 OPT_BOOLEAN('f', "force", &force, "don't complain, do it"),
447 OPT_BOOLEAN('m', "modules", &symbol_conf.use_modules, 449 OPT_BOOLEAN('m', "modules", &symbol_conf.use_modules,
448 "load module symbols - WARNING: use only with -k and LIVE kernel"), 450 "load module symbols - WARNING: use only with -k and LIVE kernel"),
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index a348906b587d..f40c076aeb7b 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1830,8 +1830,8 @@ static int dso__load_kernel_sym(struct dso *self, struct map *map,
1830 const char *kallsyms_filename = NULL; 1830 const char *kallsyms_filename = NULL;
1831 char *kallsyms_allocated_filename = NULL; 1831 char *kallsyms_allocated_filename = NULL;
1832 /* 1832 /*
1833 * Step 1: if the user specified a vmlinux filename, use it and only 1833 * Step 1: if the user specified a kallsyms or vmlinux filename, use
1834 * it, reporting errors to the user if it cannot be used. 1834 * it and only it, reporting errors to the user if it cannot be used.
1835 * 1835 *
1836 * For instance, try to analyse an ARM perf.data file _without_ a 1836 * For instance, try to analyse an ARM perf.data file _without_ a
1837 * build-id, or if the user specifies the wrong path to the right 1837 * 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 * validation in dso__load_vmlinux and will bail out if they don't 1844 * validation in dso__load_vmlinux and will bail out if they don't
1845 * match. 1845 * match.
1846 */ 1846 */
1847 if (symbol_conf.kallsyms_name != NULL) {
1848 kallsyms_filename = symbol_conf.kallsyms_name;
1849 goto do_kallsyms;
1850 }
1851
1847 if (symbol_conf.vmlinux_name != NULL) { 1852 if (symbol_conf.vmlinux_name != NULL) {
1848 err = dso__load_vmlinux(self, map, 1853 err = dso__load_vmlinux(self, map,
1849 symbol_conf.vmlinux_name, filter); 1854 symbol_conf.vmlinux_name, filter);
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 038f2201ee09..12defbe18c13 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -72,6 +72,7 @@ struct symbol_conf {
72 show_cpu_utilization, 72 show_cpu_utilization,
73 initialized; 73 initialized;
74 const char *vmlinux_name, 74 const char *vmlinux_name,
75 *kallsyms_name,
75 *source_prefix, 76 *source_prefix,
76 *field_sep; 77 *field_sep;
77 const char *default_guest_vmlinux_name, 78 const char *default_guest_vmlinux_name,