Commit Graph

34 Commits (302573d7389674b165b7960ab2d78f2f7984a1ba)
 

Author SHA1 Message Date
Dave Tucker 302573d738 Add CI
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Dave Tucker 351fa6a66e Add vim/vscode rust-analyzer settings
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Dave Tucker f1c71916f7 Add rustfmt.toml
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Dave Tucker 516121a462 ebpf: Add example
This ensures that macro expansion works properly and that expanded code
compiles

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Dave Tucker 0c25d8655e Add Tests
This moves a large chunk of code from ebpf to shared so we can re-use
write_record_header and write_record_message and friends so that we
can write test cases to ensure that logs are properly formatted
given certain input.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Alessandro Decina edc8395fb2
Merge pull request from vadorovsky/buffer-bounds
ebpf: Ensure the bounds of log buffer
Michal Rostecki 9be90f8a74 ebpf: Ensure the bounds of log buffer
eBPF verifier rejects programs which are not checking the bounds of the
log buffer before writing any arguments. This change ensures that
written log arguments.

In practice, it means that doing this kind of checks is not going to be
needed in eBPF program code anymore:

33a1aee2ea/echo-ebpf/src/main.rs (L47)

Tested on:

876f8b4551

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
Michal Rostecki 808575bf56 common: Bump the buffer size
1024 is too small for many kernel string limits (i.e. PATH_MAX, which is
4096).

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
Alessandro Decina 4c7e641987 aya-log, aya-log-common: start next development iteration 0.1.10-dev.0
Alessandro Decina 209d4534de aya-log, aya-log-common: release version 0.1.9
Alessandro Decina 19ebceaab8 Add cargo-release config
Alessandro Decina 4a27a60bfd xtask: do not release
Alessandro Decina 2d701bea33 aya-log: use stricter version for the aya-log-common dep
Alessandro Decina 223e2f4ea1 ebpf: inline write_record_header
This seems to help the verifier keep track of where we're writing into
LOG_BUF
Alessandro Decina d631687e4a
Merge pull request from vadorovsky/fmt-userspace
Format arguments in userspace
Michal Rostecki e89ce9a873 Update aya to 0.10.7
Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
Michal Rostecki ec31526de1 Format arguments in userspace
This change moves away argument formatting from eBPF to the userspace.
eBPF part of aya-log writes unformatted log message and all arguments to
the perf buffer and the userspace part of aya-log is formatting the
message after receiving all arguments.

Aya-based project to test this change:

https://github.com/vadorovsky/aya-log-example

Fixes: 
Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
Signed-off-by: Tuetuopay <tuetuopay@me.com>
Co-authored-by: Tuetuopay <tuetuopay@me.com>
Alessandro Decina 5aa5eb5b76 Don't recompute the record length
Alessandro Decina 00e6d39b13 ebpf: initialize AYA_LOGS with max_entries=0
This way aya will create one perf buffer for each cpu
Alessandro Decina cad8d63aa5 Fix clippy warning
Alessandro Decina db0c543c82 Add copy of README.md inside aya-log/
Needed for crates.io
Alessandro Decina 67908b6f55 Add missing manifest fields
Alessandro Decina a4b8934ce1 (cargo-release) version 0.1.1
Alessandro Decina 1a5f003b2c (cargo-release) version 0.1.1
Alessandro Decina 0ca22d0e32 git add .cargo and xtask
Alessandro Decina 154d886a76 Update to aya 0.10.5
Alessandro Decina d33e0b3d42 Simplify BpfLogger::init
Make BpfLogger::init(bpf) log using the default logger. Add
BpfLoger::init_with_logger(bpf, logger) for logging using a custom
logger instance.
Alessandro Decina 897c94d5b8 Minor tweaks to make the verifier's job easier
Alessandro Decina ac5a2d5dbb Switch to aya-ufmt
Alessandro Decina 54e23141bd Use aya_bpf::maps::PerfEventByteArray to output logs
Alessandro Decina 069013ddc9 Use aya_log_ebpf::ufmt instead of ::ufmt
Alessandro Decina 9205986050 Add ufmt to readme
Alessandro Decina f5d047b3ab Update readme
Alessandro Decina 301092ac2e Initial commit