Skip to content

BPF Syscall BPF_BTF_LOAD command

v4.18

This command loads a BTF object into the kernel.

Return value

This command will return a file descriptor to the created BTF object on success (positive integer) or an error number (negative integer) if something went wrong.

Attributes

btf

v4.18

This field is a pointer to the BTF information to be loaded.

btf_log_buf

v4.18

This field is a pointer to a reserved piece of memory where the kernel will write the log to, if enabled.

btf_size

v4.18

This field is the size of the info indicated by btf.

btf_log_size

v4.18

This field is the size of the memory region indicated by btf_log_buf

btf_log_level

v4.18

This field is the level of detail contained in the log. Possible values are:

  • 0 = no log
  • 1 = basic logging (BPF_LOG_LEVEL1)
  • 2 = verbose logging (BPF_LOG_LEVEL2)

Additionally the 3rd bit is a flag, if set the kernel will output statistics to the log (BPF_LOG_STATS).