diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-04-01 18:12:13 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-04-02 15:28:20 -0400 |
commit | e727ca73f85d4c5be3547eda674168219d1c22d8 (patch) | |
tree | be77d34b7dc8b3ed30c1ce0eb17f0b08d8c517ed /tools/perf | |
parent | a4e3b956a820162b7c1d616117b4f23b6017f504 (diff) |
perf kmem: Resolve kernel symbols again
Due to the assumption in perf_session__new that the kernel maps would be
created using the fake PERF_RECORD_MMAP event in a perf.data file 'perf
kmem --stat caller', that doesn't have such event, ends up not being
able to resolve the kernel addresses.
Fix it by calling perf_session__create_kernel_maps() in __cmd_kmem().
LKML-Reference: <new-submission>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/builtin-kmem.c | 3 | ||||
-rw-r--r-- | tools/perf/util/session.c | 5 | ||||
-rw-r--r-- | tools/perf/util/session.h | 5 |
3 files changed, 8 insertions, 5 deletions
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c index 32edb6a86876..7cbb5eb15101 100644 --- a/tools/perf/builtin-kmem.c +++ b/tools/perf/builtin-kmem.c | |||
@@ -489,6 +489,9 @@ static int __cmd_kmem(void) | |||
489 | if (session == NULL) | 489 | if (session == NULL) |
490 | return -ENOMEM; | 490 | return -ENOMEM; |
491 | 491 | ||
492 | if (perf_session__create_kernel_maps(session) < 0) | ||
493 | goto out_delete; | ||
494 | |||
492 | if (!perf_session__has_traces(session, "kmem record")) | 495 | if (!perf_session__has_traces(session, "kmem record")) |
493 | goto out_delete; | 496 | goto out_delete; |
494 | 497 | ||
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 32765cdca058..9da5e723495c 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
@@ -52,11 +52,6 @@ out_close: | |||
52 | return -1; | 52 | return -1; |
53 | } | 53 | } |
54 | 54 | ||
55 | static inline int perf_session__create_kernel_maps(struct perf_session *self) | ||
56 | { | ||
57 | return map_groups__create_kernel_maps(&self->kmaps, self->vmlinux_maps); | ||
58 | } | ||
59 | |||
60 | struct perf_session *perf_session__new(const char *filename, int mode, bool force) | 55 | struct perf_session *perf_session__new(const char *filename, int mode, bool force) |
61 | { | 56 | { |
62 | size_t len = filename ? strlen(filename) + 1 : 0; | 57 | size_t len = filename ? strlen(filename) + 1 : 0; |
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h index 6a15daeda577..dffaff52ba44 100644 --- a/tools/perf/util/session.h +++ b/tools/perf/util/session.h | |||
@@ -80,6 +80,11 @@ static inline int __perf_session__create_kernel_maps(struct perf_session *self, | |||
80 | self->vmlinux_maps, kernel); | 80 | self->vmlinux_maps, kernel); |
81 | } | 81 | } |
82 | 82 | ||
83 | static inline int perf_session__create_kernel_maps(struct perf_session *self) | ||
84 | { | ||
85 | return map_groups__create_kernel_maps(&self->kmaps, self->vmlinux_maps); | ||
86 | } | ||
87 | |||
83 | static inline struct map * | 88 | static inline struct map * |
84 | perf_session__new_module_map(struct perf_session *self, | 89 | perf_session__new_module_map(struct perf_session *self, |
85 | u64 start, const char *filename) | 90 | u64 start, const char *filename) |