[](https://github.com/bpftrace/bpftrace/actions/workflows/ci.yml)
[](https://github.com/bpftrace/bpftrace/releases/latest)
[](https://github.com/bpftrace/bpftrace/blob/master/LICENSE)
bpftrace is a general purpose tracing tool and language for Linux. It leverages [eBPF](https://ebpf.io/what-is-ebpf/) to provide powerful, efficient tracing capabilities with minimal overhead.
bpftrace uses [LLVM](https://llvm.org/) as a compiler backend, and [libbpf](https://github.com/libbpf/libbpf) for interacting with the Linux BPF subsystem, including kernel dynamic tracing ([kprobes](https://docs.kernel.org/trace/kprobes.html), [hardware and software perf events](https://docs.ebpf.io/linux/program-type/BPF_PROG_TYPE_PERF_EVENT/)), user-level dynamic tracing ([USDT](https://docs.ebpf.io/linux/concepts/usdt/), [uprobes](https://docs.ebpf.io/linux/program-type/BPF_PROG_TYPE_KPROBE/)), tracepoints ([regular](https://docs.ebpf.io/linux/program-type/BPF_PROG_TYPE_TRACEPOINT/), [raw](https://docs.ebpf.io/linux/program-type/BPF_PROG_TYPE_RAW_TRACEPOINT/)), and [more](https://docs.ebpf.io/linux/program-type/BPF_PROG_TYPE_TRACING/).
The bpftrace language is inspired by awk, C, and predecessor tracers such as DTrace and SystemTap.
Visit **[bpftrace.org](https://bpftrace.org/)** for [tutorials](https://bpftrace.org/tutorial-one-liners), [documentation](https://bpftrace.org/docs), and [labs](https://bpftrace.org/hol/intro)!
This respository also contains some [canonical tools](tools/README.md).
For migrating from older versions, see the [migration guide](docs/migration_guide.md).
## Quick Start
Get started with bpftrace in just a few minutes! To build from source, see the [building](#building) section below. However, you can often install it using your distribution's [package manager](https://pkgs.org/search/?q=bpftrace).
> [!IMPORTANT]
> When using a distribution package, be sure to verify `bpftrace --version` when referencing documentation.
## Contributing
See our [contributing guide](CONTRIBUTING.md) for details on how to contribute, and our [governance](GOVERNANCE.md) document for details on how the project is run.
If you have tools built with bpftrace that you'd like to submit, please contribute to the [user-tools repository](https://github.com/bpftrace/user-tools/blob/master/CONTRIBUTING.md).
## Building
For minimum kernel version requirements, see our [dependency support policy](docs/dependency_support.md#linux-kernel). Your kernel should be built with the necessary BPF options enabled. Verify this by running the `check_kernel_features` script from the `scripts` directory.
bpftrace also uses [git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules), so ensure they are initialized when checking out the code. See [dependency support](docs/dependency_support.md) for details.
```bash
git clone --recurse-submodules https://github.com/bpftrace/bpftrace
cd bpftrace
```
bpftrace provides a [Nix](https://nixos.org/nix/) [flake](https://wiki.nixos.org/wiki/Flakes), which is recommended for building and testing.
```bash
nix develop
```
For a suitable build environment without Nix, see our Dockerfiles for detailed build examples:
- [Ubuntu](https://github.com/bpftrace/bpftrace/blob/master/docker/Dockerfile.ubuntu)
- [Fedora](https://github.com/bpftrace/bpftrace/blob/master/docker/Dockerfile.fedora)
- [Debian](https://github.com/bpftrace/bpftrace/blob/master/docker/Dockerfile.debian)
If all dependencies are installed correctly, you should be able to configure and build using [CMake](https://cmake.org).
```bash
cmake -DCMAKE_BUILD_TYPE=Release -B build .
make -C build -j$(nproc)
```
Troubleshooting
**Kernel Lockdown:** If your system has kernel lockdown enabled (often with Secure Boot), bpftrace will be blocked. To disable:
- Disable Secure Boot in UEFI, or
- Run `sudo mokutil --disable-validation` and reboot, or
- Temporarily lift lockdown with `SysRQ+x` (until next boot)
## Community & Support
bpftrace is built and maintained by a diverse community of contributors, users, and organizations who rely on it for production tracing and debugging.
**Get help or get involved:**
- 💬 [GitHub Discussions](https://github.com/bpftrace/bpftrace/discussions) - Ask questions
- 🐛 [Issue Tracker](https://github.com/bpftrace/bpftrace/issues) - Report bugs and request features
- 📅 [Monthly Office Hours](https://docs.google.com/document/d/1nt010RfL4s4gydhCPSJ-Z5mnFMFuD4NrcpVmUcyvu2E/edit?usp=sharing) - Open to everyone
- 💬 [Discord](https://discord.gg/3tnjU2fTWr) - Open to everyone (if the link expired, write to #4916)