From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Alan Maguire <alan.maguire@oracle.com>
Cc: Domenico Andreoli <cavok@debian.org>,
Jiri Olsa <jolsa@kernel.org>, Ben Hutchings <ben@decadent.org.uk>,
1076564@bugs.debian.org, dwarves@vger.kernel.org
Subject: Re: Bug#1076564: pahole BTF processing seems flaky on powerpc
Date: Wed, 24 Jul 2024 13:29:06 -0300 [thread overview]
Message-ID: <ZqEr0qRJxYkolo8y@x1> (raw)
In-Reply-To: <f91db3d7-743d-4f76-b597-1ec5e3a4efa8@oracle.com>
On Wed, Jul 24, 2024 at 11:04:51AM +0100, Alan Maguire wrote:
> On 19/07/2024 20:13, Arnaldo Carvalho de Melo wrote:
> > Adding Alan and Jiri to the CC list.
> >
>
> I'm late chiming in on this one, but judging by the output:
>
> BTF .btf.vmlinux.bin.o
> + LLVM_OBJCOPY=powerpc-linux-gnu-objcopy pahole -J -j
> --btf_features=encode_force,var,float,enum64,decl_tag,type_tag,optimized_func,consistent_func
> --lang_exclude=rust .tmp_vmlinux.btf
> [102044] ARRAY (anon) type_id=99491 index_type_id=14 nr_elems=12 Error
> emitting BTF type
> Encountered error while encoding BTF.
>
>
> ...we hit an error in btf_encoder__add_array() as a result of
> btf__add_array() failing:
>
> btf__log_err(btf, BTF_KIND_ARRAY, NULL, true,
> "type_id=%u index_type_id=%u nr_elems=%u
> Error emitting BTF type",
> type, index_type, nelems);
>
>
> Unfortunately we don't preserve the negative id value (containing the
> error code) in btf__log_err(); I'm thinking one thing we should do is
> modify btf__log_err() to preserves errors for cases where the encoding
> errors out due to a libbpf-returned -errno, something like
>
>
> -__attribute ((format (printf, 5, 6)))
> +__attribute ((format (printf, 6, 7)))
> -static void btf__log_err(const struct btf *btf, int kind, const char *name,
> +static void btf__log_err(const struct btf *btf, int libbpf_err, int
> kind, const char *name,
> bool output_cr, const char *fmt, ...)
> {
> fprintf(stderr, "[%u] %s %s", btf__type_cnt(btf),
> btf_kind_str[kind], name ?: "(anon)");
>
> if (fmt && *fmt) {
> va_list ap;
>
> fprintf(stderr, " ");
> va_start(ap, fmt);
> vfprintf(stderr, fmt, ap);
> va_end(ap);
> }
>
> + if (libbpf_err)
> + fprintf(stderr, " libbpf error %d", libbpf_err);
> if (output_cr)
> fprintf(stderr, "\n");
> }
>
>
> So at least if this error recurs we'd have a clearer picture of what's
> happening in libbpf. What do you think? I'll submit a patch for this if
> it makes sense.
I agree completely that the error reporting we have is lacking, we
better go and add extra info for these cases so that we can more quickly
get a clue of what is taking place, so please submit patches for that
and I'll consider them.
Thanks,
- Arnaldo
prev parent reply other threads:[~2024-07-24 16:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <172133976964.70930.13662511677581571913.reportbug@deadeye.wl.decadent.org.uk>
2024-07-19 6:53 ` Bug#1076564: pahole BTF processing seems flaky on powerpc Domenico Andreoli
2024-07-19 9:08 ` Domenico Andreoli
2024-07-19 19:13 ` Arnaldo Carvalho de Melo
2024-07-19 21:20 ` Domenico Andreoli
2024-07-20 7:16 ` John Paul Adrian Glaubitz
2024-07-20 7:47 ` Domenico Andreoli
2024-07-20 19:17 ` Ben Hutchings
2024-07-20 19:45 ` John Paul Adrian Glaubitz
2024-07-21 22:07 ` Ben Hutchings
2024-07-22 4:57 ` John Paul Adrian Glaubitz
2024-07-24 10:04 ` Alan Maguire
2024-07-24 16:29 ` Arnaldo Carvalho de Melo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZqEr0qRJxYkolo8y@x1 \
--to=acme@kernel.org \
--cc=1076564@bugs.debian.org \
--cc=alan.maguire@oracle.com \
--cc=ben@decadent.org.uk \
--cc=cavok@debian.org \
--cc=dwarves@vger.kernel.org \
--cc=jolsa@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox