BPF List
 help / color / mirror / Atom feed
From: Ilya Leoshkevich <iii@linux.ibm.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>,
	Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	dwarves@vger.kernel.org, bpf <bpf@vger.kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>, Yonghong Song <yhs@fb.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>
Subject: Re: [PATCH] btf: Add support for the floating-point types
Date: Mon, 08 Mar 2021 23:31:24 +0100	[thread overview]
Message-ID: <ed1ac857a282f9606b22ca907b7cf93f6e29e483.camel@linux.ibm.com> (raw)
In-Reply-To: <CAEf4BzbHyg6xndiw=gNhW79ofWACzb1mtDt0ghEhkRMpOd70GQ@mail.gmail.com>

On Mon, 2021-03-08 at 14:16 -0800, Andrii Nakryiko wrote:
> On Mon, Mar 8, 2021 at 5:02 AM Arnaldo Carvalho de Melo
> <arnaldo.melo@gmail.com> wrote:
> > 
> > Em Mon, Mar 08, 2021 at 04:02:58AM +0100, Ilya Leoshkevich
> > escreveu:
> > > On Sun, 2021-03-07 at 11:09 -0300, Arnaldo Carvalho de Melo
> > > wrote:
> > > > Adding Jiri to the CC list.
> > > > Em Sun, Mar 07, 2021 at 10:50:19AM -0300, Arnaldo Carvalho de
> > > > Melo escreveu:
> > > > > Em Sun, Mar 07, 2021 at 10:44:21AM -0300, Arnaldo Carvalho de
> > > > > Melo escreveu:
> > > > > Now will build a kernel with this new version, reboot, then
> > > > > push
> > > > > publicly.
> > 
> > > > So now trying to build v5.12-rc2 with pahole supporting
> > > > BTF_KIND_FLOAT:
> > 
> > > >   AS      .tmp_vmlinux.kallsyms2.S
> > > >   LD      vmlinux
> > > >   BTFIDS  vmlinux
> > > > FAILED: load BTF from vmlinux: Invalid argument
> > > > make[1]: *** [/home/acme/git/linux/Makefile:1197: vmlinux]
> > > > Error 255
> > > > make[1]: Leaving directory '/home/acme/git/build/v5.12.0-rc2'
> > > > make: *** [Makefile:215: __sub-make] Error 2
> > > > [acme@five linux]$
> > 
> > > > [acme@five linux]$ egrep BTF\|DWARF  ../build/v5.12.0-
> > > > rc2/.config
> > > > CONFIG_VIDEO_SONY_BTF_MPX=m
> > > > CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
> > > > # CONFIG_DEBUG_INFO_DWARF4 is not set
> > > > CONFIG_DEBUG_INFO_BTF=y
> > > > CONFIG_PAHOLE_HAS_SPLIT_BTF=y
> > > > CONFIG_DEBUG_INFO_BTF_MODULES=y
> > 
> > > > Ideas?
> > 
> > > So v5.12-rc2 does not have this series yet:
> > 
> > > https://lore.kernel.org/bpf/20210226202256.116518-1-iii@linux.ibm.com/
> > 
> > > pahole generates a BTF_KIND_FLOAT, but libbpf from v5.12-rc2
> > > doesn't
> > > know how to handle it and resolve_btfids fails.
> > 
> > > I guess this is the first time a new BTF kind is added? I checked
> > > the
> > > history, and kernel v5.2, which introduced DEBUG_INFO_BTF,
> > > already had
> > > BTF_KIND_DATASEC.
> > 
> > > So should I add a command-line option to pahole, which would tell
> > > it
> > > the desired libbpf compatibility level?
> > 
> > Yes, that would be best, some sort of capability querying and then
> > a
> > decision about using the new feature.
> 
> pahole could be used to add .BTF post-factum to vmlinux image of a
> very old kernel, even the one that doesn't support BTF at all. So
> whatever detection system is going to be added, we should make it
> easy
> to turn it off.

I'd rather not have detection at all. Instead, pahole should encode
floats as ints by default (that's not fully correct, but that's the way
it is today). Then we can pass --libbpf-compat=0.4.0 in link-vmlinux.sh
in the newer kernels, which would turn on the new feature.


      reply	other threads:[~2021-03-08 22:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-06  2:22 [PATCH] btf: Add support for the floating-point types Ilya Leoshkevich
2021-03-07  3:16 ` Andrii Nakryiko
2021-03-07 13:16   ` Arnaldo Carvalho de Melo
2021-03-07 13:44     ` Arnaldo Carvalho de Melo
2021-03-07 13:50       ` Arnaldo Carvalho de Melo
2021-03-07 14:09         ` Arnaldo Carvalho de Melo
2021-03-08  3:02           ` Ilya Leoshkevich
     [not found]             ` <YEYgVmo0ryuM3SUY@kernel.org>
2021-03-08 22:16               ` Andrii Nakryiko
2021-03-08 22:31                 ` Ilya Leoshkevich [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=ed1ac857a282f9606b22ca907b7cf93f6e29e483.camel@linux.ibm.com \
    --to=iii@linux.ibm.com \
    --cc=acme@redhat.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=arnaldo.melo@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dwarves@vger.kernel.org \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=jolsa@kernel.org \
    --cc=yhs@fb.com \
    /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