Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rogercoll/ebpfutil
retrivies basic information of the active BPF programs
https://github.com/rogercoll/ebpfutil
ebpf go
Last synced: 25 days ago
JSON representation
retrivies basic information of the active BPF programs
- Host: GitHub
- URL: https://github.com/rogercoll/ebpfutil
- Owner: rogercoll
- License: mit
- Created: 2022-07-02T15:35:01.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-24T10:37:29.000Z (about 2 years ago)
- Last Synced: 2024-09-28T20:05:21.095Z (about 1 month ago)
- Topics: ebpf, go
- Language: Go
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eBPFutil
[![Go Reference](https://pkg.go.dev/badge/github.com/rogercoll/ebpfutil.svg)](https://pkg.go.dev/github.com/rogercoll/ebpfutil)
Retrieves basic information of the pinned BPF programs and maps running in the host. This package **cannot** be used to load, attach, link or unload BPF programs, it can only be used to gather BPF stats.
## Package Features
### BPF Programs
`stats.BPFPrograms()` -> Returns an array of all the available BPF programs loaded in
the system as a [BPFProgram structure](https://github.com/rogercoll/ebpfutil/blob/main/stats/programs.go#L11) which contains the ID, FD and
[BPFProgInfo](https://github.com/rogercoll/ebpfutil/blob/8b5366a7bf3d0c9b142849a4b6e2e62d23d243b1/program.go#L10) of the corresponding program. See [examples/programs/main.go](./examples/programs/main.go)### BPF Maps
`stats.BPFMaps()` -> Returns an array of all the available BPF maps in
the system as a [BPFMap structure](https://github.com/rogercoll/ebpfutil/blob/main/stats/maps.go#L11) which contains the ID, FD and
[BPFMapInfo](https://github.com/rogercoll/ebpfutil/blob/8b5366a7bf3d0c9b142849a4b6e2e62d23d243b1/map.go#L6) of the corresponding map. See [examples/maps/main.go](./examples/maps/main.go)For additional exported functionalities you check the [public documentation](https://pkg.go.dev/github.com/rogercoll/ebpfutil).
## Usage
Import it into your Go program and use any of the exported functions:
```bash
go get github.com/rogercoll/ebpfutil
```