Em Fri, Jan 28, 2011 at 02:11:33PM -0800, Arun Sharma escreveu: > Symbolize binaries which don't have buildids and are stripped, but have a .dynsym. > > Signed-off-by: Arun Sharma Sorry for taking soooo long to look at this, as I mentioned some time ago I wasn't on the CC list, so it fell thru the cracks. Srikar just mentioned that to me and by coincidence I was working on fixing bugs on cross analysis, collecting perf.data files on a ppc64 system to run report on my workstation, a x86_64 machine.o But if we do as in your patch we will miss looking for the .dynsym on the build id cache (DSO__ORIG_BUILD_ID_CACHE): [acme@emilia ~]$ cat want_symtab.c #include int main(void) { int origin, want_symtab; for (origin = 0, want_symtab = 1; origin < 5; ++origin) { printf("origin=%d, want_symtab=%d\n", origin, want_symtab); if (origin == 4 && want_symtab) { want_symtab = 0; origin = 0; continue; } } } [acme@emilia ~]$ ./want_symtab origin=0, want_symtab=1 origin=1, want_symtab=1 origin=2, want_symtab=1 origin=3, want_symtab=1 origin=4, want_symtab=1 origin=1, want_symtab=0 origin=2, want_symtab=0 origin=3, want_symtab=0 origin=4, want_symtab=0 [acme@emilia ~]$ So I'm applying another patch I came up with that I'm attaching to this message. Please let me know if you guys are ok with it and if I can add a Tested-by: you. - Arnaldo > diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c > index 15ccfba..a84db85 100644 > --- a/tools/perf/util/symbol.c > +++ b/tools/perf/util/symbol.c > @@ -1480,7 +1480,7 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter) > * Failing that, do a second pass where we accept .dynsym also > */ > for (self->origin = DSO__ORIG_BUILD_ID_CACHE, want_symtab = 1; > - self->origin != DSO__ORIG_NOT_FOUND; > + self->origin != DSO__ORIG_END; > self->origin++) { > switch (self->origin) { > case DSO__ORIG_BUILD_ID_CACHE: > @@ -1530,6 +1530,7 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter) > self->long_name); > break; > > + case DSO__ORIG_NOT_FOUND: > default: > /* > * If we wanted a full symtab but no image had one, > @@ -1538,8 +1539,7 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter) > if (want_symtab) { > want_symtab = 0; > self->origin = DSO__ORIG_BUILD_ID_CACHE; > - } else > - continue; > + } > } > > /* Name is now the name of the next image to try */ > diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h > index 670cd1c..6b79ab9 100644 > --- a/tools/perf/util/symbol.h > +++ b/tools/perf/util/symbol.h > @@ -201,6 +201,7 @@ enum dso_origin { > DSO__ORIG_GUEST_KMODULE, > DSO__ORIG_KMODULE, > DSO__ORIG_NOT_FOUND, > + DSO__ORIG_END, > };