aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
authorMike Galbraith <efault@gmx.de>2009-07-02 02:09:46 -0400
committerIngo Molnar <mingo@elte.hu>2009-07-02 02:42:21 -0400
commit429764873cf3fc3e73142872a674bb27cda589c1 (patch)
treea7c11887ad7aa055f56276a14acbe004d0ead434 /tools/perf/builtin-report.c
parent6cfcc53ed4f3ecb9319e73a03f34f1eddcb644dd (diff)
perf_counter tools: Enable kernel module symbol loading in tools
Add the -m/--modules option to perf report and perf annotate, which enables live module symbol/image loading. To be used with -k/--vmlinux. (Also give perf annotate a -P/--full-paths option.) Signed-off-by: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> LKML-Reference: <1246514986.13293.48.camel@marge.simson.net> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 38d136fedfb9..b44476ca2398 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -46,6 +46,8 @@ static int dump_trace = 0;
46static int verbose; 46static int verbose;
47#define eprintf(x...) do { if (verbose) fprintf(stderr, x); } while (0) 47#define eprintf(x...) do { if (verbose) fprintf(stderr, x); } while (0)
48 48
49static int modules;
50
49static int full_paths; 51static int full_paths;
50 52
51static unsigned long page_size; 53static unsigned long page_size;
@@ -188,7 +190,7 @@ static int load_kernel(void)
188 if (!kernel_dso) 190 if (!kernel_dso)
189 return -1; 191 return -1;
190 192
191 err = dso__load_kernel(kernel_dso, vmlinux, NULL, verbose, 0); 193 err = dso__load_kernel(kernel_dso, vmlinux, NULL, verbose, modules);
192 if (err <= 0) { 194 if (err <= 0) {
193 dso__delete(kernel_dso); 195 dso__delete(kernel_dso);
194 kernel_dso = NULL; 196 kernel_dso = NULL;
@@ -648,6 +650,9 @@ sort__sym_print(FILE *fp, struct hist_entry *self)
648 ret += fprintf(fp, "[%c] %s", 650 ret += fprintf(fp, "[%c] %s",
649 self->dso == kernel_dso ? 'k' : 651 self->dso == kernel_dso ? 'k' :
650 self->dso == hypervisor_dso ? 'h' : '.', self->sym->name); 652 self->dso == hypervisor_dso ? 'h' : '.', self->sym->name);
653
654 if (self->sym->module)
655 ret += fprintf(fp, "\t[%s]", self->sym->module->name);
651 } else { 656 } else {
652 ret += fprintf(fp, "%#016llx", (u64)self->ip); 657 ret += fprintf(fp, "%#016llx", (u64)self->ip);
653 } 658 }
@@ -1710,6 +1715,8 @@ static const struct option options[] = {
1710 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace, 1715 OPT_BOOLEAN('D', "dump-raw-trace", &dump_trace,
1711 "dump raw trace in ASCII"), 1716 "dump raw trace in ASCII"),
1712 OPT_STRING('k', "vmlinux", &vmlinux, "file", "vmlinux pathname"), 1717 OPT_STRING('k', "vmlinux", &vmlinux, "file", "vmlinux pathname"),
1718 OPT_BOOLEAN('m', "modules", &modules,
1719 "load module symbols - WARNING: use only with -k and LIVE kernel"),
1713 OPT_STRING('s', "sort", &sort_order, "key[,key2...]", 1720 OPT_STRING('s', "sort", &sort_order, "key[,key2...]",
1714 "sort by key(s): pid, comm, dso, symbol, parent"), 1721 "sort by key(s): pid, comm, dso, symbol, parent"),
1715 OPT_BOOLEAN('P', "full-paths", &full_paths, 1722 OPT_BOOLEAN('P', "full-paths", &full_paths,