[PATCH] D83289: [BPF] Emit unknown types as byte arrays
Andrii Nakryiko via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 10 13:00:37 PDT 2020
anakryiko added a comment.
pahole does a sensible thing, it represents it as BTF_KIND_INT (which maps to DWARF's DW_TAG_base_type), but with no encoding (so it's effectively unsigned integer with proper size).
I've been advocating for adding one extra encoding bit to BTF_KIND_INT's encoding field to represent floating-point numbers, in addition to existing CHAR, SIGNED, and BOOL. This would make sense (float is indivisible set of bytes with particular interpretation, which is what BTF_KIND_INT is), it's easy to support in kernel, it's easy to sanitize in libbpf.
The only downside is a bit mismatched INT name (DWARF uses more generic BASE_TYPE name for this), which I think is very-very minor (and one can argue that all the primitive types are integers).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83289/new/
https://reviews.llvm.org/D83289
More information about the llvm-commits
mailing list