Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arcjustin/bpf-api
https://github.com/arcjustin/bpf-api
bpf ebpf linux rust
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/arcjustin/bpf-api
- Owner: arcjustin
- Created: 2022-09-15T00:15:11.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-24T09:59:09.000Z (11 months ago)
- Last Synced: 2024-04-25T13:20:22.119Z (8 months ago)
- Topics: bpf, ebpf, linux, rust
- Language: Rust
- Homepage:
- Size: 55.7 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bpf-api
[![Build Status](https://github.com/arcjustin/bpf-api/workflows/build/badge.svg)](https://github.com/arcjustin/bpf-api/actions?query=workflow%3Abuild)
[![crates.io](https://img.shields.io/crates/v/bpf-api.svg)](https://crates.io/crates/bpf-api)
[![mio](https://docs.rs/bpf-api/badge.svg)](https://docs.rs/bpf-api/)
[![Lines of Code](https://tokei.rs/b1/github/arcjustin/bpf-api?category=code)](https://tokei.rs/b1/github/arcjustin/bpf-api?category=code)Idomatic Rust bindings for eBPF programs, probes, and maps.
The motive behind this crate and sister crates: `btf`, `btf-derive`, `bpf-ins`, and `bpf-script`, aside from learning more about eBPF, was to be able to have a fully Rust eBPF solution. That is, the ability to easily write, compile, and attach BPF programs and use maps without any dependencies on bcc, libbpf or any other non-Rust BPF dependencies.
## Usage
For usage examples, see code located in [examples/](examples/) :
| Examples | Description |
|----------|-------------|
|[array](examples/array.rs)| A short example using a BPF array|
|[print-programs](examples/print-programs.rs)| A short example that attachs a probe to `sched_process_exec` and prints program executions|
|[user-tracer](examples/user-tracer.rs)| Probes a given image path and symbol name using uprobes|## TODO
* Add ARM support.
* Make probe attachment easier / write convenience macros.## License
* [MIT license](http://opensource.org/licenses/MIT)