Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Alan Maguire <alan.maguire@oracle.com>
To: Naresh Kamboju <naresh.kamboju@linaro.org>, andrii@kernel.org
Cc: Alan Maguire <alan.maguire@oracle.com>,
	Linux-Next Mailing List <linux-next@vger.kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>,
	john.fastabend@gmail.com, kpsingh@kernel.org, morbo@google.com,
	Shuah Khan <shuah@kernel.org>, bpf <bpf@vger.kernel.org>,
	Netdev <netdev@vger.kernel.org>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	lkft-triage@lists.linaro.org
Subject: Re: [PATCH v6 bpf-next 1/3] libbpf: BTF dumper support for typed data
Date: Mon, 19 Jul 2021 15:15:06 +0100 (IST)	[thread overview]
Message-ID: <alpine.LRH.2.23.451.2107191506130.18107@localhost> (raw)
In-Reply-To: <CA+G9fYtqga+zMop8Ae3+fa1ENP2T8fwfFfwWmvfRWZSYB7cPDw@mail.gmail.com>


On Mon, 19 Jul 2021, Naresh Kamboju wrote:

> On Thu, 15 Jul 2021 at 20:46, Alan Maguire <alan.maguire@oracle.com> wrote:
> >
> > Add a BTF dumper for typed data, so that the user can dump a typed
> > version of the data provided.
> 
> <trim>
> 
> > diff --git a/tools/lib/bpf/btf_dump.c b/tools/lib/bpf/btf_dump.c
> > index 5dc6b517..929cf93 100644
> > --- a/tools/lib/bpf/btf_dump.c
> > +++ b/tools/lib/bpf/btf_dump.c
> 
> 
> Following perf build errors noticed on i386 and arm 32-bit architectures on
> linux next 20210719 tag with gcc-11.
> 
> metadata:
> --------------
>    git_repo: https://gitlab.com/Linaro/lkft/mirrors/next/linux-next
>    git_short_log: 08076eab6fef ( Add linux-next specific files for 20210719 )
>    toolchain: gcc-11
>    target_arch: arm and i386
> 
> 
> > +static void btf_dump_int128(struct btf_dump *d,
> > +                           const struct btf_type *t,
> > +                           const void *data)
> > +{
> > +       __int128 num = *(__int128 *)data;
> 
> 
> btf_dump.c: In function 'btf_dump_int128':
> btf_dump.c:1559:9: error: expected expression before '__int128'
>  1559 |         __int128 num = *(__int128 *)data;
>       |         ^~~~~~~~
> btf_dump.c:1561:14: error: 'num' undeclared (first use in this function)
>  1561 |         if ((num >> 64) == 0)
>       |              ^~~
> btf_dump.c:1561:14: note: each undeclared identifier is reported only
> once for each function it appears in
> btf_dump.c: At top level:
> btf_dump.c:1568:17: error: '__int128' is not supported on this target
>  1568 | static unsigned __int128 btf_dump_bitfield_get_data(struct btf_dump *d,
>       |                 ^~~~~~~~
> btf_dump.c: In function 'btf_dump_bitfield_get_data':
> btf_dump.c:1576:18: error: '__int128' is not supported on this target
>  1576 |         unsigned __int128 num = 0, ret;
>       |                  ^~~~~~~~
> btf_dump.c: In function 'btf_dump_bitfield_check_zero':
> btf_dump.c:1608:9: error: expected expression before '__int128'
>  1608 |         __int128 check_num;
>       |         ^~~~~~~~
> btf_dump.c:1610:9: error: 'check_num' undeclared (first use in this function)
>  1610 |         check_num = btf_dump_bitfield_get_data(d, t, data,
> bits_offset, bit_sz);
>       |         ^~~~~~~~~
> btf_dump.c: In function 'btf_dump_bitfield_data':
> btf_dump.c:1622:18: error: '__int128' is not supported on this target
>  1622 |         unsigned __int128 print_num;
>       |                  ^~~~~~~~
> btf_dump.c: In function 'btf_dump_dump_type_data':
> btf_dump.c:2212:34: error: '__int128' is not supported on this target
>  2212 |                         unsigned __int128 print_num;
>       |                                  ^~~~~~~~
> 
>

Thanks for the report Naresh! Andrii, I'm thinking the best
approach might be to remove use of int128 and have the bitfield
computations operate on a __u64 representation instead.  With
that change, we would only lose the ability to handle int128
bitfields; what do you think? I hope to have something ready
shortly covering that, the non-propogation of return values
and the endianness issues with enum handling - in fact the
latter goes away if the bitfield computations are done for
64-bit values.

Thanks!

Alan

  reply	other threads:[~2021-07-19 14:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15 15:15 [PATCH v6 bpf-next 0/3] " Alan Maguire
2021-07-15 15:15 ` [PATCH v6 bpf-next 1/3] " Alan Maguire
2021-07-16  6:24   ` Andrii Nakryiko
2021-07-16 20:55     ` Andrii Nakryiko
2021-07-16 21:58   ` Andrii Nakryiko
2021-07-19 12:11   ` Naresh Kamboju
2021-07-19 14:15     ` Alan Maguire [this message]
2021-07-15 15:15 ` [PATCH v6 bpf-next 2/3] selftests/bpf: add ASSERT_STRNEQ() variant for test_progs Alan Maguire
2021-07-15 15:15 ` [PATCH v6 bpf-next 3/3] selftests/bpf: add dump type data tests to btf dump tests Alan Maguire
2021-07-16  6:24   ` Andrii Nakryiko

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=alpine.LRH.2.23.451.2107191506130.18107@localhost \
    --to=alan.maguire@oracle.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=lkft-triage@lists.linaro.org \
    --cc=morbo@google.com \
    --cc=naresh.kamboju@linaro.org \
    --cc=netdev@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=shuah@kernel.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    --subject='Re: [PATCH v6 bpf-next 1/3] libbpf: BTF dumper support for typed data' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).