libbpf: Complete field-based CO-RE helpers with field offset helper
authorAndrii Nakryiko <andrii@kernel.org>
Mon, 9 May 2022 00:41:44 +0000 (17:41 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 9 May 2022 15:15:32 +0000 (17:15 +0200)
commit7715f549a9d80a82428a7925fa4a00518c53c35c
tree6da1158d453283f609e69c478b59225c6fb4491c
parent2a4ca46b7d2a6f7ba7359e8d7fafe9ad378fa18e
libbpf: Complete field-based CO-RE helpers with field offset helper

Add bpf_core_field_offset() helper to complete field-based CO-RE
helpers. This helper can be useful for feature-detection and for some
more advanced cases of field reading (e.g., reading flexible array members).

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220509004148.1801791-6-andrii@kernel.org
tools/lib/bpf/bpf_core_read.h