-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update README.md to provide clearer and more concise information abou…
…t the tool's features and installation process.
- Loading branch information
1 parent
991d04d
commit 5de4c0d
Showing
1 changed file
with
28 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,44 @@ | ||
# bpftop | ||
|
||
`bpftop` is a performance profiling command-line tool for eBPF programs. It provides a real-time view of all active eBPF programs, along with their average runtime per invocation. The tool is designed to minimize overhead by enabling performance statistics only while it is active. | ||
`bpftop` provides a dynamic real-time view of running eBPF programs. It displays the average runtime, events per second, and estimated total CPU % for each program. This tool minimizes overhead by enabling performance statistics only while it is active. | ||
|
||
 | ||
|
||
## Installation | ||
|
||
To download the latest release of `bpftop`, use the following command: | ||
|
||
```bash | ||
curl -fLJO https://github.com/Netflix/bpftop/releases/latest/download/bpftop | ||
``` | ||
|
||
## Features | ||
|
||
- Display a list of all running eBPF programs on the host | ||
- Show the average runtime for each eBPF program | ||
- Dynamically update the list every second | ||
- Low overhead by enabling performance profiling only during program execution | ||
- Displays a list of all running eBPF programs on the host, including the ID, type, and name | ||
- Shows the period and total average runtime for each eBPF program. | ||
- Calculates the events per second and estimated CPU utilization for each eBPF program | ||
- Dynamically updates the list every second | ||
- Enables the statistics-gathering function only while it is active | ||
|
||
## Prerequisites | ||
|
||
- `bpftop` requires `sudo` privileges to run. | ||
- The Linux kernel version must be 5.8 or later. | ||
- The binary is dynamically linked to `libz` and `libelf`, so these libraries must be present on the systems where you intend to run `bpftop`. | ||
|
||
## Usage | ||
|
||
Run the following command to start `bpftop` on your host: | ||
|
||
```bash | ||
sudo ./bpftop | ||
``` | ||
|
||
## How it works | ||
|
||
`bpftop` uses the [BPF_ENABLE_STATS](https://elixir.bootlin.com/linux/v6.6.16/source/include/uapi/linux/bpf.h#L792) BPF syscall command to enable global eBPF runtime statistics gathering, which is disabled by default to reduce performance overhead. It collects these statistics every second, calculating the average runtime, events per second, and estimated CPU utilization for each eBPF program within that sample period. This information is displayed in a top-like tabular format. Once `bpftop` terminates, it disables the statistics-gathering function by deleting the file descriptor returned by `BPF_ENABLE_STATS`. | ||
`bpftop` uses the [BPF_ENABLE_STATS](https://elixir.bootlin.com/linux/v6.6.16/source/include/uapi/linux/bpf.h#L792) BPF syscall command to enable global eBPF runtime statistics gathering, which is disabled by default to reduce performance overhead. It collects these statistics every second, calculating the average runtime, events per second, and estimated CPU utilization for each eBPF program within that sample period. This information is displayed in a top-like tabular format. Once `bpftop` terminates, it disables the statistics-gathering function by deleting the file descriptor returned by `BPF_ENABLE_STATS`. | ||
|
||
## Building from source | ||
|
||
1. Install and setup [cross](https://github.com/cross-rs/cross) | ||
2. Run `cross build --release` |