61 Commits (cb9ab797054a664d9a5ac5d58ba817cc5ad3e173)

Author SHA1 Message Date
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.
3 months ago
Tamir Duberstein 5622ca4df1 Test execution of projects 3 months ago
Tamir Duberstein 940a60e0a3 Move user-facing messages to from log to print 3 months ago
Tamir Duberstein 32f914aa6d Add error context 3 months ago
Tamir Duberstein 263f115fdc Use destructuring 3 months ago
Tamir Duberstein f131e87764 Use TCP listener instead of stream
This doesn't require a listener on the other side.
3 months ago
Tamir Duberstein 8250a09bc0 Add rustfmt to CI 3 months ago
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.
3 months ago
Xiaobo Liu d889dd373b Upgrade aya version
Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
3 months ago
Michal Rostecki f642921fee chore: Use `aya`, `aya-ebpf` and `aya-log` from crates.io 9 months ago
blacker1230 1185fd49d2 Fix sk_msg. 10 months ago
pdliyan 3bee1bcc0f Reverse of sk_msg. 10 months ago
pdliyan 17fe98c37c Have no idea about this failed. 10 months ago
pdliyan 5d04aef980 Try fix the usage of fd(). 10 months ago
pdliyan c68f239ad0 Try fix test failed. Let's see if that would pass. 10 months ago
pdliyan 628e6a4f81 Fix unchanged Bpf reference. Would check sock_map latter. 10 months ago
Tamir Duberstein 1247fdea1d socket_filter: fix build
The signature of attach changed in
https://github.com/aya-rs/aya/pull/723.
1 year ago
liyan 288919127c
Update main.rs 2 years ago
liyan 2aeba1b85d
Update {{project-name}}/src/main.rs
Co-authored-by: Alessandro Decina <alessandro.d@gmail.com>
2 years ago
liyan c6ece63d97
Update main.rs 2 years ago
pdliyan 506ce7ec3d make warn info more informative. 2 years ago
pdliyan 0f4584ef7a remove whitespace. 2 years ago
pdliyan d22827603d remove white line. 2 years ago
pdliyan f3eb374c3e remove rlimit use. 2 years ago
pdliyan bc2db6b112 use libc instead of rlimit. 2 years ago
pdliyan f8639db35a add memlock remove. 2 years ago
Tamir Duberstein 3013ab506d
Fix sk_msg tests
These were broken by #89 which pulled in
https://github.com/aya-rs/aya/pull/397 and other changes which were not
reflected in the templates.
2 years ago
Dmitry Savintsev 7016308147 fix uprobe programs
Signed-off-by: Dmitry Savintsev <dsavints@gmail.com>
2 years ago
Dmitry Savintsev e7ccd1a71e include and use clap only if needed
Signed-off-by: Dmitry Savintsev <dsavints@gmail.com>
2 years ago
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.
2 years ago
Michal Rostecki 2ba73f6f2f
Merge pull request #67 from dmitris/fix-clippy
Fix clippy issues in the generated code.
2 years ago
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 #66.
2 years ago
Michal Rostecki 70475f3b2a Add raw_tracepoint program type
Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
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>
2 years ago
Michal Rostecki 3b831ffda3 Switch from simplelog to env_logger
Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
Kenjiro Nakayama dcb6523ada Fix wrong elif condition 3 years ago
Kenjiro Nakayama 8621ea7d5f Add cgroup_sockopt template for BPF_PROG_TYPE_CGROUP_SOCKOPT 3 years ago
Kenjiro Nakayama 3bf8e87b3e Add cgroup_sysctl template for BPF_PROG_TYPE_CGROUP_SYSCTL
Since https://github.com/aya-rs/aya/pull/256 supports `BPF_PROG_TYPE_CGROUP_SYSCTL`,
this patch adds cgroup_sysctl template.
3 years ago
Dave Tucker 807131b955
Merge pull request #33 from nak3/add-socket-filter
Add template for socket_filter program type
3 years ago
Michal Rostecki 0ea4a7eb04 Add aya-log
This change adds aya-log and example log messsages to all eBPF
programs.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
3 years ago
Michal Rostecki f940467c4a Use clap instead of structopt
structopt was merged into clap (starting from clap 3.0), therefore
becoming a deprecated project.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
3 years ago
Michal Rostecki ec1910fffd Revert "Use release profile for eBPF programs by default"
This reverts commit ad9b8ee8dc.
3 years ago
Dmitry Savintsev aa3b2a4407 use edition 2021 3 years ago
Kenjiro Nakayama 8dcda393c4 Add template for socket_filter program type
This patch adds template for socket_filter.
e.g.

```sh
cargo generate --path ~/dev/aya-template \
         --name my-test \
	 -d program_type=socket_filter
```
3 years ago
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
Dmitry Savintsev 4a9e5843a7
fix typo 3 years ago
Dmitry Savintsev c35eadc34b avoid 'cargo fmt' diffs in generated code 3 years ago
Dmitry Savintsev 4d22913931
classifier: don't bail on qdisc_add_clsact error 3 years ago
Michal Rostecki de709c52d0 Use Tokio and simplelog by default
Replace ctrlc usage with Tokio and simplelog.

Signed-off-by: Michal Rostecki <mrostecki@opensuse.org>
3 years ago
Dmitry S 21803634d7 xdp - suggest SKB_MODE on attach failure 3 years ago