Commit Graph

189 Commits (79b73bf2ef8b59ebe303b6ff236c42048bcda3db)
 

Author SHA1 Message Date
Michal Rostecki 11f406414e Unpin Rust nightly
The issues with core::sync::atomic got fixed.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
Michal Rostecki 80a7c5b53c
Merge pull request from dmitris/crossplat
Remove unix-specific executor in xtask
Dmitry Savintsev 7008f570b0 fail with descriptive message
Co-authored-by: Michal Rostecki <vadorovsky@gmail.com>
Dmitry Savintsev 255c59cf98 Remove unix-specific executor in xtask
Change unix-specific executor to generic one
to enable xtask working on Windows and eventually
be able to cross-compile on Windows.

Fixes .

Signed-off-by: Dmitry Savintsev <dsavints@gmail.com>
Michal Rostecki e03b1f6979
Merge pull request from dmitris/fix-uprobe
Fix uprobe programs and VSCode spacing
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>
Michal Rostecki 999d98cc3d
Merge pull request from dmitris/deps-update
update anyhow, clap, and tokio
Dmitry Savintsev c6c4082093 update anyhow, clap, and tokio
Michal Rostecki fa404ffb26
Merge pull request from dmitris/fix-clippy
include and use clap only if needed
Dmitry Savintsev e7ccd1a71e include and use clap only if needed
Signed-off-by: Dmitry Savintsev <dsavints@gmail.com>
Michal Rostecki 224274f8a7
Merge pull request from lucab/ups/perf-event
cargo-generate: add perf_event
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 65091e30bc
Merge pull request from lucab/ups/fix-sorting
cargo-generate: sort program types
Luca BRUNO 463013a11e cargo-generate: sort program types
Michal Rostecki 7fe5a39b7c
Merge pull request from joshuataylor/feature/rust-toolchain-defaults
Add rust-src to -ebpf components
Michal Rostecki 3fdfd8b200 rust-toolchain: Add a comment about rust-src
Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
Josh Taylor 35d480a341 Add rust-src to components
Michal Rostecki ccdafe53e2
Merge pull request from arctic-alpaca/cargo_clean_env
Honor rust-toolchain.toml file in xtask, remove env vars with CARGO/RUST prefix
arctic-alpaca 9e3027896e
CI: Pin nightly toolchain to 2023-01-10, install bpf-linker on stable
arctic-alpaca 5af9b38bd6
Pin nightly version in -ebpf
arctic-alpaca 5b3653c936
Only remove RUSTUP_TOOLCHAIN env var in xtask build-ebpf
arctic-alpaca 039c07f7a2
Honor rust-toolchain.toml file in xtask, remove cargo/rust env vars
Remove env vars related to rust and cargo before executing cargo.
Michal Rostecki 2ba73f6f2f
Merge pull request from dmitris/fix-clippy
Fix clippy issues in the generated code.
Michal Rostecki 806571f3d3
Merge pull request from vadorovsky/raw-tracepoint
Add raw_tracepoint program type
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 3ac1aa63ce
Merge pull request from vadorovsky/update-deps
Update dependencies
Michal Rostecki 76699e10b2 Update dependencies
Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
Michal Rostecki 4720291f67
Merge pull request from vadorovsky/log_level
readme: Mention `RUST_LOG` env variable
Michal Rostecki cba4774787 readme: Mention `RUST_LOG` env variable
The default log level of env_logger is `error`. We are using `info!` in
the template, so let's suggest running the example with `RUST_LOG=info`.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
Alessandro Decina 864e1995f7
Merge pull request from vadorovsky/aya-log-dont-unwrap
Don't fail on `BpfLogger::init()` error
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 df87136bdb
Merge pull request from vadorovsky/no-unsafe
ebpf: Stop using `unsafe` for the whole function
Michal Rostecki 379b23b1b4 ebpf: Stop using `unsafe` for the whole function
Users should opt in into `unsafe` when performing particular unsafe
actions (accesing raw pointers, interacting with maps etc.), but
assuming that the whole eBPF program code is unsafe is quite an
exaggeration.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
Michal Rostecki ccb2ad0f81
Merge pull request from vadorovsky/static-mut
ebpf: Change `static mut` to `static` in map declaration
Michal Rostecki 0c4b89b497 ebpf: Change `static mut` to `static` in map declaration
Maps are using UnsafeCell for interior mutability, therefore `static
mut` is not needed anymore.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
Dave Tucker 12c43b56bf
Merge pull request from vadorovsky/tc-context
classifier: Use the new `TcContext` struct
Michal Rostecki 1ecc829b4f classifier: Use the new `TcContext` struct
That new context type exposes `data` and `data_end` fields for direct
access to the packet payload.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
Dave Tucker 37410be032
Merge pull request from vadorovsky/monorepo
ebpf: Update git repository URL for aya-log
Dave Tucker 88243bad08
Merge pull request from vadorovsky/env_logger
Switch from simplelog to env_logger
Michal Rostecki 3b831ffda3 Switch from simplelog to env_logger
Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
Michal Rostecki f462b301f4 ebpf: Update git repository URL for aya-log
aya-log was moved to the main aya repository, the old one is archived.

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>
Dave Tucker 02185e1e14
Merge pull request from ishitatsuyuki/patch-1
Fix trailing comma in ebpf/.vscode/settings.json
Tatsuyuki Ishi c15f1d34de
Fix trailing comma in ebpf/.vscode/settings.json
Alessandro Decina 54e16b80f7
Merge pull request from nak3/add-BPF_PROG_TYPE_CGROUP_SOCKOPT
Add cgroup_sockopt template for BPF_PROG_TYPE_CGROUP_SOCKOPT
Kenjiro Nakayama dcb6523ada Fix wrong elif condition
Kenjiro Nakayama 8621ea7d5f Add cgroup_sockopt template for BPF_PROG_TYPE_CGROUP_SOCKOPT