Thread (14 messages) 14 messages, 2 authors, 2021-02-24

Re: [PATCH v5 bpf-next 2/8] libbpf: Add BTF_KIND_FLOAT support

From: Andrii Nakryiko <hidden>
Date: 2021-02-24 20:57:53

On Tue, Feb 23, 2021 at 3:15 PM Ilya Leoshkevich [off-list ref] 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(-)
[...]
quoted hunk ↗ jump to hunk
 /* 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?
  *
  * Returns:
  *   - >0, type ID of newly added BTF type;
[...]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help