diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-02-03 13:52:02 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-02-04 03:33:26 -0500 |
commit | 8d92c02ab07602786eaa6d4e5b519395730b3fd3 (patch) | |
tree | 3615a65a57f7e1de03af33440f550cdac22a38ce /tools | |
parent | 6275ce2d5f44ae4f8575c24724525cbb2a3a141b (diff) |
perf symbols: Ditch vdso global variable
We can check using strcmp, most DSOs don't start with '[' so the
test is cheap enough and we had to test it there anyway since
when reading perf.data files we weren't calling the routine that
created this global variable and thus weren't setting it as
"loaded", which was causing a bogus:
Failed to open [vdso], continuing without symbols
Message as the first line of 'perf report'.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
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>
LKML-Reference: <1265223128-11786-3-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/map.c | 7 | ||||
-rw-r--r-- | tools/perf/util/symbol.c | 26 | ||||
-rw-r--r-- | tools/perf/util/symbol.h | 6 |
3 files changed, 15 insertions, 24 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index 36ff0bf0315d..f6626cc3df2e 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c | |||
@@ -68,8 +68,13 @@ struct map *map__new(struct mmap_event *event, enum map_type type, | |||
68 | map__init(self, type, event->start, event->start + event->len, | 68 | map__init(self, type, event->start, event->start + event->len, |
69 | event->pgoff, dso); | 69 | event->pgoff, dso); |
70 | 70 | ||
71 | if (self->dso == vdso || anon) | 71 | if (anon) { |
72 | set_identity: | ||
72 | self->map_ip = self->unmap_ip = identity__map_ip; | 73 | self->map_ip = self->unmap_ip = identity__map_ip; |
74 | } else if (strcmp(filename, "[vdso]") == 0) { | ||
75 | dso__set_loaded(dso, self->type); | ||
76 | goto set_identity; | ||
77 | } | ||
73 | } | 78 | } |
74 | return self; | 79 | return self; |
75 | out_delete: | 80 | out_delete: |
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 051d71b33df0..e752837363ee 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -53,11 +53,6 @@ bool dso__sorted_by_name(const struct dso *self, enum map_type type) | |||
53 | return self->sorted_by_name & (1 << type); | 53 | return self->sorted_by_name & (1 << type); |
54 | } | 54 | } |
55 | 55 | ||
56 | static void dso__set_loaded(struct dso *self, enum map_type type) | ||
57 | { | ||
58 | self->loaded |= (1 << type); | ||
59 | } | ||
60 | |||
61 | static void dso__set_sorted_by_name(struct dso *self, enum map_type type) | 56 | static void dso__set_sorted_by_name(struct dso *self, enum map_type type) |
62 | { | 57 | { |
63 | self->sorted_by_name |= (1 << type); | 58 | self->sorted_by_name |= (1 << type); |
@@ -1697,7 +1692,6 @@ out_fixup: | |||
1697 | 1692 | ||
1698 | LIST_HEAD(dsos__user); | 1693 | LIST_HEAD(dsos__user); |
1699 | LIST_HEAD(dsos__kernel); | 1694 | LIST_HEAD(dsos__kernel); |
1700 | struct dso *vdso; | ||
1701 | 1695 | ||
1702 | static void dsos__add(struct list_head *head, struct dso *dso) | 1696 | static void dsos__add(struct list_head *head, struct dso *dso) |
1703 | { | 1697 | { |
@@ -1790,24 +1784,12 @@ static struct dso *dsos__create_kernel(const char *vmlinux) | |||
1790 | { | 1784 | { |
1791 | struct dso *kernel = dso__new_kernel(vmlinux); | 1785 | struct dso *kernel = dso__new_kernel(vmlinux); |
1792 | 1786 | ||
1793 | if (kernel == NULL) | 1787 | if (kernel != NULL) { |
1794 | return NULL; | 1788 | dso__read_running_kernel_build_id(kernel); |
1795 | 1789 | dsos__add(&dsos__kernel, kernel); | |
1796 | vdso = dso__new("[vdso]"); | 1790 | } |
1797 | if (vdso == NULL) | ||
1798 | goto out_delete_kernel_dso; | ||
1799 | dso__set_loaded(vdso, MAP__FUNCTION); | ||
1800 | |||
1801 | dso__read_running_kernel_build_id(kernel); | ||
1802 | |||
1803 | dsos__add(&dsos__kernel, kernel); | ||
1804 | dsos__add(&dsos__user, vdso); | ||
1805 | 1791 | ||
1806 | return kernel; | 1792 | return kernel; |
1807 | |||
1808 | out_delete_kernel_dso: | ||
1809 | dso__delete(kernel); | ||
1810 | return NULL; | ||
1811 | } | 1793 | } |
1812 | 1794 | ||
1813 | int __map_groups__create_kernel_maps(struct map_groups *self, | 1795 | int __map_groups__create_kernel_maps(struct map_groups *self, |
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index e6a59e5c2bea..e90568a9e467 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h | |||
@@ -121,6 +121,11 @@ void dso__delete(struct dso *self); | |||
121 | bool dso__loaded(const struct dso *self, enum map_type type); | 121 | bool dso__loaded(const struct dso *self, enum map_type type); |
122 | bool dso__sorted_by_name(const struct dso *self, enum map_type type); | 122 | bool dso__sorted_by_name(const struct dso *self, enum map_type type); |
123 | 123 | ||
124 | static inline void dso__set_loaded(struct dso *self, enum map_type type) | ||
125 | { | ||
126 | self->loaded |= (1 << type); | ||
127 | } | ||
128 | |||
124 | void dso__sort_by_name(struct dso *self, enum map_type type); | 129 | void dso__sort_by_name(struct dso *self, enum map_type type); |
125 | 130 | ||
126 | extern struct list_head dsos__user, dsos__kernel; | 131 | extern struct list_head dsos__user, dsos__kernel; |
@@ -161,5 +166,4 @@ int kallsyms__parse(const char *filename, void *arg, | |||
161 | int symbol__init(void); | 166 | int symbol__init(void); |
162 | bool symbol_type__is_a(char symbol_type, enum map_type map_type); | 167 | bool symbol_type__is_a(char symbol_type, enum map_type map_type); |
163 | 168 | ||
164 | extern struct dso *vdso; | ||
165 | #endif /* __PERF_SYMBOL */ | 169 | #endif /* __PERF_SYMBOL */ |