Skip to content

hewigovens/aya-devcontainer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Aya is an eBPF library for Rust, from Environment section on aya-rs/book, bpf-linker only works on linux x86_64 system

To simplify the development environment setup, we can use Devcontainer to build and run eBPF program in Rust.

for more details, please take a look at devcontainer.json and Dockerfile.

.
├── .devcontainer
│   ├── devcontainer.json
│   └── Dockerfile

How to Use

  • Open this repository in VSCode
  • Install Dev Containers extension
  • Open the command palette (Shift+Command+P)
  • Select Dev Containers: Reopen in Container

Generate ebpf app from aya-template

cargo generate https://github.com/aya-rs/aya-template

cd <your_app_path>

# build both ebpf and userspace app
cargo xtask build

Generate vmlinux.h/rs

bpftool btf dump file /sys/kernel/btf/vmlinux format c > vmlinux.h

aya-tool generate task_struct > vmlinux.rs

Credits

Tweaked from Kevin Sookocheff's blog post.

About

Devcontainer (Docker) image for Aya-rs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published