Re: [PATCH 1/3] perf tools: Allow vmlinux to fallback to kallsyms on NO_LIBELF=1

From: Arnaldo Carvalho de Melo
Date: Tue Nov 11 2014 - 09:12:55 EST


Em Tue, Nov 11, 2014 at 10:03:26AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Tue, Nov 11, 2014 at 11:27:45AM +0100, Peter Zijlstra escreveu:
> > On Tue, Nov 11, 2014 at 01:24:38PM +0900, Namhyung Kim wrote:
> > > > What I was saying, why not have a util/symbol.c change that disregards
> > > > all DSOs with 0 symbols in.
>
> > > The util/symbol.c doesn't need this because it can handle vmlinux
> > > reliably. So after reading symbol table, it'll use the dso if it
> > > actually contains symbols or fallback to next dso if it has 0 symbols.
> > > IOW it already disregards all dsos with 0 symbols in.
>
> > Well, it could not could it.. it readily proceeded with 0 symbols in my
> > case. It did _not_ fallback to kallsyms.
>
> Right, testing a fix for the problem I described on my last message.

Can you try the patch below?

- Arnaldo

diff --git a/tools/perf/util/symbol-minimal.c b/tools/perf/util/symbol-minimal.c
index c9541fea9514..b55f96d49503 100644
--- a/tools/perf/util/symbol-minimal.c
+++ b/tools/perf/util/symbol-minimal.c
@@ -341,7 +341,7 @@ int dso__load_sym(struct dso *dso, struct map *map __maybe_unused,

if (filename__read_build_id(ss->name, build_id, BUILD_ID_SIZE) > 0) {
dso__set_build_id(dso, build_id);
- return 1;
+ return 0;
}
return 0;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/