Re: [PATCH] perf annotate: Work with vmlinux outside symfs

From: Arnaldo Carvalho de Melo
Date: Fri Jun 16 2023 - 09:05:11 EST


Em Fri, Jun 16, 2023 at 10:21:52AM +0000, Vincent Whitchurch escreveu:
> On Fri, 2022-11-25 at 12:42 +0100, Vincent Whitchurch wrote:
> > It is currently possible to use --symfs along with a vmlinux which lies
> > outside of the symfs by passing an absolute path to --vmlinux, thanks to
> > the check in dso__load_vmlinux() which handles this explicitly.
> >
> > However, the annotate code lacks this check and thus perf annotate does
> > not work ("Internal error: Invalid -1 error code") for kernel functions
> > with this combination. Add the missing handling.
> >
> > Signed-off-by: Vincent Whitchurch <vincent.whitchurch@xxxxxxxx>
>
> This patch was not merged and I did not receive any comments on it
> either. Should I resend it? It still applies cleanly to current
> mainline. Thanks.

Thanks for the ping, I checked dso__load_vmlinux() and it has:

if (vmlinux[0] == '/')
snprintf(symfs_vmlinux, sizeof(symfs_vmlinux), "%s", vmlinux);
else
symbol__join_symfs(symfs_vmlinux, vmlinux)

Exactly as you pointed out, applied.

- Arnaldo