Re: [PATCH] bpftool: Use sysfs vmlinux when dumping BTF by ID

From: Milan Landaverde
Date: Thu May 05 2022 - 21:32:29 EST


Hello! Just ran into this. I think we also need to pass in errno
here to strerror instead of err:

On Thu, Apr 28, 2022 at 01:08:40PM +0200, Larysa Zaremba wrote:
> if (err) {
> p_err("get btf by id (%u): %s", btf_id, strerror(err));
> goto done;
>

Currently, the error output without a base btf reads:

$ bpftool btf dump id 816
Error: get btf by id (816): Unknown error -22

When it should (or at least intends to) read:

$ bpftool btf dump id 816
Error: get btf by id (816): Invalid argument

I was going to send this patch but if a v2 is going to be sent, figured
I mention it. Thanks!