diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2013-08-07 07:38:51 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-08-07 16:35:33 -0400 |
commit | 8e0cf965f95edd41df11cca50b92b4cb6ea8d80a (patch) | |
tree | 08c55f2c5caaccf3c479a71fb730594164e8e23c /tools/perf/util/machine.c | |
parent | 0131c4ec794a7409eafff0c79105309540aaca4d (diff) |
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 <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1375875537-4509-8-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
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, | |||
856 | } | 856 | } |
857 | } | 857 | } |
858 | 858 | ||
859 | static bool machine__uses_kcore(struct machine *machine) | ||
860 | { | ||
861 | struct dso *dso; | ||
862 | |||
863 | list_for_each_entry(dso, &machine->kernel_dsos, node) { | ||
864 | if (dso__is_kcore(dso)) | ||
865 | return true; | ||
866 | } | ||
867 | |||
868 | return false; | ||
869 | } | ||
870 | |||
859 | static int machine__process_kernel_mmap_event(struct machine *machine, | 871 | static int machine__process_kernel_mmap_event(struct machine *machine, |
860 | union perf_event *event) | 872 | union perf_event *event) |
861 | { | 873 | { |
@@ -864,6 +876,10 @@ static int machine__process_kernel_mmap_event(struct machine *machine, | |||
864 | enum dso_kernel_type kernel_type; | 876 | enum dso_kernel_type kernel_type; |
865 | bool is_kernel_mmap; | 877 | bool is_kernel_mmap; |
866 | 878 | ||
879 | /* If we have maps from kcore then we do not need or want any others */ | ||
880 | if (machine__uses_kcore(machine)) | ||
881 | return 0; | ||
882 | |||
867 | machine__mmap_name(machine, kmmap_prefix, sizeof(kmmap_prefix)); | 883 | machine__mmap_name(machine, kmmap_prefix, sizeof(kmmap_prefix)); |
868 | if (machine__is_host(machine)) | 884 | if (machine__is_host(machine)) |
869 | kernel_type = DSO_TYPE_KERNEL; | 885 | kernel_type = DSO_TYPE_KERNEL; |