30 KiB
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
v0.2.1 (2024-10-09)
Chore
- Rename bpf -> ebpf
Documentation
- reword rustdocs a bit
New Features
- Rename Bpf to Ebpf And BpfLoader to EbpfLoader. This also adds type aliases to preserve the use of the old names, making updating to a new Aya release less of a burden. These aliases are marked as deprecated since we'll likely remove them in a later release.
- Rename BpfLogger to EbpfLogger
Bug Fixes
- print &[u8] using full width
Otherwise
&[1u8, 0u8]
cannot be distinguished from&[0x10u8]
(they both become 10)
Other
-
remove unwrap and NonZero* in info Addresses the feedback from #1007:
- remove panic from
unwrap
andexpect
- Option<NonZero*> => Option with
0
mapping toNone
- remove panic from
-
revamp MapInfo be more friendly with older kernels Adds detection for whether a field is available in
MapInfo
:- For
map_type()
, we treturn new enumMapType
instead of the integer representation. - For fields that can't be zero, we return
Option<NonZero*>
type. - For
name_as_str()
, it now uses the feature probebpf_name()
to detect if field is available. Although the feature probe checks for program name, it can also be used for map name since they were both introduced in the same commit.
- For
-
revamp ProgramInfo be more friendly with older kernels Purpose of this commit is to add detections for whether a field is available in
ProgramInfo
.- For
program_type()
, we return the new enumProgramType
instead of the integer representation. - For fields that we know cannot be zero, we return
Option<NonZero*>
type. - For
name_as_str()
, it now also uses the feature probebpf_name()
to detect if field is available or not. - Two additional feature probes are added for the fields:
prog_info_map_ids()
probe ->map_ids()
fieldprog_info_gpl_compatible()
probe ->gpl_compatible()
field
With the
prog_info_map_ids()
probe, the previous implementation that I had forbpf_prog_get_info_by_fd()
is shortened to use the probe instead of having to make 2 potential syscalls.The
test_loaded_at()
test is also moved into info tests since it is better related to the info tests. - For
-
Allow logging
core::net::Ipv4Addr
andcore::net::Ipv6Addr
IP address types are available incore
, so they can be used also in eBPF programs. This change adds support of these types in aya-log.- Add implementation of
WriteTuBuf
to these types. - Support these types in
Ipv4Formatter
andIpv6Formatter
. - Support them with
DisplayHint::Ip
. - Add support for formatting
[u8; 4]
, to be able to handleIpv4Addr::octets
.
- Add implementation of
-
allow re-attach and read previously created logs This feature is useful if someone wants to view the log contents of a program that is already running. For e.g. a pinned program or an XDP program attached to a net interface.
Test
- adjust test byte arrays for big endian Adding support for s390x (big endian architecture) and found that some of the unit tests have structures and files implemented as byte arrays. They are all coded as little endian and need a bug endian version to work properly.
Commit Statistics
- 20 commits contributed to the release.
- 223 days passed between releases.
- 11 commits were understood as conventional.
- 1 unique issue was worked on: #1008
Commit Details
view details
- #1008
- Print &[u8] using full width (
55ed9e0
)
- Print &[u8] using full width (
- Uncategorized
- Release aya-log-common v0.1.15, aya-log-ebpf v0.1.1 (
04bbbcc
) - Release aya-obj v0.2.0, aya v0.13.0, safety bump aya v0.13.0 (
c169b72
) - Reduce duplication in
{nr,possible}_cpus
(f3b2744
) - Remove unwrap and NonZero* in info (
02d1db5
) - Merge pull request #1007 from tyrone-wu/aya/info-api (
15eb935
) - Revamp MapInfo be more friendly with older kernels (
fbb0930
) - Revamp ProgramInfo be more friendly with older kernels (
88f5ac3
) - Merge pull request #974 from Billy99/billy99-arch-ppc64-s390x (
ab5e688
) - Adjust test byte arrays for big endian (
eef7346
) - Revert "Remove unused
allow(dead_code)
" (4161993
) - Remove unused
allow(dead_code)
(5397c1c
) - Allow logging
core::net::Ipv4Addr
andcore::net::Ipv6Addr
(a75fc2f
) - Merge pull request #900 from catalin-h/log_init_from_program_id (
e5d107d
) - Reword rustdocs a bit (
8830c0b
) - Allow re-attach and read previously created logs (
e66f954
) - Merge pull request #528 from dave-tucker/rename-all-the-things (
63d8d4d
) - Rename Bpf to Ebpf (
8c79b71
) - Rename BpfLogger to EbpfLogger (
a93e354
) - Rename bpf -> ebpf (
41c6156
)
- Release aya-log-common v0.1.15, aya-log-ebpf v0.1.1 (
v0.2.0 (2024-02-28)
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]. The
type
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 with
userspace
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 ...
Commit Statistics
- 38 commits contributed to the release.
- 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
- Release aya-log-common v0.1.14, aya-log v0.2.0 (
b6a84b6
) - 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
)
- Release aya-log-common v0.1.14, aya-log v0.2.0 (
v0.1.13 (2022-11-16)
Other
-
release version 0.1.13
-
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
-
Make miri happy Miri took issue about using slice::from_raw_parts without checking for alignment. Instead, we can simply convert to a [u8;16] into a [u16;8] by iterating in chunks of 2 and bitshifting (remembering that these arrays are in network-endian order).
-
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
-
Fix links to aya-log repo The aya-log repo ([0]) has been archived, use the link to aya repo instead.
-
Remove i128 and u128 types They are not supported by eBPF VM and we are going to use arrays for IPv6.
-
use new PerCpuArray::get_ptr_mut API
-
Add example This ensures that macro expansion works properly and that expanded code compiles
-
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:
-
Bump the buffer size 1024 is too small for many kernel string limits (i.e. PATH_MAX, which is 4096).
-
do not release
-
use stricter version for the aya-log-common dep
-
inline write_record_header This seems to help the verifier keep track of where we're writing into LOG_BUF
-
initialize AYA_LOGS with max_entries=0 This way aya will create one perf buffer for each cpu
Commit Statistics
- 59 commits contributed to the release.
- 14 commits were understood as conventional.
- 0 issues like '(#ID)' were seen in commit messages
Commit Details
view details
- Uncategorized
- Release version 0.1.13 (
832bdd2
) - Aya-log, aya-log-common: temporarily revert to old map API so we can release (
0d040d2
) - Merge pull request #436 from vadorovsky/aya-log-mac-addr (
3adb9b0
) - Add format hints for MAC addresses (
2223ab8
) - Merge pull request #397 from astoycos/refactor-map-api2 (
d6cb1a1
) - Make map APIs return an option (
f3262e8
) - Core refactor of Map API (
1aefa2e
) - Merge pull request #390 from dave-tucker/clippy-up (
367ab20
) - Make miri happy (
b2924a3
) - Aya-log, aya-log-common: start next development iteration 0.1.12-dev.0 (
6f0637a
) - Aya-log, aya-log-common: release version 0.1.11 (
ba927ac
) - Add display hints (
83ec27f
) - Change from Rust edition 2018 to 2021 (
944d6b8
) - Merge pull request #361 from chenhengqi/fix-aya-log-links (
632ea30
) - Fix links to aya-log repo (
b8b291c
) - Merge pull request #357 from vadorovsky/env_logger (
3d5ab0b
) - Aya-log, test: Switch from simplelog to env_logger (
3664e1e
) - Merge pull request #353 from vadorovsky/log-remove-u128 (
d968094
) - Remove i128 and u128 types (
611f967
) - Merge pull request #350 from dave-tucker/monorepo (
f37a514
) - Re-organize into a single workspace (
dc31e11
) - Fix the log buffer bounds (
28abaec
) - Ensure log buffer bounds (
2e07028
) - Use new PerCpuArray::get_ptr_mut API (
6aea880
) - Aya-log, aya-log-common: start next development iteration 0.1.11-dev.0 (
526493b
) - Aya-log, aya-log-common: release version 0.1.10 (
3abd973
) - Update aya requirement from 0.10.7 to 0.11.0 (
060ba45
) - Add CI (
0038b43
) - Add vim/vscode rust-analyzer settings (
c1bb790
) - Add rustfmt.toml (
3f00851
) - Add example (
5789585
) - Add Tests (
5d82d9a
) - Ensure the bounds of log buffer (
628b473
) - Bump the buffer size (
70b4e68
) - Aya-log, aya-log-common: start next development iteration 0.1.10-dev.0 (
bd9a5c8
) - Aya-log, aya-log-common: release version 0.1.9 (
8bc1bbb
) - Add cargo-release config (
a8d133f
) - Do not release (
d1a0ce5
) - Use stricter version for the aya-log-common dep (
c4d89fa
) - Inline write_record_header (
bdb2750
) - Update aya to 0.10.7 (
81befa0
) - Format arguments in userspace (
ca1fe7e
) - Don't recompute the record length (
9b229d0
) - Initialize AYA_LOGS with max_entries=0 (
7f8d705
) - Fix clippy warning (
2800454
) - Add copy of README.md inside aya-log/ (
8bde15d
) - Add missing manifest fields (
5e18a71
) - (cargo-release) version 0.1.1 (
31e71f8
) - (cargo-release) version 0.1.1 (
29955b2
) - Git add .cargo and xtask (
6d14a16
) - Update to aya 0.10.5 (
cced3da
) - Simplify BpfLogger::init (
9ab9c80
) - Minor tweaks to make the verifier's job easier (
2ac4334
) - Switch to aya-ufmt (
b14d4ba
) - Use aya_bpf::maps::PerfEventByteArray to output logs (
22d8f86
) - Use aya_log_ebpf::ufmt instead of ::ufmt (
741957f
) - Add ufmt to readme (
0d7ac3e
) - Update readme (
5df853c
) - Initial commit (
b29a061
)
- Release version 0.1.13 (