bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ilya Leoshkevich <iii@linux.ibm.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>, Yonghong Song <yhs@fb.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	John Fastabend <john.fastabend@gmail.com>,
	bpf <bpf@vger.kernel.org>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>
Subject: Re: [PATCH v5 bpf-next 2/8] libbpf: Add BTF_KIND_FLOAT support
Date: Thu, 25 Feb 2021 00:11:52 +0100	[thread overview]
Message-ID: <912782baa065fb961f61f198cba21bb894d1537a.camel@linux.ibm.com> (raw)
In-Reply-To: <CAEf4BzZdD7gh4ehmH3k-Q_Dt-KtCfX5Xe5PUA93xpo3bS=NTiA@mail.gmail.com>

On Wed, 2021-02-24 at 12:56 -0800, Andrii Nakryiko wrote:
> On Tue, Feb 23, 2021 at 3:15 PM Ilya Leoshkevich <iii@linux.ibm.com>
> wrote:
> > 
> > The logic follows that of BTF_KIND_INT most of the time.
> > Sanitization
> > replaces BTF_KIND_FLOATs with equally-sized empty BTF_KIND_STRUCTs
> > on
> > older kernels, for example, the following:
> > 
> >     [4] FLOAT 'float' size=4
> > 
> > becomes the following:
> > 
> >     [4] STRUCT '(anon)' size=4 vlen=0
> > 
> > Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> > ---
> 
> Acked-by: Andrii Nakryiko <andrii@kernel.org>
> 
> >  tools/lib/bpf/btf.c             | 51
> > ++++++++++++++++++++++++++++++++-
> >  tools/lib/bpf/btf.h             |  6 ++++
> >  tools/lib/bpf/btf_dump.c        |  4 +++
> >  tools/lib/bpf/libbpf.c          | 26 ++++++++++++++++-
> >  tools/lib/bpf/libbpf.map        |  5 ++++
> >  tools/lib/bpf/libbpf_internal.h |  2 ++
> >  6 files changed, 92 insertions(+), 2 deletions(-)
> > 
> 
> [...]
> 
> >  /* it's completely legal to append BTF types with type IDs
> > pointing forward to
> >   * types that haven't been appended yet, so we only make sure that
> > id looks
> >   * sane, we can't guarantee that ID will always be valid
> > @@ -1910,7 +1955,7 @@ static int btf_add_composite(struct btf *btf,
> > int kind, const char *name, __u32
> >   *   - *byte_sz* - size of the struct, in bytes;
> >   *
> >   * Struct initially has no fields in it. Fields can be added by
> > - * btf__add_field() right after btf__add_struct() succeeds.
> > + * btf__add_field() right after btf__add_struct() succeeds.
> 
> Was there some whitespacing problem on this line?

Ouch, yes, I remember dropping this chunk, but my editor appears to
have sneaked it back in. I will split this commit in two (hopefully
it's ok to keep the ack :-)).


  reply	other threads:[~2021-02-24 23:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-23 23:14 [PATCH v5 bpf-next 0/8] Add BTF_KIND_FLOAT support Ilya Leoshkevich
2021-02-23 23:14 ` [PATCH v5 bpf-next 1/8] bpf: Add BTF_KIND_FLOAT to uapi Ilya Leoshkevich
2021-02-23 23:14 ` [PATCH v5 bpf-next 2/8] libbpf: Add BTF_KIND_FLOAT support Ilya Leoshkevich
2021-02-24 20:56   ` Andrii Nakryiko
2021-02-24 23:11     ` Ilya Leoshkevich [this message]
2021-02-24 23:23       ` Andrii Nakryiko
2021-02-23 23:14 ` [PATCH v5 bpf-next 3/8] tools/bpftool: " Ilya Leoshkevich
2021-02-23 23:14 ` [PATCH v5 bpf-next 4/8] selftests/bpf: Use the 25th bit in the "invalid BTF_INFO" test Ilya Leoshkevich
2021-02-23 23:14 ` [PATCH v5 bpf-next 5/8] bpf: Add BTF_KIND_FLOAT support Ilya Leoshkevich
2021-02-23 23:14 ` [PATCH v5 bpf-next 6/8] selftest/bpf: Add BTF_KIND_FLOAT tests Ilya Leoshkevich
2021-02-24 21:55   ` Andrii Nakryiko
2021-02-23 23:14 ` [PATCH v5 bpf-next 7/8] selftests/bpf: Add BTF_KIND_FLOAT to the existing deduplication tests Ilya Leoshkevich
2021-02-24 20:58   ` Andrii Nakryiko
2021-02-23 23:14 ` [PATCH v5 bpf-next 8/8] bpf: Document BTF_KIND_FLOAT in btf.rst Ilya Leoshkevich

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=912782baa065fb961f61f198cba21bb894d1537a.camel@linux.ibm.com \
    --to=iii@linux.ibm.com \
    --cc=acme@redhat.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=gor@linux.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=john.fastabend@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).