diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-11-27 13:29:21 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-11-27 14:22:01 -0500 |
commit | 1de8e24520ffdcf2a90c842eed937f59079a2abd (patch) | |
tree | bc64be9e0ad21502d7f9b27e9005fb9c3aec3aee /tools/perf | |
parent | 95011c600740837288a3b34b411244a4d9157c4e (diff) |
perf symbols: When not using modules, discard its symbols
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: <1259346563-12568-10-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/symbol.c | 6 | ||||
-rw-r--r-- | tools/perf/util/thread.h | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index b6a2941e7786..b788c2f5d672 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -381,6 +381,9 @@ static int dso__split_kallsyms(struct dso *self, struct map *map, struct thread | |||
381 | 381 | ||
382 | module = strchr(pos->name, '\t'); | 382 | module = strchr(pos->name, '\t'); |
383 | if (module) { | 383 | if (module) { |
384 | if (!thread->use_modules) | ||
385 | goto discard_symbol; | ||
386 | |||
384 | *module++ = '\0'; | 387 | *module++ = '\0'; |
385 | 388 | ||
386 | if (strcmp(self->name, module)) { | 389 | if (strcmp(self->name, module)) { |
@@ -420,7 +423,7 @@ static int dso__split_kallsyms(struct dso *self, struct map *map, struct thread | |||
420 | } | 423 | } |
421 | 424 | ||
422 | if (filter && filter(curr_map, pos)) { | 425 | if (filter && filter(curr_map, pos)) { |
423 | rb_erase(&pos->rb_node, root); | 426 | discard_symbol: rb_erase(&pos->rb_node, root); |
424 | symbol__delete(pos); | 427 | symbol__delete(pos); |
425 | } else { | 428 | } else { |
426 | if (curr_map != map) { | 429 | if (curr_map != map) { |
@@ -1635,6 +1638,7 @@ int symbol__init(struct symbol_conf *conf) | |||
1635 | return -1; | 1638 | return -1; |
1636 | } | 1639 | } |
1637 | 1640 | ||
1641 | kthread->use_modules = pconf->use_modules; | ||
1638 | if (pconf->use_modules && thread__create_module_maps(kthread) < 0) | 1642 | if (pconf->use_modules && thread__create_module_maps(kthread) < 0) |
1639 | pr_debug("Failed to load list of modules in use, " | 1643 | pr_debug("Failed to load list of modules in use, " |
1640 | "continuing...\n"); | 1644 | "continuing...\n"); |
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h index 3bdd9b2276f0..59b0d9b577d6 100644 --- a/tools/perf/util/thread.h +++ b/tools/perf/util/thread.h | |||
@@ -10,6 +10,7 @@ struct thread { | |||
10 | struct rb_root maps[MAP__NR_TYPES]; | 10 | struct rb_root maps[MAP__NR_TYPES]; |
11 | struct list_head removed_maps[MAP__NR_TYPES]; | 11 | struct list_head removed_maps[MAP__NR_TYPES]; |
12 | pid_t pid; | 12 | pid_t pid; |
13 | bool use_modules; | ||
13 | char shortname[3]; | 14 | char shortname[3]; |
14 | char *comm; | 15 | char *comm; |
15 | int comm_len; | 16 | int comm_len; |