Skip to content

Libbpf userspace function btf__parse

0.1.0

Parse BTF from a file. Both raw BTF data and BTF embedded in an ELF file are supported.

Definition

struct btf *btf__parse(const char *path, struct btf_ext **btf_ext);

Parameters

  • path: path to the file
  • btf_ext: double pointer, will be populated with BTF extension data if present

Return

Return a pointer to a struct btf object on success, or NULL on failure. The caller is responsible for freeing the returned object with btf__free.

If btf_ext is not NULL, it will be populated with a pointer to a struct btf_ext object on success, or NULL on failure. The caller is responsible for freeing the returned object with btf_ext__free.

Usage

Docs could be improved

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

Example

Docs could be improved

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