diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-12-16 12:33:49 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-16 12:33:49 -0500 |
commit | ee1156c11a1121e118b0a7f2dec240f0d421b1fd (patch) | |
tree | b8771cc5a9758af9d7410fc519227c036c222130 /tools/perf/util/map.c | |
parent | b9f8fcd55bbdb037e5332dbdb7b494f0b70861ac (diff) | |
parent | 8bea8672edfca7ec5f661cafb218f1205863b343 (diff) |
Merge branch 'linus' into sched/urgent
Conflicts:
kernel/sched_idletask.c
Merge reason: resolve the conflicts, pick up latest changes.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/map.c')
-rw-r--r-- | tools/perf/util/map.c | 87 |
1 files changed, 54 insertions, 33 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index 69f94fe9db20..76bdca640a9b 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c | |||
@@ -104,43 +104,64 @@ void map__fixup_end(struct map *self) | |||
104 | 104 | ||
105 | #define DSO__DELETED "(deleted)" | 105 | #define DSO__DELETED "(deleted)" |
106 | 106 | ||
107 | struct symbol *map__find_symbol(struct map *self, u64 addr, | 107 | static int map__load(struct map *self, symbol_filter_t filter) |
108 | symbol_filter_t filter) | ||
109 | { | 108 | { |
110 | if (!dso__loaded(self->dso, self->type)) { | 109 | const char *name = self->dso->long_name; |
111 | int nr = dso__load(self->dso, self, filter); | 110 | int nr = dso__load(self->dso, self, filter); |
112 | 111 | ||
113 | if (nr < 0) { | 112 | if (nr < 0) { |
114 | if (self->dso->has_build_id) { | 113 | if (self->dso->has_build_id) { |
115 | char sbuild_id[BUILD_ID_SIZE * 2 + 1]; | 114 | char sbuild_id[BUILD_ID_SIZE * 2 + 1]; |
116 | 115 | ||
117 | build_id__sprintf(self->dso->build_id, | 116 | build_id__sprintf(self->dso->build_id, |
118 | sizeof(self->dso->build_id), | 117 | sizeof(self->dso->build_id), |
119 | sbuild_id); | 118 | sbuild_id); |
120 | pr_warning("%s with build id %s not found", | 119 | pr_warning("%s with build id %s not found", |
121 | self->dso->long_name, sbuild_id); | 120 | name, sbuild_id); |
122 | } else | 121 | } else |
123 | pr_warning("Failed to open %s", | 122 | pr_warning("Failed to open %s", name); |
124 | self->dso->long_name); | 123 | |
125 | pr_warning(", continuing without symbols\n"); | 124 | pr_warning(", continuing without symbols\n"); |
126 | return NULL; | 125 | return -1; |
127 | } else if (nr == 0) { | 126 | } else if (nr == 0) { |
128 | const char *name = self->dso->long_name; | 127 | const size_t len = strlen(name); |
129 | const size_t len = strlen(name); | 128 | const size_t real_len = len - sizeof(DSO__DELETED); |
130 | const size_t real_len = len - sizeof(DSO__DELETED); | 129 | |
131 | 130 | if (len > sizeof(DSO__DELETED) && | |
132 | if (len > sizeof(DSO__DELETED) && | 131 | strcmp(name + real_len + 1, DSO__DELETED) == 0) { |
133 | strcmp(name + real_len + 1, DSO__DELETED) == 0) { | 132 | pr_warning("%.*s was updated, restart the long " |
134 | pr_warning("%.*s was updated, restart the long running apps that use it!\n", | 133 | "running apps that use it!\n", |
135 | (int)real_len, name); | 134 | (int)real_len, name); |
136 | } else { | 135 | } else { |
137 | pr_warning("no symbols found in %s, maybe install a debug package?\n", name); | 136 | pr_warning("no symbols found in %s, maybe install " |
138 | } | 137 | "a debug package?\n", name); |
139 | return NULL; | ||
140 | } | 138 | } |
139 | |||
140 | return -1; | ||
141 | } | 141 | } |
142 | 142 | ||
143 | return self->dso->find_symbol(self->dso, self->type, addr); | 143 | return 0; |
144 | } | ||
145 | |||
146 | struct symbol *map__find_symbol(struct map *self, u64 addr, | ||
147 | symbol_filter_t filter) | ||
148 | { | ||
149 | if (!dso__loaded(self->dso, self->type) && map__load(self, filter) < 0) | ||
150 | return NULL; | ||
151 | |||
152 | return dso__find_symbol(self->dso, self->type, addr); | ||
153 | } | ||
154 | |||
155 | struct symbol *map__find_symbol_by_name(struct map *self, const char *name, | ||
156 | symbol_filter_t filter) | ||
157 | { | ||
158 | if (!dso__loaded(self->dso, self->type) && map__load(self, filter) < 0) | ||
159 | return NULL; | ||
160 | |||
161 | if (!dso__sorted_by_name(self->dso, self->type)) | ||
162 | dso__sort_by_name(self->dso, self->type); | ||
163 | |||
164 | return dso__find_symbol_by_name(self->dso, self->type, name); | ||
144 | } | 165 | } |
145 | 166 | ||
146 | struct map *map__clone(struct map *self) | 167 | struct map *map__clone(struct map *self) |