perf symbols: Ditch vdso global variable

We can check using strcmp, most DSOs don't start with '[' so the
test is cheap enough and we had to test it there anyway since
when reading perf.data files we weren't calling the routine that
created this global variable and thus weren't setting it as
"loaded", which was causing a bogus:

  Failed to open [vdso], continuing without symbols

Message as the first line of 'perf report'.

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: <1265223128-11786-3-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Arnaldo Carvalho de Melo
2010-02-03 16:52:02 -02:00
committed by Ingo Molnar
parent 6275ce2d5f
commit 8d92c02ab0
3 changed files with 15 additions and 24 deletions

View File

@ -53,11 +53,6 @@ bool dso__sorted_by_name(const struct dso *self, enum map_type type)
return self->sorted_by_name & (1 << type);
}
static void dso__set_loaded(struct dso *self, enum map_type type)
{
self->loaded |= (1 << type);
}
static void dso__set_sorted_by_name(struct dso *self, enum map_type type)
{
self->sorted_by_name |= (1 << type);
@ -1697,7 +1692,6 @@ out_fixup:
LIST_HEAD(dsos__user);
LIST_HEAD(dsos__kernel);
struct dso *vdso;
static void dsos__add(struct list_head *head, struct dso *dso)
{
@ -1790,24 +1784,12 @@ static struct dso *dsos__create_kernel(const char *vmlinux)
{
struct dso *kernel = dso__new_kernel(vmlinux);
if (kernel == NULL)
return NULL;
vdso = dso__new("[vdso]");
if (vdso == NULL)
goto out_delete_kernel_dso;
dso__set_loaded(vdso, MAP__FUNCTION);
dso__read_running_kernel_build_id(kernel);
dsos__add(&dsos__kernel, kernel);
dsos__add(&dsos__user, vdso);
if (kernel != NULL) {
dso__read_running_kernel_build_id(kernel);
dsos__add(&dsos__kernel, kernel);
}
return kernel;
out_delete_kernel_dso:
dso__delete(kernel);
return NULL;
}
int __map_groups__create_kernel_maps(struct map_groups *self,