aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/event.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2009-12-13 16:50:29 -0500
committerIngo Molnar <mingo@elte.hu>2009-12-14 10:57:17 -0500
commit4aa65636411ccb12f006a6ad593930655c445ff6 (patch)
tree0f494705a2a7631070a5372bb53f873684b001c2 /tools/perf/util/event.c
parentb3165f414416a717f72a376720564012af5a2e01 (diff)
perf session: Move kmaps to perf_session
There is still some more work to do to disentangle map creation from DSO loading, but this happens only for the kernel, and for the early adopters of perf diff, where this disentanglement matters most, we'll be testing different kernels, so no problem here. Further clarification: right now we create the kernel maps for the various modules and discontiguous kernel text maps when loading the DSO, we should do it as a two step process, first creating the maps, for multiple mappings with the same DSO store, then doing the dso load just once, for the first hit on one of the maps sharing this DSO backing store. 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: <1260741029-4430-6-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/event.c')
-rw-r--r--tools/perf/util/event.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 2d09c29b3a6c..222efb1fc3bd 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -256,7 +256,8 @@ int event__process_task(event_t *self, struct perf_session *session)
256 return 0; 256 return 0;
257} 257}
258 258
259void thread__find_addr_location(struct thread *self, u8 cpumode, 259void thread__find_addr_location(struct thread *self,
260 struct perf_session *session, u8 cpumode,
260 enum map_type type, u64 addr, 261 enum map_type type, u64 addr,
261 struct addr_location *al, 262 struct addr_location *al,
262 symbol_filter_t filter) 263 symbol_filter_t filter)
@@ -268,7 +269,7 @@ void thread__find_addr_location(struct thread *self, u8 cpumode,
268 269
269 if (cpumode & PERF_RECORD_MISC_KERNEL) { 270 if (cpumode & PERF_RECORD_MISC_KERNEL) {
270 al->level = 'k'; 271 al->level = 'k';
271 mg = kmaps; 272 mg = &session->kmaps;
272 } else if (cpumode & PERF_RECORD_MISC_USER) 273 } else if (cpumode & PERF_RECORD_MISC_USER)
273 al->level = '.'; 274 al->level = '.';
274 else { 275 else {
@@ -289,14 +290,14 @@ try_again:
289 * "[vdso]" dso, but for now lets use the old trick of looking 290 * "[vdso]" dso, but for now lets use the old trick of looking
290 * in the whole kernel symbol list. 291 * in the whole kernel symbol list.
291 */ 292 */
292 if ((long long)al->addr < 0 && mg != kmaps) { 293 if ((long long)al->addr < 0 && mg != &session->kmaps) {
293 mg = kmaps; 294 mg = &session->kmaps;
294 goto try_again; 295 goto try_again;
295 } 296 }
296 al->sym = NULL; 297 al->sym = NULL;
297 } else { 298 } else {
298 al->addr = al->map->map_ip(al->map, al->addr); 299 al->addr = al->map->map_ip(al->map, al->addr);
299 al->sym = map__find_symbol(al->map, al->addr, filter); 300 al->sym = map__find_symbol(al->map, session, al->addr, filter);
300 } 301 }
301} 302}
302 303
@@ -311,7 +312,7 @@ int event__preprocess_sample(const event_t *self, struct perf_session *session,
311 312
312 dump_printf(" ... thread: %s:%d\n", thread->comm, thread->pid); 313 dump_printf(" ... thread: %s:%d\n", thread->comm, thread->pid);
313 314
314 thread__find_addr_location(thread, cpumode, MAP__FUNCTION, 315 thread__find_addr_location(thread, session, cpumode, MAP__FUNCTION,
315 self->ip.ip, al, filter); 316 self->ip.ip, al, filter);
316 dump_printf(" ...... dso: %s\n", 317 dump_printf(" ...... dso: %s\n",
317 al->map ? al->map->dso->long_name : 318 al->map ? al->map->dso->long_name :