MyGit

Netflix/bpftop

Fork: 100 Star: 2327 (更新于 2024-11-22 02:11:41)

license: Apache-2.0

Language: C .

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.

最后发布版本: v0.5.2 ( 2024-07-29 08:24:16)

GitHub网址

bpftop

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. It also provides graphical views of these statistics over time. This tool minimizes overhead by enabling performance statistics only while it is active.

bpftop

Installation

To download the latest x86_64 release of bpftop, use the following command:

curl -fLJ https://github.com/Netflix/bpftop/releases/latest/download/bpftop-x86_64-unknown-linux-gnu -o bpftop && chmod +x bpftop

or install via your distribution's package manager:

Packaging status

Fedora

You can install bpftop from the official repositories using dnf:

sudo dnf install bpftop

Arch Linux

You can install bpftop from the official repositories using pacman:

sudo pacman -S bpftop

Nix

You can install bpftop from the NixOS 24.05 stable channel:

nix-channel --add https://nixos.org/channels/nixos-24.05 nixpkgs
nix-channel --update
nix-env -iA nixpkgs.bpftop

Features

  • 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
  • Provides a graphical view of the average runtime, events per second, and estimated CPU utilization over a 10-second time period
  • Dynamically updates the list every second
  • Enables the statistics-gathering function only while it is active

Prerequisites

  • bpftop requires sudo privileges to run.
  • 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:

sudo ./bpftop

Relate links

How it works

bpftop uses the BPF_ENABLE_STATS 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
  2. Run cross build --release for x86_64
  3. Run cross build --target=aarch64-unknown-linux-gnu --release for Arm64

最近版本更新:(数据更新于 2024-09-04 13:40:04)

2024-07-29 08:24:16 v0.5.2

2024-05-16 09:38:44 v0.5.1

2024-05-11 22:29:01 v0.5.0

2024-04-27 11:50:28 v0.4.2

2024-04-08 00:17:26 v0.4.1

2024-03-27 10:04:18 v0.4.0

2024-03-18 11:07:25 v0.3.0

2024-03-02 01:54:57 v0.2.3

2024-02-28 02:28:58 v0.2.2

2024-02-24 23:34:42 v0.2.1

Netflix/bpftop同语言 C最近更新仓库

2024-11-20 10:58:52 EdgeTX/edgetx

2024-11-15 10:03:16 hanwckf/bl-mt798x

2024-11-09 07:41:43 XITRIX/Moonlight-Switch

2024-11-04 17:16:21 redis/redis

2024-10-31 09:06:25 Spooks4576/Ghost_ESP

2024-10-31 03:40:05 tursodatabase/libsql