diff options
| author | Adrian Hunter <[email protected]> | 2013-08-07 11:38:51 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2013-08-07 20:35:33 +0000 |
| commit | 8e0cf965f95edd41df11cca50b92b4cb6ea8d80a (patch) | |
| tree | 08c55f2c5caaccf3c479a71fb730594164e8e23c /tools/perf/util/machine.c | |
| parent | perf tools: Make it possible to read object code from kernel modules (diff) | |
| download | kernel-8e0cf965f95edd41df11cca50b92b4cb6ea8d80a.tar.gz kernel-8e0cf965f95edd41df11cca50b92b4cb6ea8d80a.zip | |
perf symbols: Add support for reading from /proc/kcore
In the absence of vmlinux, perf tools uses kallsyms for symbols. If the
user has access, now also map to /proc/kcore.
The dso data_type is now set to either DSO_BINARY_TYPE__KCORE or
DSO_BINARY_TYPE__GUEST_KCORE as approprite.
This patch breaks the "vmlinux symtab matches kallsyms" test. That is
fixed in a following patch.
Signed-off-by: Adrian Hunter <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/util/machine.c')
| -rw-r--r-- | tools/perf/util/machine.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index dc35dcffbd05..ef3b49cde04e 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -856,6 +856,18 @@ static void machine__set_kernel_mmap_len(struct machine *machine, } } +static bool machine__uses_kcore(struct machine *machine) +{ + struct dso *dso; + + list_for_each_entry(dso, &machine->kernel_dsos, node) { + if (dso__is_kcore(dso)) + return true; + } + + return false; +} + static int machine__process_kernel_mmap_event(struct machine *machine, union perf_event *event) { @@ -864,6 +876,10 @@ static int machine__process_kernel_mmap_event(struct machine *machine, enum dso_kernel_type kernel_type; bool is_kernel_mmap; + /* If we have maps from kcore then we do not need or want any others */ + if (machine__uses_kcore(machine)) + return 0; + machine__mmap_name(machine, kmmap_prefix, sizeof(kmmap_prefix)); if (machine__is_host(machine)) kernel_type = DSO_TYPE_KERNEL; |
