Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mtardy/bpfmemapie
A tool to render a pie chart of memory usage (bytes_memlock) of BPF maps on the system 🥧
https://github.com/mtardy/bpfmemapie
bpf ebpf maps memory pie
Last synced: 24 days ago
JSON representation
A tool to render a pie chart of memory usage (bytes_memlock) of BPF maps on the system 🥧
- Host: GitHub
- URL: https://github.com/mtardy/bpfmemapie
- Owner: mtardy
- Created: 2024-06-18T19:22:06.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-06-19T11:44:49.000Z (5 months ago)
- Last Synced: 2024-09-30T04:20:53.104Z (about 1 month ago)
- Topics: bpf, ebpf, maps, memory, pie
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 18
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bpfmemapie 🥧
A tool to render a pie chart of memory usage (bytes_memlock) of BPF maps on the
system. Sorry for the naming, it's for **mem**apie, me**map**ie and mema**pie**,
so BPF mem map pie.## Installation
```shell
go install github.com/mtardy/bpfmemapie@latest
```## Usage
It needs bpftool to be installed and to execute as root for bpftool to list the
maps and their info.```shell
sudo bpfmemapie
```After opening http://localhost:8080 (you can change the port with `--port`), you
should see something like this:The pie chart is interactive, you can click on the legend to hide/show entries
or hover on the pie to see the tooltip. You can also change how the "others"
category using the `threshold` URL query, for example
http://localhost:8080/?threshold=1.## Alternative
If you don't need the pie chart part, you can just use `bpftool` and `jq` to
see the same statistics:```shell
sudo bpftool map -j | jq ' group_by(.name) | map({name: .[0].name, total_bytes_memlock: map(.bytes_memlock | tonumber) | add, maps: length}) | sort_by(.total_bytes_memlock)'
```