Inspektor Gadget uses eBPF to obtain the insights it provides. The different gadgets provided use different eBPF capabilities. The capabilities available depend on the version of the kernel running in the node, as well as whether or not the kernel has BTF enabled (via CONFIG_DEBUG_INFO_BTF=y).

    Some of the gadgets have two different implementations. The first is based on the traditional BCC tools , in this case they are compiled at runtime on the target machine before loading. These tools usually work on older kernels (~4.15) and require to have the kernel headers available or the IKHEADERS module loaded. The second implementation uses the modern Compile Once - Run Everywhere (CO:RE) approach. These tools are not compiled at runtime and it’s needed to have BTF information. This information is collected from three different sources, a fallback mechanism is implemented to try another source if the previous one was not available.

    1. The kernel already exposes it through /sys/kernel/btf/vmlinux: the kernel was compiled with CONFIG_DEBUG_INFO_BTF).
    2. It’s available in the gadget container image: we ship the BTF information for some well known kernel versions using BTFGen .
    3. It’s downloaded from BTFHub .

    Inspektor Gadget always tries to use the CO:RE implementation of the gadget (when available), if it fails then it falls back to the traditional BCC-based implementation.

    Required Kernel Versions

    This section summarizes the kernel versions and features that are required to run the gadgets. This has been generated by testing different Ubuntu versions and their shipped kernels, hence it’s possible that some gadgets work in older kernels than the one mentioned here.

    Gadget Minimum Kernel
    advise network-policy
    advise seccomp-profile
    audit seccomp 5.4
    profile block-io 4.15
    profile cpu
    snapshot process 5.10
    snapshot socket 5.10
    top block-io
    top file 5.4
    top tcp 4.15
    trace bind 4.15 (BCC), 5.4 (CO:RE)
    trace capabilities 4.15
    trace dns 5.4
    trace exec 4.15 (BCC), 5.4 (CO:RE)
    trace fsslower 5.4
    trace mount
    trace oomkill 5.4
    trace open 4.15 (BCC), 5.4 (CO:RE)
    trace signal 5.4
    trace sni
    trace tcp 4.15
    tracep tcpconnect 4.15 (BCC), 5.8 (CO:RE)
    traceloop 4.15