Generated by GPT-5-mini| bpftool | |
|---|---|
| Name | bpftool |
| Author | various |
| Developer | Linux Kernel Community |
| Released | 2016 |
| Repository | kernel.org |
| License | GNU General Public License v2 |
bpftool
bpftool is a command-line utility for inspecting and interacting with extended Berkeley Packet Filter programs and maps in the Linux kernel ecosystem. It provides facilities for listing, dumping, and manipulating eBPF objects, integrating with kernel subsystems such as tc (networking utility), XDP, perf (Linux profiling), and systemd tooling. Widely used by developers working with the Linux kernel, Red Hat, Google, Facebook, and cloud providers like Amazon (company), Microsoft, and IBM for observability and networking tasks, bpftool is bundled with the iproute2 and kernel tools workflows.
bpftool emerged as part of efforts to expose in-kernel eBPF infrastructure to userspace tools maintained by contributors from organizations including Netronome, Cilium, Isovalent, Meta Platforms, Inc., and the Linux Foundation. The utility operates alongside projects such as bcc (software), bcc-tools, and bpftrace while complementing kernel subsystems like kprobe, tracepoint, and uprobes. It interacts with kernel interfaces introduced via patches accepted by maintainers such as Linus Torvalds and Andrew Morton, and its development often references discussions on mailing lists like linux-kernel and netdev.
bpftool exposes commands to list, show, dump, pin, and convert eBPF programs and maps. Common operations include "prog" for program management, "map" for map inspection, "net" for network-related hooks such as XDP attachments, and "perf" for linking with perf (Linux profiling). It supports introspection of program types like cgroup (Linux), socket (computing), and tracepoint programs, and can translate between object formats used by LLVM/Clang toolchains and kernel representations. Advanced commands integrate with distribution packaging efforts by vendors such as Debian, Ubuntu, Fedora, and SUSE during build and deployment pipelines.
bpftool is implemented in C and leverages kernel APIs exposed through the bpf (system call) family, evoking interfaces standardized in the Linux kernel upstream. It parses ELF and CO-RE relocations produced by LLVM/Clang and relies on libbpf primitives, which are developed in collaboration with maintainers like Daniel Borkmann and contributors associated with Netflix. The tool interacts with kernel objects via file system namespaces such as sysfs and procfs, and uses concepts from libelf and elfutils to manage binary artifacts. Its repository traces contributions from corporate and academic entities including Google, Red Hat, Intel Corporation, and universities that participate in kernel research.
bpftool is used for debugging XDP programs in high-performance packet processing stacks deployed by companies like Cloudflare and Akamai Technologies and for observability in service meshes developed by Istio, Linkerd, and Cilium. It aids operators at cloud providers such as Google Cloud Platform, Amazon Web Services, and Microsoft Azure to inspect live eBPF maps used by networking agents and security modules. Security researchers at institutions like CERT Coordination Center and vendors such as Palo Alto Networks leverage bpftool to analyze program bytecode produced by LLVM and to verify verifier acceptance in kernels maintained by organizations including Canonical and SUSE. Example workflows often chain bpftool with utilities like tcpdump, iptables, and nftables for packet capture and policy inspection.
Active development occurs on kernel repositories and auxiliary projects hosted by communities such as the Linux Foundation and discussion channels like LKML. Contributors from corporations including Facebook, Google, Red Hat, Intel Corporation, Netronome, and startups like Isovalent submit patches reviewed by maintainers such as Alexei Starovoitov and Daniel Borkmann. Development practices reference continuous integration systems used by projects like Jenkins and GitLab CI, and patches are discussed on lists including linux-kernel and netdev. Documentation efforts coordinate with standards bodies and academic conferences where eBPF research is presented, such as USENIX and ACM SIGCOMM.
bpftool surfaces information that assists in auditing eBPF program behavior, aiding vulnerability assessments by teams at Google Project Zero and CERT. Because it interfaces with in-kernel verifier logic created by kernel maintainers, operators must consider differences across kernel versions released by vendors like Red Hat and SUSE when interpreting outputs. Performance-sensitive deployments at companies such as Netflix and Facebook use bpftool to validate map sizes, lookup latencies, and program instruction counts to avoid kernel overhead that can affect real-time services. Security-sensitive contexts leverage bpftool outputs alongside tools from OpenSSL-dependent stacks and runtime monitors maintained by projects like Falco to ensure policy compliance.