Commit Graph

80 Commits (80ff80aa9ecbd86213ee27b0e7ec06872adc2ced)

Author SHA1 Message Date
Dave Tucker dc44c8cd99 chore: Add LICENSE
This adds a LICENSE to the generated code, but also to the code included
in this repository. To make things simple, userspace code is Apache/MIT
licensed - like Aya. eBPF code is MIT/GPL which is GPL compatible to
allow use of all the eBPF helper functions, but is also permissively
licensed via the MIT license.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Tamir Duberstein 6580d77fa4 Use aya-build
Tamir Duberstein 77cbc8bcf9 Remove rust-toolchain
Doesn't make much sense in a workspace.
Tamir Duberstein b1d6fb31ea Always build eBPF; remove xtask
Tamir Duberstein 27e7867528 Add cross-compilation to CI
Updates the README to use cargo target config instead of RUSTFLAGS to
avoid setting the linker for ebpf in cargo-in-cargo.
Zero King 0c8fb43804 chore: Format Cargo.toml
Tamir Duberstein 5622ca4df1 Test execution of projects
Tamir Duberstein 940a60e0a3 Move user-facing messages to from log to print
Tamir Duberstein 32f914aa6d Add error context
Tamir Duberstein 263f115fdc Use destructuring
Tamir Duberstein f131e87764 Use TCP listener instead of stream
This doesn't require a listener on the other side.
Tamir Duberstein 7425e7bd2d Add Rust 1.80.1 to CI
Tamir Duberstein 8250a09bc0 Add rustfmt to CI
Tamir Duberstein 5811d6ff56 Replace xtask builds with build scripts
Adapt https://github.com/aya-rs/aya/commit/3d463a3 and subsequent work
to the template. This has worked very well for us in the main project,
and our users should get the same hotness.

Note that xtask is still used for running, as it is in the main project.
Tamir Duberstein ee45752006 Move dependencies to workspace
Add "{{project-name}}-ebpf" to workspace. Update various cargo configs
to match main aya repo.
Xiaobo Liu d889dd373b Upgrade aya version
Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Michal Rostecki f642921fee chore: Use `aya`, `aya-ebpf` and `aya-log` from crates.io
blacker1230 1185fd49d2 Fix sk_msg.
pdliyan 3bee1bcc0f Reverse of sk_msg.
pdliyan 17fe98c37c Have no idea about this failed.
pdliyan 5d04aef980 Try fix the usage of fd().
pdliyan c68f239ad0 Try fix test failed. Let's see if that would pass.
pdliyan 628e6a4f81 Fix unchanged Bpf reference. Would check sock_map latter.
Tamir Duberstein 1247fdea1d socket_filter: fix build
The signature of attach changed in
https://github.com/aya-rs/aya/pull/723.
liyan 288919127c
Update main.rs
liyan 2aeba1b85d
Update {{project-name}}/src/main.rs
Co-authored-by: Alessandro Decina <alessandro.d@gmail.com>
liyan c6ece63d97
Update main.rs
pdliyan 506ce7ec3d make warn info more informative.
pdliyan 0f4584ef7a remove whitespace.
pdliyan d22827603d remove white line.
pdliyan f3eb374c3e remove rlimit use.
pdliyan bc2db6b112 use libc instead of rlimit.
pdliyan f8639db35a add memlock remove.
Tamir Duberstein 3013ab506d
Fix sk_msg tests
These were broken by  which pulled in
https://github.com/aya-rs/aya/pull/397 and other changes which were not
reflected in the templates.
Arindam Das b45787c353
fix: fixes aya and aya-log version mismatch ()
Fixes aya and aya-log version mismatch between {{project-name}}-epbf and {{project-name}} crates.

Fixes https://github.com/aya-rs/aya/issues/565.
Dmitry Savintsev 715967772f upgrade deps: tokio and anyhow
Dmitry Savintsev 7016308147 fix uprobe programs
Signed-off-by: Dmitry Savintsev <dsavints@gmail.com>
Dmitry Savintsev 8cd95c42ea adjust spacing to avoid VSCode changes on save
Signed-off-by: Dmitry Savintsev <dsavints@gmail.com>
Dmitry Savintsev c6c4082093 update anyhow, clap, and tokio
Dmitry Savintsev e7ccd1a71e include and use clap only if needed
Signed-off-by: Dmitry Savintsev <dsavints@gmail.com>
Luca BRUNO 554702e63d
cargo-generate: add perf_event
This adds `perf_event` program type as a template entry.
The new entry comes with a skeleton example which register
scheduled events on each CPU at 1 HZ, triggered by the kernel
(based on clock ticks). The corresponding BPF logic logs each
event, and can identify kernel tasks from userland processes.
Michal Rostecki 2ba73f6f2f
Merge pull request from dmitris/fix-clippy
Fix clippy issues in the generated code.
Dmitry Savintsev e86392d422 Fix clippy issues in the generated code.
Fix template so that the generated code would not have any
clippy issues (per `cargo +nightly clippy`).
Add template conditionals on the program_type to avoid
a warning about unused 'opt' variable.

Fixes .
Michal Rostecki 70475f3b2a Add raw_tracepoint program type
Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
Michal Rostecki 76699e10b2 Update dependencies
Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
Michal Rostecki ab442eb10f Don't fail on `BpfLogger::init()` error
An error during `BpfLogger` initialization most likely means that
`ayalog-ebpf` is not used in the eBPF crate.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
Michal Rostecki 3b831ffda3 Switch from simplelog to env_logger
Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
Dave Tucker 8c6016040e
Merge pull request from dave-tucker/deps
Update dependency
Dave Tucker 3b2b186e0b Update dependency
Use `aya = ">=0.11"` and therefore the Aya version picked by
Cargo will be bounded by the latest version supported in
`aya-log = "0.1"` - once it's been released again.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Kenjiro Nakayama dcb6523ada Fix wrong elif condition