mirror of
https://github.com/netdata/libbpf.git
synced 2026-04-04 07:39:07 +08:00
libbpf: Add support for field existance CO-RE relocation
Add support for BPF_FRK_EXISTS relocation kind to detect existence of captured field in a destination BTF, allowing conditional logic to handle incompatible differences between kernels. Also introduce opt-in relaxed CO-RE relocation handling option, which makes libbpf emit warning for failed relocations, but proceed with other relocations. Instruction, for which relocation failed, is patched with (u32)-1 value. Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20191015182849.3922287-4-andriin@fb.com
This commit is contained in:
committed by
Andrii Nakryiko
parent
807b9d7be1
commit
0db22b01a1
@@ -96,8 +96,10 @@ struct bpf_object_open_opts {
|
||||
const char *object_name;
|
||||
/* parse map definitions non-strictly, allowing extra attributes/data */
|
||||
bool relaxed_maps;
|
||||
/* process CO-RE relocations non-strictly, allowing them to fail */
|
||||
bool relaxed_core_relocs;
|
||||
};
|
||||
#define bpf_object_open_opts__last_field relaxed_maps
|
||||
#define bpf_object_open_opts__last_field relaxed_core_relocs
|
||||
|
||||
LIBBPF_API struct bpf_object *bpf_object__open(const char *path);
|
||||
LIBBPF_API struct bpf_object *
|
||||
|
||||
Reference in New Issue
Block a user