diff options
| author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-10-30 14:28:24 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-11-02 10:52:11 -0500 |
| commit | 00a192b395b0606ad0265243844b3cd68e73420a (patch) | |
| tree | 09149f550807c365f170c857b1021d66e5bb8b4b /tools/perf/builtin-top.c | |
| parent | afb7b4f08e274cecd8337f9444affa288a9cd4c1 (diff) | |
perf tools: Simplify the symbol priv area mechanism
Before we were storing this in the DSO, but in fact this is a
property of the 'symbol' class, not something that will vary
among DSOs, so move it to a global variable and initialize it
using the existing symbol__init routine.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <1256927305-4628-2-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-top.c')
| -rw-r--r-- | tools/perf/builtin-top.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index ee87640b335..2aea913f7eb 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
| @@ -789,7 +789,7 @@ static int symbol_filter(struct map *map, struct symbol *sym) | |||
| 789 | strstr(name, "_text_end")) | 789 | strstr(name, "_text_end")) |
| 790 | return 1; | 790 | return 1; |
| 791 | 791 | ||
| 792 | syme = dso__sym_priv(map->dso, sym); | 792 | syme = symbol__priv(sym); |
| 793 | syme->map = map; | 793 | syme->map = map; |
| 794 | pthread_mutex_init(&syme->source_lock, NULL); | 794 | pthread_mutex_init(&syme->source_lock, NULL); |
| 795 | if (!sym_filter_entry && sym_filter && !strcmp(name, sym_filter)) | 795 | if (!sym_filter_entry && sym_filter && !strcmp(name, sym_filter)) |
| @@ -807,8 +807,7 @@ static int symbol_filter(struct map *map, struct symbol *sym) | |||
| 807 | 807 | ||
| 808 | static int parse_symbols(void) | 808 | static int parse_symbols(void) |
| 809 | { | 809 | { |
| 810 | if (dsos__load_kernel(vmlinux_name, sizeof(struct sym_entry), | 810 | if (dsos__load_kernel(vmlinux_name, symbol_filter, 1) <= 0) |
| 811 | symbol_filter, 1) <= 0) | ||
| 812 | return -1; | 811 | return -1; |
| 813 | 812 | ||
| 814 | if (dump_symtab) | 813 | if (dump_symtab) |
| @@ -859,7 +858,7 @@ static void event__process_sample(const event_t *self, int counter) | |||
| 859 | return; | 858 | return; |
| 860 | } | 859 | } |
| 861 | 860 | ||
| 862 | syme = dso__sym_priv(map->dso, sym); | 861 | syme = symbol__priv(sym); |
| 863 | 862 | ||
| 864 | if (!syme->skip) { | 863 | if (!syme->skip) { |
| 865 | syme->count[counter]++; | 864 | syme->count[counter]++; |
| @@ -878,8 +877,7 @@ static void event__process_mmap(event_t *self) | |||
| 878 | struct thread *thread = threads__findnew(self->mmap.pid); | 877 | struct thread *thread = threads__findnew(self->mmap.pid); |
| 879 | 878 | ||
| 880 | if (thread != NULL) { | 879 | if (thread != NULL) { |
| 881 | struct map *map = map__new(&self->mmap, NULL, 0, | 880 | struct map *map = map__new(&self->mmap, NULL, 0); |
| 882 | sizeof(struct sym_entry)); | ||
| 883 | if (map != NULL) | 881 | if (map != NULL) |
| 884 | thread__insert_map(thread, map); | 882 | thread__insert_map(thread, map); |
| 885 | } | 883 | } |
| @@ -1176,7 +1174,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __used) | |||
| 1176 | { | 1174 | { |
| 1177 | int counter; | 1175 | int counter; |
| 1178 | 1176 | ||
| 1179 | symbol__init(); | 1177 | symbol__init(sizeof(struct sym_entry)); |
| 1180 | 1178 | ||
| 1181 | page_size = sysconf(_SC_PAGE_SIZE); | 1179 | page_size = sysconf(_SC_PAGE_SIZE); |
| 1182 | 1180 | ||
