Skip to content

Libbpf userspace function btf__new_empty_split

0.3.0

Creates an unpopulated BTF object from an ELF BTF section except with a base BTF on top of which split BTF should be based

Definition

struct btf *btf__new_empty_split(struct btf *base_btf);

Parameters

  • base_btf: The base BTF to use for the split BTF.

Return

New BTF object instance which has to be eventually freed with btf__free()

On error, error-code-encoded-as-pointer is returned, not a NULL. To extract error code from such a pointer libbpf_get_error should be used. If libbpf_set_strict_mode(LIBBPF_STRICT_CLEAN_PTRS) is enabled, NULL is returned on error instead. In both cases thread-local errno variable is always set to error code as well.

Usage

If base_btf is NULL, btf__new_empty_split is equivalent to btf__new_empty and creates non-split BTF.

Example

Docs could be improved

This part of the docs is incomplete, contributions are very welcome