Libbpf userspace function bpf_enable_stats
Enable eBPF statistics collection system wide. A wrapper around the BPF_ENABLE_STATS
syscall command.
Definition
int bpf_enable_stats(enum bpf_stats_type type);
Parameters
type
: type of statistics to enable
Return
0
, on success; negative error code, otherwise
enum bpf_stats_type
enum bpf_stats_type {
/* enabled run_time_ns and run_cnt */
BPF_STATS_RUN_TIME = 0,
};
Usage
This function enables eBPF statistics collection system wide. The statistics can be retrieved as part of the information gotten from bpf_prog_get_info_by_fd
.
Example
Docs could be improved
This part of the docs is incomplete, contributions are very welcome