19 Commits (ad9b8ee8dc2b3bcc3f4e203fb46c152b1d228bbb)

Author SHA1 Message Date
Michal Rostecki ad9b8ee8dc Use release profile for eBPF programs by default
This change removes the differentiation between release and dev profiles
for eBPF programs. There is no way eBPF programs can be debugged and
building them with dev profile just makes them slower and often unable
to be verified. They should be always built with the release profile.

After this change, `cargo xtask build-ebpf` is going to build eBPF
programs with release profile. And the userspace program is going to
include eBPF program bytes from target/release/. Regardless of which
profile is being used in the userspace program.

`cargo xtask build-ebpf` has the --profile argument which can be
optionally used (i.e. for user-defined profiles), but by default the
value of that option is `release`.

Signed-off-by: Michal Rostecki <mrostecki@opensuse.org>
3 years ago
Michal Rostecki e1fb8024a6 fentry/fexit: Add template for fentry/fexit programs
Signed-off-by: Michal Rostecki <mrostecki@opensuse.org>
3 years ago
William Findlay d4a4f33902
ebpf: use new SkBuffContext instead of SkSkbContext 3 years ago
William Findlay 3f082e713e
tp_btf: add template for tp_btf programs 3 years ago
William Findlay 7ffb47cc6b
template: add a new template for LSM programs 3 years ago
William Findlay 87e5676648
ebpf: Add rust-analyzer settings for coc.nvim
Mirrors the settings for vscode introduced in e81a33e

Signed-off-by: William Findlay <william@williamfindlay.com>
3 years ago
Alessandro Decina ffa931552e ebpf: use core::hint::unreachable_unchecked()
unreachable!() can panic when debug assertions is on, and we don't want
that inside a panic handler
3 years ago
Dave Tucker c07fea5fbf ebpf: Add rust toolchain override
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Dave Tucker e81a33efcb ebpf: Add rust-analyzer settings for vscode
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Alessandro Decina 7baf4f5688 Sleep while waiting for SIGINT 3 years ago
Alessandro Decina 6d30972fdb ebpf: set debug = 1 to avoid a potential segfault in LLVM 3 years ago
Alessandro Decina dcf738cd46 Switch git urls to aya-rs 3 years ago
Dave Tucker 566934ccb6
Merge pull request #3 from aya-rs/skel
Use cargo-generate conditionals to provide skeletons for all supported program types
3 years ago
Dave Tucker 60badbcc73
Merge pull request #4 from alessandrod/cargo-toml-target
ebpf: set target and enable -Z build-std in .cargo/config.toml
3 years ago
Alessandro Decina 81a98fe13a ebpf: set opt-level = 2
Pretty much all non trivial programs need at least opt-level=2 to
compile and link successfully
3 years ago
Alessandro Decina a9a659716b ebpf: set target and enable -Z build-std in .cargo/config.toml
This makes it possible to build with:

    cd {{project-name}}-ebpf && cargo +nightly build
3 years ago
Dave Tucker d98d90be7a Generate Skeleton Programs for all program types
User may specify a program_type by prompt or CLI flag.
We then generate skeleton code to the ebpf program for a noop program of
that type.

Requires cargo-generate@main

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Dave Tucker 5d018fd6ba Add xtask for building ebpf programs
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago
Dave Tucker 9e1c761d8d Initial Commit
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 years ago