aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/builtin-top.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2009-10-30 16:28:24 -0200
committerIngo Molnar <mingo@elte.hu>2009-11-02 16:52:11 +0100
commit00a192b395b0606ad0265243844b3cd68e73420a (patch)
tree09149f550807c365f170c857b1021d66e5bb8b4b /tools/perf/builtin-top.c
parentafb7b4f08e274cecd8337f9444affa288a9cd4c1 (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.c12
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)
strstr(name, "_text_end"))
return 1;
- syme = dso__sym_priv(map->dso, sym);
+ syme = symbol__priv(sym);
syme->map = map;
pthread_mutex_init(&syme->source_lock, NULL);
if (!sym_filter_entry && sym_filter && !strcmp(name, sym_filter))
@@ -807,8 +807,7 @@ static int symbol_filter(struct map *map, struct symbol *sym)
static int parse_symbols(void)
{
- if (dsos__load_kernel(vmlinux_name, sizeof(struct sym_entry),
- symbol_filter, 1) <= 0)
+ if (dsos__load_kernel(vmlinux_name, symbol_filter, 1) <= 0)
return -1;
if (dump_symtab)
@@ -859,7 +858,7 @@ static void event__process_sample(const event_t *self, int counter)
return;
}
- syme = dso__sym_priv(map->dso, sym);
+ syme = symbol__priv(sym);
if (!syme->skip) {
syme->count[counter]++;
@@ -878,8 +877,7 @@ static void event__process_mmap(event_t *self)
struct thread *thread = threads__findnew(self->mmap.pid);
if (thread != NULL) {
- struct map *map = map__new(&self->mmap, NULL, 0,
- sizeof(struct sym_entry));
+ struct map *map = map__new(&self->mmap, NULL, 0);
if (map != NULL)
thread__insert_map(thread, map);
}
@@ -1176,7 +1174,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __used)
{
int counter;
- symbol__init();
+ symbol__init(sizeof(struct sym_entry));
page_size = sysconf(_SC_PAGE_SIZE);