Skip to content

Libbpf userspace function bpf_program__set_log_buf

0.7.0

Set the log buffer of a BPF program.

Definition

int bpf_program__set_log_buf(struct bpf_program *prog, char *log_buf, size_t log_size);

Parameters

  • prog: BPF program to set the log buffer for
  • log_buf: Buffer to set as the log buffer
  • log_size: Size of the log buffer

Return

error code; or 0 if no error. An error occurs if the object is already loaded.

Usage

Set the log buffer. The verifier will write its log into this buffer when loading the program. This log is important to understand why a BPF program failed when its rejected by the verifier.

Example

Docs could be improved

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