Skip to content

Libbpf userspace function bpf_btf_get_info_by_fd

1.2.0

Obtains information about the BTF object corresponding to btf_fd.

Definition

int bpf_btf_get_info_by_fd(int btf_fd, struct bpf_btf_info *info, __u32 *info_len);

Parameters

  • btf_fd: BTF object file descriptor
  • info: pointer to struct bpf_btf_info that will be populated with BTF object information
  • info_len: pointer to the size of info; on success updated with the number of bytes written to info

Return

0, on success; negative error code, otherwise (errno is also set to the error code)

Usage

Populates up to info_len bytes of info and updates info_len with the actual number of bytes written to info.

Note

info should be zero-initialized or initialized as expected by the requested info type. Failing to (zero-)initialize info under certain circumstances can result in this helper returning an error.

Example

Docs could be improved

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