Libbpf userspace function bpf_prog_get_info_by_fd
Obtains information about the BPF program corresponding to prog_fd
.
Definition
int bpf_prog_get_info_by_fd(int prog_fd, struct bpf_prog_info *info, __u32 *info_len);
Parameters
prog_fd
: BPF program file descriptorinfo
: pointer tostruct bpf_prog_info
that will be populated with BPF program informationinfo_len
: pointer to the size ofinfo
; on success updated with the number of bytes written toinfo
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