aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/event.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-03-24 15:40:15 -0400
committerIngo Molnar <mingo@elte.hu>2010-03-26 03:52:56 -0400
commit96415e4d3f5fdf9cdb12eedfcbc58152b1e1458c (patch)
treee7ec76fd8bc4c0d678c4c281e543f34eee37f42a /tools/perf/util/event.c
parent53c540195724b52422da067a31ef6916d2c70202 (diff)
perf symbols: Avoid unnecessary symbol loading when dso list is specified
We were performing the full thread__find_addr_location operation, i.e. resolving to a map/dso _and_ loading its symbols when we can optimize it by first calling thread__find_addr_map to find just the map/dso, check if it is one that we are interested in (passed via --dsos/-d in 'perf annotate', 'perf report', etc) and if not avoid loading the symtab. Nice speedup when we know which DSO we're interested in. 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: <1269459619-982-2-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.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 705ec63548b4..c2808ad3b76a 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -513,24 +513,32 @@ int event__preprocess_sample(const event_t *self, struct perf_session *session,
513 513
514 dump_printf(" ... thread: %s:%d\n", thread->comm, thread->pid); 514 dump_printf(" ... thread: %s:%d\n", thread->comm, thread->pid);
515 515
516 thread__find_addr_location(thread, session, cpumode, MAP__FUNCTION, 516 thread__find_addr_map(thread, session, cpumode, MAP__FUNCTION,
517 self->ip.ip, al, filter); 517 self->ip.ip, al);
518 dump_printf(" ...... dso: %s\n", 518 dump_printf(" ...... dso: %s\n",
519 al->map ? al->map->dso->long_name : 519 al->map ? al->map->dso->long_name :
520 al->level == 'H' ? "[hypervisor]" : "<not found>"); 520 al->level == 'H' ? "[hypervisor]" : "<not found>");
521 /* 521 al->sym = NULL;
522 * We have to do this here as we may have a dso with no symbol hit that 522
523 * has a name longer than the ones with symbols sampled. 523 if (al->map) {
524 */ 524 if (symbol_conf.dso_list &&
525 if (al->map && !sort_dso.elide && !al->map->dso->slen_calculated) 525 (!al->map || !al->map->dso ||
526 dso__calc_col_width(al->map->dso); 526 !(strlist__has_entry(symbol_conf.dso_list,
527 527 al->map->dso->short_name) ||
528 if (symbol_conf.dso_list && 528 (al->map->dso->short_name != al->map->dso->long_name &&
529 (!al->map || !al->map->dso || 529 strlist__has_entry(symbol_conf.dso_list,
530 !(strlist__has_entry(symbol_conf.dso_list, al->map->dso->short_name) || 530 al->map->dso->long_name)))))
531 (al->map->dso->short_name != al->map->dso->long_name && 531 goto out_filtered;
532 strlist__has_entry(symbol_conf.dso_list, al->map->dso->long_name))))) 532 /*
533 goto out_filtered; 533 * We have to do this here as we may have a dso with no symbol
534 * hit that has a name longer than the ones with symbols
535 * sampled.
536 */
537 if (!sort_dso.elide && !al->map->dso->slen_calculated)
538 dso__calc_col_width(al->map->dso);
539
540 al->sym = map__find_symbol(al->map, al->addr, filter);
541 }
534 542
535 if (symbol_conf.sym_list && al->sym && 543 if (symbol_conf.sym_list && al->sym &&
536 !strlist__has_entry(symbol_conf.sym_list, al->sym->name)) 544 !strlist__has_entry(symbol_conf.sym_list, al->sym->name))