Commit Graph

3 Commits (90faac2a3a7ee4e416badacb9795bfac7abd8615)

Author SHA1 Message Date
Michal Rostecki 90faac2a3a aya-log: Add `*max_level_*` filter features
Add the following features for configuring the maximum log level
available:

* `max_level_off`
* `max_level_error`
* `max_level_warn`
* `max_level_info`
* `max_level_debug`
* `max_level_trace`
* `release_max_level_off`
* `release_max_level_error`
* `release_max_level_warn`
* `release_max_level_info`
* `release_max_level_debug`
* `release_max_level_trace`

Log invocations at disabled level will be skipped, which is especially
beneficial for eBPF programs which are not going to send unneceessary
logs through perf buffers.

Features with `release_` prefix are used only in release builds.

Those features have to applied on the userspace and eBPF crate
separately. The correct thing to do is to set them on the same level. In
case when userspace has higher maximum log level, it's not going to
recieve the logs beyond the filter in eBPF crate. In the opposite
situation, when eBPF crate has higher maximum level, it's going to waste
cycles on sending logs through perf buffer, while they are not going to
be displayed in the userspace.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
Michal Rostecki 944d6b8a16 Change from Rust edition 2018 to 2021
Rust 2021 adds more core prelude imports, including `TryFrom` and
`TryInto`.

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2 years ago
Dave Tucker dc31e11691 Re-organize into a single workspace
This commit moves the aya-log projects from the subtree and adds them to
the main cargo workspace. It also brings the BPF crates into the
workspace and moves the macro crates up a level since they aren't BPF
code.

Miri was disabled for aya-bpf as the previous config wasn't actually
checking anything.

CI, clippy, fmt and release configurations have all been adjusted
appropriately.

CI was not properly running for other supported arches which was also
ixed here.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago