Releases: aya-rs/aya
aya-log-ebpf v0.1.0
Chore
- add version keys to Cargo.toml(s)
- Rename bpf -> ebpf
- Rename bpf dir to ebpf
Chore
- add missing changelogs
Commit Statistics
- 7 commits contributed to the release over the course of 37 calendar days.
- 4 commits were understood as conventional.
- 0 issues like '(#ID)' were seen in commit messages
Commit Details
view details
- Uncategorized
- Release aya-log-ebpf-macros v0.1.0 (2eac95f)
- Add missing changelogs (1d515fe)
- Release aya-ebpf-bindings v0.1.0, aya-ebpf-macros v0.1.0, aya-ebpf v0.1.0 (a34c5e4)
- Add version keys to Cargo.toml(s) (a4ae8ad)
- Merge pull request #528 from dave-tucker/rename-all-the-things (63d8d4d)
- Rename bpf -> ebpf (41c6156)
- Rename bpf dir to ebpf (022aff9)
aya-log-ebpf-macros v0.1.0
Chore
-
Don't use path deps in workspace
This moves the path dependencies back into the per-crate Cargo.toml.
It is required such that the release tooling can correctly calculate
which version constraints require changing when we perform a release. -
Use the cargo workspace package table
This allows for inheritance of common fields from the workspace root.
The following fields have been made common:- authors
- license
- repository
- homepage
- edition
Chore
- add missing changelogs
New Features
- check format and value type in proc macro
Other
-
fix hygiene
Before this change we leaked some bindings to the calling scope, so for
instance logging a variable named "len" led to a compile error. -
group_imports = "StdExternalCrate"
High time we stop debating this; let the robots do the work. -
s/Result<usize, ()>/Option/
Option<NonZeroUsize>
is guaranteed to have the same size asusize
,
which is not guarnateed forResult
. This is a minor optimization, but
also results in simpler code. -
Define dependencies on the workspace level
This way we will avoid version mismatches and make differences in
features across our crates clearer. -
simplify argument validation
-
avoid requiring Copy
Before this change:error[E0382]: use of moved value: `no_copy` --> test/integration-ebpf/src/log.rs:35:9 | 33 | let no_copy = NoCopy {}; | ------- move occurs because `no_copy` has type `NoCopy`, which does not implement the `Copy` trait 34 | 35 | debug!(&ctx, "{:x}", no_copy.consume()); | ^^^^^^^^^^^^^^^^^^^^^-------^---------^ | | | | | | | `no_copy` moved due to this method call | | use occurs due to use in closure | value used here after move | note: `NoCopy::consume` takes ownership of the receiver `self`, which moves `no_copy` --> test/integration-ebpf/src/log.rs:28:24 | 28 | fn consume(self) -> u64 { | ^^^^ = note: this error originates in the macro `debug` (in Nightly builds, run with -Z macro-backtrace for more info) For more information about this error, try `rustc --explain E0382`. error: could not compile `integration-ebpf` (bin "log") due to previous error
-
fix compile errors
aya-log-ebpf-macros was failing to compile because it was referencing
a couple ofDisplayHint
variants that no longer exist. These were
removed in #599.Compiling aya-log-ebpf-macros v0.1.0 (/home/robert/aya/aya-log-ebpf-macros) error[E0599]: no variant or associated item named `Ipv4` found for enum `DisplayHint` in the current scope --> aya-log-ebpf-macros/src/expand.rs:93:22 | 93 | DisplayHint::Ipv4 => parse_str("::aya_log_ebpf::macro_support::check_impl_ipv4"), | ^^^^ variant or associated item not found in `DisplayHint`
-
Unify IP format hints into one, repsesent it by
:i
token
Having separate format hints and tokens per IP address family is
unnecessary, since they are represented by different types and we handle
format hints for each type separately. So we can just have one format
hint.Also, we should be consistent with the format strings grammar in
Rust[0]. Thetype
token, which is mapped to formatting traits, usually
consists of one letter[1] (and optional?
forDebug
trait, but that
doesn't matter for us). It shouldn't consist of multiple letters. Our
:ipv4
and:ipv6
tokens were clearly breaking that convention, so we
should rather switch to something with one letter - hence:i
.[0] https://doc.rust-lang.org/std/fmt/#syntax
[1] https://doc.rust-lang.org/std/fmt/#formatting-traits -
ensure WriteToBuf is used
Previously any oldwrite
method could be selected. -
update syn requirement from 1.0 to 2.0
Updates the requirements on syn to permit the latest version.
updated-dependencies:
- dependency-name: syn
dependency-type: direct:production
...
- dependency-name: syn
-
Add format hints for MAC addresses
Add{:mac}
(for lower-case hex representation) and{:MAC}
(for
upper-case hex representation) format hints for the[u8; 6]
type,
which is the standard one in Linux to store physical addresses in.Tested with: https://github.com/vadorovsky/aya-examples/tree/main/xdp-mac
-
Fix the DisplayHint expression names
-
Add display hints
This change adds optional display hints:{:x}
,{:X}
- for hex representation of numbers{:ipv4}
,{:IPv4}
- for IPv4 addresses{:ipv6}
,{:IPv6}
- for IPv6 addresses
It also gets rid of dyn-fmt and instead comes with our own parser
implementation.Tested on: https://github.com/vadorovsky/aya-examples/tree/main/tc
Commit Statistics
- 35 commits contributed to the release over the course of 623 calendar days.
- 17 commits were understood as conventional.
- 0 issues like '(#ID)' were seen in commit messages
Commit Details
view details
- Uncategorized
- Release aya-log-parser v0.1.13 (04ee35d)
- Add missing changelogs (1d515fe)
- Release aya-log-common v0.1.14, aya-log v0.2.0 (c22a696)
- Don't use path deps in workspace (13b1fc6)
- Merge pull request #882 from dave-tucker/metadata (0fadd69)
- Use the cargo workspace package table (b3e7ef7)
- Fix hygiene (2227223)
- Merge pull request #797 from aya-rs/rustfmt-group-imports (373fb7b)
- Group_imports = "StdExternalCrate" (d16e607)
- Merge pull request #735 from aya-rs/log-option-not-result (ecf0dd9)
- S/Result<usize, ()>/Option/ (ca3f70b)
- Merge pull request #683 from aya-rs/logs-wtf (5ebaf5f)
- Refactor log macro for readability (b3db916)
- Merge pull request #667 from vadorovsky/workspace-dependencies (f554d42)
- Define dependencies on the workspace level (96fa08b)
- Merge pull request #611 from probulate/check-refs-not-values (3f1a469)
- Simplify argument validation (6feebef)
- Avoid requiring Copy (de79724)
- Fix compile errors (47a2f25)
- Unify IP format hints into one, repsesent it by
:i
token (84e5e28) - Merge pull request #606 from Hanaasagi/check-format-in-log (58f1ecb)
- Check format and value type in proc macro (0970300)
- Merge pull request #585 from probulate/tag-len-value (5165bf2)
- Ensure WriteToBuf is used (4d098ef)
- Merge pull request #550 from aya-rs/dependabot/cargo/syn-2.0 (3ad3cb9)
- Update syn requirement from 1.0 to 2.0 (45072c0)
- Merge pull request #456 from dmitris/uninlined_format_args (16b029e)
- Fix uninlined_format_args clippy issues (055d94f)
- Merge pull request #436 from vadorovsky/aya-log-mac-addr (3adb9b0)
- Add format hints for MAC addresses (2223ab8)
- Fix the DisplayHint expression names (9a8409e)
- Add display hints (83ec27f)
- Change from Rust edition 2018 to 2021 (944d6b8)
- Merge pull request #350 from dave-tucker/monorepo (f37a514)
- Re-organize into a single workspace (dc31e11)
aya-ebpf v0.1.0
Chore
- Rename BpfContext -> EbpfContext
- Rename bpf -> ebpf
- Rename bpf -> ebpf
Chore
- add version keys to Cargo.toml(s)
Chore
- add changelogs
Commit Statistics
- 9 commits contributed to the release over the course of 31 calendar days.
- 5 commits were understood as conventional.
- 0 issues like '(#ID)' were seen in commit messages
Commit Details
view details
- Uncategorized
- Release aya-ebpf-macros v0.1.0, aya-ebpf v0.1.0 (eb3947b)
- Release aya-ebpf-bindings v0.1.0, aya-ebpf-macros v0.1.0, aya-ebpf v0.1.0 (a34c5e4)
- Add version keys to Cargo.toml(s) (a4ae8ad)
- Release aya-ebpf-bindings v0.1.0, aya-ebpf-macros v0.1.0, aya-ebpf v0.1.0 (b8964d3)
- Add changelogs (c7fe60d)
- Merge pull request #528 from dave-tucker/rename-all-the-things (63d8d4d)
- Rename BpfContext -> EbpfContext (d7af6ac)
- Rename bpf -> ebpf (ea80737)
- Rename bpf -> ebpf (41c6156)
aya-ebpf-macros v0.1.0
Chore
- Rename bpf -> ebpf
Chore
- add changelogs
Commit Statistics
- 8 commits contributed to the release over the course of 31 calendar days.
- 2 commits were understood as conventional.
- 0 issues like '(#ID)' were seen in commit messages
Commit Details
view details
- Uncategorized
- Release aya-ebpf-macros v0.1.0 (90f68db)
- Release aya-ebpf-macros v0.1.0, aya-ebpf v0.1.0 (eb3947b)
- Release aya-ebpf-bindings v0.1.0, aya-ebpf-macros v0.1.0, aya-ebpf v0.1.0 (a34c5e4)
- Release aya-ebpf-bindings v0.1.0, aya-ebpf-macros v0.1.0, aya-ebpf v0.1.0 (b8964d3)
- Add changelogs (c7fe60d)
- Release aya-ebpf-cty v0.2.1, aya-ebpf-bindings v0.1.0, aya-ebpf-macros v0.1.0, aya-ebpf v0.1.0 (e372fcf)
- Merge pull request #528 from dave-tucker/rename-all-the-things (63d8d4d)
- Rename bpf -> ebpf (ea80737)
aya-ebpf-cty v0.2.1
Chore
- Rename bpf -> ebpf
Commit Statistics
- 2 commits contributed to the release over the course of 29 calendar days.
- 1 commit was understood as conventional.
- 0 issues like '(#ID)' were seen in commit messages
Commit Details
aya-ebpf-bindings v0.1.0
Chore
- Rename bpf -> ebpf
Chore
- add version keys to Cargo.toml(s)
Chore
- add changelogs
Other
- Generate new bindings
Commit Statistics
- 6 commits contributed to the release over the course of 31 calendar days.
- 4 commits were understood as conventional.
- 0 issues like '(#ID)' were seen in commit messages
Commit Details
view details
- Uncategorized
aya v0.12.0
New Features
- Support for Ring Buffer, which was perhaps our biggest requested feature
- And too many other things to name since it's been a while since our last release 😓
Breaking Changes
Please consult the documentation on Breaking Changes to easily migrate from v0.11.0 to v0.12.0.
Commit Statistics
- 433 commits contributed to the release over the course of 631 calendar days.
- 631 days passed between releases.
- 182 commits were understood as conventional.
- 0 issues like '(#ID)' were seen in commit messages
Commit Details
view details
- Uncategorized
- Don't use path deps in workspace (
13b1fc6
) - Merge pull request #892 from dave-tucker/breaking-changes-v2 (
daa5a47
) - Merge pull request #891 from dave-tucker/changelog (
431ce23
) - Document more breaking changes (
2d9d7a1
) - Add CHANGELOG (
12280a8
) - Merge pull request #889 from dave-tucker/breaking-changes (
5c9c044
) - Document breaking changes (
281ac1a
) - Merge pull request #882 from dave-tucker/metadata (
0fadd69
) - Use the cargo workspace package table (
b3e7ef7
) - Merge pull request #885 from dave-tucker/nightly-up (
2d72197
) - Appease clippy unused imports (
770a95e
) - Appease rustc dead_code lint (
963dd13
) - Invalid transmute when calling fd (
c31cce4
) - Merge pull request #878 from alessandrod/missing-exports (
46b4805
) - Reformat to please rustfmt (
2be705b
) - Reorder imports a bit (
9b4f876
) - Export some missing modules (
d570450
) - Perf_event: add inherit argument to attach() (
0f6a734
) - Add StackTraceMap::remove() (
92b1947
) - Merge pull request #865 from tamird/appease-lint (
09851a2
) - Appease new nightly clippy lints (
7022528
) - Merge pull request #861 from tamird/appease-lint (
604742a
) - Appease nightly lint (
7c1bfef
) - Add SchedClassifier::attach_to_link (
2257cbe
) - Add SchedClassifierLink::attach_type() getter (
b13645b
) - Merge pull request #858 from dave-tucker/ringbuf-doctests (
13f21dc
) - Fix ringbuf docs (
e9e2f48
) - Pin for (async)perf_event_array (
b176967
) - Merge pull request #843 from ajwerner/ringbuf-send-sync (
931cd55
) - Make RingBuf: Send + Sync (
c06fcc3
) - Extracting program and map names with the same function (
15faca8
) - Add MapInfo struct following the same pattern as ProgramInfo (
4d24d1c
) - Support loading a map by fd (
36420d9
) - Make KernelVersion::code public (
68ba020
) - Merge pull request #746 from dave-tucker/markdownlint (
958931e
) - Add markdownlint (
8780a50
) - Merge pull request #825 from aya-rs/dependabot/cargo/async-io-2.0 (
67fe16e
) - Update async-io requirement from 1.3 to 2.0 (
c89b2d1
) - Merge pull request #821 from Tuetuopay/fix-udeps (
f037a94
) - Fix unused async-io dependency linter error (
984c08c
) - Merge pull request #629 from ajwerner/ringbuf (
6284994
) - Implement RingBuf (
e2cf734
) - Move mmap from perf_buffer.rs to sys/mod.rs (
4af9d1b
) - Impl Fromobj::InvalidMapTypeError for MapTypeError (
b73c0a4
) - Merge pull request #814 from tamird/sort-variants-again (
cb455fe
) - Sort variants (
8462b69
) - Merge pull request #812 from tamird/redundant-cargo (
715d490
) - Merge pull request #813 from tamird/sort-variants (
ae612a0
) - Merge pull request #811 from tamird/libc (
b7ceee4
) - Import types from std::ffi rather than libc (
5cdd1ba
) - Sort variants (
5e63707
) - Remove redundant keys (
cc48523
) - Merge pull request #783 from astoycos/map_pin2 (
ef27bce
) - Add pin() api (
7b71c7e
) - Fix libbpf_pin_by_name (
0bf97eb
) - Merge pull request #806 from vadorovsky/deprecate-syscall-prefix (
66bd85a
) - Deprecate
syscall_prefix
(bd6ba3a
) - Merge pull request #797 from aya-rs/rustfmt-group-imports (
373fb7b
) - Group_imports = "StdExternalCrate" (
d16e607
) - Merge pull request #791 from nrxus/fix-kernel-code-on-submode-gt-255 (
6786383
) - Fix program loading on kernels with a patch > 255 (
0a6a267
) - Merge pull request #527 from Tuetuopay/xdpmaps (
7f9ce06
) - Aya, bpf: misc fixes following review comments (
579e3ce
) - Merge pull request #769 from astoycos/fix-loaded-at (
c130500
) - Fix load time and add test (
dffff1c
) - Make maps work on kernels not supporting ProgIds ([
00dc7a5
](htt...
- Don't use path deps in workspace (
aya-obj v0.1.0
Chore
-
Use the cargo workspace package table
This allows for inheritance of common fields from the workspace root.
The following fields have been made common:- authors
- license
- repository
- homepage
- edition
-
Appease clippy unused imports
Documentation
- Add CHANGELOG
Other
-
appease new nightly clippy lints
error: unnecessary use of `get("foo").is_some()` --> aya-obj/src/obj.rs:1690:26 | 1690 | assert!(obj.maps.get("foo").is_some()); | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key("foo")` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check note: the lint level is defined here --> aya-obj/src/lib.rs:68:9 | 68 | #![deny(clippy::all, missing_docs)] | ^^^^^^^^^^^ = note: `#[deny(clippy::unnecessary_get_then_check)]` implied by `#[deny(clippy::all)]` error: unnecessary use of `get("foo").is_some()` --> aya-obj/src/obj.rs:1777:26 | 1777 | assert!(obj.maps.get("foo").is_some()); | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key("foo")` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check error: unnecessary use of `get("bar").is_some()` --> aya-obj/src/obj.rs:1778:26 | 1778 | assert!(obj.maps.get("bar").is_some()); | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key("bar")` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check error: unnecessary use of `get("baz").is_some()` --> aya-obj/src/obj.rs:1779:26 | 1779 | assert!(obj.maps.get("baz").is_some()); | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key("baz")` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check error: unnecessary use of `get(".bss").is_some()` --> aya-obj/src/obj.rs:1799:26 | 1799 | assert!(obj.maps.get(".bss").is_some()); | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(".bss")` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check error: unnecessary use of `get(".rodata").is_some()` --> aya-obj/src/obj.rs:1810:26 | 1810 | assert!(obj.maps.get(".rodata").is_some()); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(".rodata")` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check error: unnecessary use of `get(".rodata.boo").is_some()` --> aya-obj/src/obj.rs:1821:26 | 1821 | assert!(obj.maps.get(".rodata.boo").is_some()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(".rodata.boo")` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check error: unnecessary use of `get(".data").is_some()` --> aya-obj/src/obj.rs:1832:26 | 1832 | assert!(obj.maps.get(".data").is_some()); | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(".data")` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check error: unnecessary use of `get(".data.boo").is_some()` --> aya-obj/src/obj.rs:1843:26 | 1843 | assert!(obj.maps.get(".data.boo").is_some()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(".data.boo")`
-
Handle lack of match of enum variants correctly
When comparinglocal_spec
withtarget_spec
for enum relocations,
we can encounter a situation when a matchinng variant in a candidate
spec doesn't exist.Before this change, such case wasn't handled explicitly, therefore
resulted in returning currently constructedtarget_spec
at the
end. The problem is that suchtarget_spec
was, due to lack of
match, incomplete. It didn't contain anyaccessors
norparts
.Later usage of such incomplete
target_spec
was leading to panics,
since the code operating on enums'target_spec
expects at least
oneaccessor
to be available. -
don't parse labels as programs
Fixes a bug introduced by #413 where
we were generating a bunch of spurious LBB* programs. -
remove redundant keys
default-features = false
is already in the root Cargo.toml. -
group_imports = "StdExternalCrate"
High time we stop debating this; let the robots do the work. -
make maps work on kernels not supporting ProgIds
On startup, the kernel is probed for support of chained program ids for
CpuMap, DevMap and DevMapHash, and will patch maps at load time to have
the proper size. Then, at runtime, the support is checked and will error
out if a program id is passed when the kernel does not support it. -
add support for map-bound XDP programs
Such programs are to be bound to cpumap or devmap instead of the usual
network interfaces. -
MapFd
andSockMapFd
are owned -
reduce indirection in section parsing
Remove repetition of permitted cgroup attach types. Make optionality of
name more explicit rather than pretending both kind and name are equal
to section. -
MapData::fd is non-optional
The primary driver of change here is thatMapData::create
is now a
factory function that returnsResult<Self, _>
rather than mutating
&mut self
. The remaining changes are consequences of that change, the
most notable of which is the removal of several errors which are no
longer possible. -
Add clang-format
-
s/types.types[i]/*t/ where possible
We already have a mutable reference in scope, use it where possible. -
Mutate BTF in-place without clone
The BTF we're working on is Cow anyway so modifying in-place is fine.
All we need to do is store some information before we start our
mutable iteration to avoid concurrently borrowing types both mutably and
immutably. -
use Self instead of restating the type
-
avoid multiple vector allocations
Rather than creating an empty vector and iteratively appending - which
might induce intermediate allocations - create an ExactSizeIterator and
collect it into a vector, which should produce exactly one allocation. -
Fix (func|line)_info multiple progs in section
This commit fixes the (func|line)_info when we have multiple programs in
the same section. The integration test reloc.bpf.c serves as our test
case here. This required filtering down the (func|line)_info to only
that in scope of the current symbol + then adjusting the offets to
appease the kernel. -
Remove name from ProgramSection
The name here is never used as we get the program name from the symbol
table instead. -
Propagate sleepable into ProgramSection
-
Find programs using the symbol table
This makes a few changes to the way that Aya reads the ELF object
files.- To find programs in a section, we use the symbols table. This allows
for cases where multiple programs could appear in the same section. - When parsing our ELF file we build symbols_by_section_index as an
optimization as we use it for legacy maps, BTF maps and now programs.
As a result of theses changes the "NAME" used in
bpf.prog_mut("NAME")
is now ALWAYS the same as the function name in the eBPF code, making the
user experience more consistent. - To find programs in a section, we use the symbols table. This allows
-
better panic messages
Always include operands in failing assertions. Use assert_matches over
manual match + panic. -
Define dependencies on the workspace level
This way we will avoid version mismatches and make differences in
features across our crates clearer. -
<csr-id-6f2a8c8a5c47098fb...
aya-log v0.2.0
Chore
-
Don't use path deps in workspace
This moves the path dependencies back into the per-crate Cargo.toml.
It is required such that the release tooling can correctly calculate
which version constraints require changing when we perform a release. -
Use the cargo workspace package table
This allows for inheritance of common fields from the workspace root.
The following fields have been made common:- authors
- license
- repository
- homepage
- edition
Documentation
- Add CHANGELOG
New Features
- check format and value type in proc macro
Bug Fixes
- remove some useless code
Other
-
group_imports = "StdExternalCrate"
High time we stop debating this; let the robots do the work. -
s/Result<usize, ()>/Option/
Option<NonZeroUsize>
is guaranteed to have the same size asusize
,
which is not guarnateed forResult
. This is a minor optimization, but
also results in simpler code. -
Define dependencies on the workspace level
This way we will avoid version mismatches and make differences in
features across our crates clearer. -
add formatter and check in CI
-
Unify IP format hints into one, repsesent it by
:i
token
Having separate format hints and tokens per IP address family is
unnecessary, since they are represented by different types and we handle
format hints for each type separately. So we can just have one format
hint.Also, we should be consistent with the format strings grammar in
Rust[0]. Thetype
token, which is mapped to formatting traits, usually
consists of one letter[1] (and optional?
forDebug
trait, but that
doesn't matter for us). It shouldn't consist of multiple letters. Our
:ipv4
and:ipv6
tokens were clearly breaking that convention, so we
should rather switch to something with one letter - hence:i
.[0] https://doc.rust-lang.org/std/fmt/#syntax
[1] https://doc.rust-lang.org/std/fmt/#formatting-traits -
support logging byte slices
These only support LowerHex and UpperHex hints for now. -
check errors in tests
-
Move the
Pod
implementations from aya-log-common to aya-log
Keeping thePod
implementations and optional dependency on aya in
aya-log-common breaks the clippy checks (which are made on the entire
workspace).The reason is that when different crates inside the workspace have the
same dependency with different features, that dependency is built only
once with the sum of features needed by all crates. It's not being
built separately with different feature sets.That's why, before this change, aya-log-common was built once for the
entire workspace withuserspace
feature enabled. That made importing
aya-log-ebpf inside integration-ebpf impossible. The aya-log-common
build, withuserspace
feature enabled, was pulling std as a
dependency. Therefore, importing aya-log-ebpf inside integration-ebpf
resulted in including std and errors like:error[E0152]: found duplicate lang item `panic_impl` --> test/integration-ebpf/src/log.rs:23:1 | 23 | fn panic(_info: &core::panic::PanicInfo) -> ! { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the lang item is first defined in crate `std` (which `aya` depends on)
This change fixes the problem by removing the
userspace
feature from
aya-log-common and moving thePod
implementations to aya-log. -
update env_logger requirement from 0.9 to 0.10
Updates the requirements on env_logger to permit the latest version.
updated-dependencies:
- dependency-name: env_logger
dependency-type: direct:production
...
- dependency-name: env_logger
Commit Statistics
- 37 commits contributed to the release over the course of 469 calendar days.
- 469 days passed between releases.
- 14 commits were understood as conventional.
- 0 issues like '(#ID)' were seen in commit messages
Commit Details
view details
- Uncategorized
- Add CHANGELOG (9abb716)
- Release aya-log-common v0.1.14, aya-log v0.2.0 (c22a696)
- Release aya-obj v0.1.0, aya v0.12.0, safety bump aya-log v0.2.0 (0e99fa0)
- Don't use path deps in workspace (13b1fc6)
- Merge pull request #882 from dave-tucker/metadata (0fadd69)
- Use the cargo workspace package table (b3e7ef7)
- Appease rustc dead_code lint (963dd13)
- Merge pull request #797 from aya-rs/rustfmt-group-imports (373fb7b)
- Group_imports = "StdExternalCrate" (d16e607)
- Merge pull request #736 from aya-rs/logging-better (45df251)
- Merge pull request #735 from aya-rs/log-option-not-result (ecf0dd9)
- S/Result<usize, ()>/Option/ (ca3f70b)
- Remove pointless DefaultLogger (00d265c)
- Merge pull request #667 from vadorovsky/workspace-dependencies (f554d42)
- Define dependencies on the workspace level (96fa08b)
- Merge pull request #666 from aya-rs/toml-fmt (dc3b0b8)
- Add formatter and check in CI (c8bf646)
- Merge pull request #650 from aya-rs/test-cleanup (61608e6)
- Remove "async" feature (fa91fb4)
- Unify IP format hints into one, repsesent it by
:i
token (84e5e28) - Remove some useless code (d999a95)
- Check format and value type in proc macro (0970300)
- Merge pull request #585 from probulate/tag-len-value (5165bf2)
- Support logging byte slices (d9f966e)
- Aya-log, aya-log-common: economize bytes (a4a69a6)
- Check errors in tests (e4537e3)
- Aya-log, aya-log-common: Remove duplicate struct (490d7d5)
- Merge pull request #591 from vadorovsky/aya-log-impl-pod (3d3ce8b)
- Move the
Pod
implementations from aya-log-common to aya-log (5603d72) - Merge pull request #484 from vadorovsky/update-tokio (bea0e83)
- Update Tokio and inventory (dad75f4)
- Don't panic in init when bpf programs don't log (12927cf)
- Merge pull request #456 from dmitris/uninlined_format_args (16b029e)
- Fix uninlined_format_args clippy issues (055d94f)
- Merge pull request #449 from aya-rs/dependabot/cargo/env_logger-0.10 (f9bef9f)
- Update env_logger requirement from 0.9 to 0.10 (1c8088b)
- Revert "aya-log, aya-log-common: temporarily revert to old map API so we can release" (0b41018)
aya-log-common v0.1.14
Chore
-
Use the cargo workspace package table
This allows for inheritance of common fields from the workspace root.
The following fields have been made common:- authors
- license
- repository
- homepage
- edition
Documentation
- Add CHANGELOG
New Features
- check format and value type in proc macro
Bug Fixes
- remove some useless code
Other
-
update comments
These were missed when the code was updated. -
s/Result<usize, ()>/Option/
Option<NonZeroUsize>
is guaranteed to have the same size asusize
,
which is not guarnateed forResult
. This is a minor optimization, but
also results in simpler code. -
annotate logging functions inlining
Some of these functions fail to compile when not inlined, so we should
be explicit.Before deciding on this approach I tried various ways of making all
these functions #[inline(never)] to save instructions but I ran into
blockers:- These functions currently return Result, which is a structure. This is
not permitted in BPF. - I tried inventing a newtype that is a #[repr(transparent)] wrapper of
u16, and having these functions return that; however it seems that
even if the object code is legal, the verifier will reject such
functions because the BTF (if present, and it was in my local
experiments) would indicate that the return is a structure. - I tried having these functions return a plain u16 where 0 means error,
but the verifier still rejected the BTF because the receiver (even if
made into &self) is considered a structure, and forbidden.
We can eventually overcome these problems by "lying" in our BTF once
support for it matures in the bpf-linker repo (e.g. Option
should be perfectly legal as it is guaranteed to be word-sized), but we
aren't there yet, and this is the safest thing we can do for now. - These functions currently return Result, which is a structure. This is
-
Simplify
- Remove
TagLenValue
; this type has a single method, which is now a
function. - Remove generics from
TagLenValue::write
(nowwrite
). The tag is
alwaysu8
, and the value is always a sequence of bytes. - Replace slicing operations which can panic with calls to
get
which
explicit check bounds.
- Remove
-
Define dependencies on the workspace level
This way we will avoid version mismatches and make differences in
features across our crates clearer. -
add formatter and check in CI
-
simplify argument validation
-
avoid requiring Copy
Before this change:error[E0382]: use of moved value: `no_copy` --> test/integration-ebpf/src/log.rs:35:9 | 33 | let no_copy = NoCopy {}; | ------- move occurs because `no_copy` has type `NoCopy`, which does not implement the `Copy` trait 34 | 35 | debug!(&ctx, "{:x}", no_copy.consume()); | ^^^^^^^^^^^^^^^^^^^^^-------^---------^ | | | | | | | `no_copy` moved due to this method call | | use occurs due to use in closure | value used here after move | note: `NoCopy::consume` takes ownership of the receiver `self`, which moves `no_copy` --> test/integration-ebpf/src/log.rs:28:24 | 28 | fn consume(self) -> u64 { | ^^^^ = note: this error originates in the macro `debug` (in Nightly builds, run with -Z macro-backtrace for more info) For more information about this error, try `rustc --explain E0382`. error: could not compile `integration-ebpf` (bin "log") due to previous error
-
fix compile errors
aya-log-ebpf-macros was failing to compile because it was referencing
a couple ofDisplayHint
variants that no longer exist. These were
removed in #599.Compiling aya-log-ebpf-macros v0.1.0 (/home/robert/aya/aya-log-ebpf-macros) error[E0599]: no variant or associated item named `Ipv4` found for enum `DisplayHint` in the current scope --> aya-log-ebpf-macros/src/expand.rs:93:22 | 93 | DisplayHint::Ipv4 => parse_str("::aya_log_ebpf::macro_support::check_impl_ipv4"), | ^^^^ variant or associated item not found in `DisplayHint`
-
Unify IP format hints into one, repsesent it by
:i
token
Having separate format hints and tokens per IP address family is
unnecessary, since they are represented by different types and we handle
format hints for each type separately. So we can just have one format
hint.Also, we should be consistent with the format strings grammar in
Rust[0]. Thetype
token, which is mapped to formatting traits, usually
consists of one letter[1] (and optional?
forDebug
trait, but that
doesn't matter for us). It shouldn't consist of multiple letters. Our
:ipv4
and:ipv6
tokens were clearly breaking that convention, so we
should rather switch to something with one letter - hence:i
.[0] https://doc.rust-lang.org/std/fmt/#syntax
[1] https://doc.rust-lang.org/std/fmt/#formatting-traits -
support logging byte slices
These only support LowerHex and UpperHex hints for now. -
generalize TagLenValue
This allows logging values backed by generators. -
Move the
Pod
implementations from aya-log-common to aya-log
Keeping thePod
implementations and optional dependency on aya in
aya-log-common breaks the clippy checks (which are made on the entire
workspace).The reason is that when different crates inside the workspace have the
same dependency with different features, that dependency is built only
once with the sum of features needed by all crates. It's not being
built separately with different feature sets.That's why, before this change, aya-log-common was built once for the
entire workspace withuserspace
feature enabled. That made importing
aya-log-ebpf inside integration-ebpf impossible. The aya-log-common
build, withuserspace
feature enabled, was pulling std as a
dependency. Therefore, importing aya-log-ebpf inside integration-ebpf
resulted in including std and errors like:error[E0152]: found duplicate lang item `panic_impl` --> test/integration-ebpf/src/log.rs:23:1 | 23 | fn panic(_info: &core::panic::PanicInfo) -> ! { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: the lang item is first defined in crate `std` (which `aya` depends on)
This change fixes the problem by removing the
userspace
feature from
aya-log-common and moving thePod
implementations to aya-log. -
update num_enum requirement from 0.5 to 0.6
Updates the requirements on num_enum to permit the latest version.
updated-dependencies:
- dependency-name: num_enum
dependency-type: direct:production
...
- dependency-name: num_enum
Commit Statistics
- 37 commits contributed to the release over the course of 469 calendar days.
- 469 days passed between releases.
- 18 commits were understood as conventional.
- 0 issues like '(#ID)' were seen in commit messages
Commit Details
view details
- Uncategorized
- Add CHANGELOG (4f0f095)
- Release aya-log-common v0.1.14, aya-log v0.2.0 (c22a696)
- Merge pull request #882 from dave-tucker/metadata (0fadd69)
- Use the cargo workspace package table (b3e7ef7)
- Merge pull request #738 from aya-rs/kill-qemu-better (fbbf191)
- Update comments (b54a106)
- Merge pull request #735 from aya-rs/log-option-not-result (ecf0dd9)
- S/Result<usize, ()>/Option/ (ca3f70b)
- Merge pull request #729 from aya-rs/logs-inline-always (84d5791)
- Annotate logging functions inlining (3cfd886)
- Simplify (fe047d7)
- Merge pull request #667 from vadorovsky/workspace-dependencies (f554d42)
- Define dependencies on the workspace level (96fa08b)
- Merge pull request #666 from aya-rs/toml-fmt (dc3b0b8)
- Add formatter and check in CI (c8bf646)
- Merge pull request #650 from aya-rs/test-cleanup (61608e6)
- Include ~all crates in default members (6d06e2b)
- Merge pull request #641 from aya-rs/logger-messages-plz (4c0983b)
- Add missing test annotation (7f25956)
- Merge pull request #611 from probulate/check-refs-not-values (3f1a469)
- Simplify argument validation (6feebef)
- Avoid requiring Copy (de79724)
- Fix compile errors (47a2f25)
- Unify IP format hints into one, repsesent it by
:i
token (84e5e28) - Merge pull request #606 from Hanaasagi/check-format-in-log (58f1ecb)
- Remove some useless code (d999a95)
- Check format and value type in proc macro (0970300)
- Merge pull request #585 from probulate/tag-len-value (5165bf2)
- Support logging byte slices (d9f966e)
- Generalize TagLenValue (9a1a720)
- Aya-log, aya...