Go to file
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>
.cargo Add xtask for building ebpf programs
.github/workflows fentry/fexit: Add template for fentry/fexit programs
.vim lsp: use project-name instead of crate_name to generate Cargo.toml path
.vscode lsp: use project-name instead of crate_name to generate Cargo.toml path
xtask Use release profile for eBPF programs by default
{{project-name}} Use release profile for eBPF programs by default
{{project-name}}-common avoid 'cargo fmt' diffs in generated code
{{project-name}}-ebpf Use release profile for eBPF programs by default
.gitignore Initial Commit
Cargo.toml Add xtask for building ebpf programs
README.md userspace: use include_bytes_aligned! instead of --path flag
cargo-generate.toml fentry/fexit: Add template for fentry/fexit programs
test.sh fentry/fexit: Add template for fentry/fexit programs

README.md

{{project-name}}

Prerequisites

  1. Install a rust stable toolchain: rustup install stable
  2. Install a rust nightly toolchain: rustup install nightly
  3. Install bpf-linker: cargo install bpf-linker

Build eBPF

cargo xtask build-ebpf

To perform a release build you can use the --release flag. You may also change the target architecture with the --target flag

Build Userspace

cargo build

Run

cargo xtask run