Commit Graph

1742 Commits (25d986a26d9c88cd499a8b795054d583f01476b2)
 

Author SHA1 Message Date
Dave Tucker 25d986a26d fix(aya): Set PerfEventArray max_entries to nCPUs
Both libbpf and cilium/ebpf have will set the max_entries of a
BPF_MAP_TYPE_PERF_EVENT_ARRAY to the number of online CPUs if
it was omitted at map definition time. This adds that same
logic to Aya.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 months ago
Dave Tucker ef0d1253ef fix(ebpf): Remove PerfEventArray::with_max_entries
This API doesn't make sense as the max_entries needs to be set to the
number of online CPUs by the loader.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 months ago
Tamir Duberstein e12fcf46cb Use MockableFd everywhere
Rust 1.80 contains https://github.com/rust-lang/rust/pull/124210,
causing tests which we skip under miri to segfault.
3 months ago
Michal Rostecki a167554b8b ci: Use apt repository with LLVM 18 explicitly
The unversioned one is suffering from LLVM 19 => 20 migration issues,
see llvm/llvm-project#100466.
4 months ago
Tamir Duberstein 956dd01375 Install Rust toolchain later
`brew` seems to be breaking the rustup installed by rust-toolchain:

```
==> Migrating formula rustup-init to rustup
==> Unlinking rustup-init
==> Moving rustup-init versions to /opt/homebrew/Cellar/rustup
==> Relinking rustup
```

Let's see if this fixes it.
4 months ago
Tamir Duberstein 4025861780 Don't hardcode /usr/local/opt 4 months ago
Tamir Duberstein 28545d3331 Use macos-13 4 months ago
Tamir Duberstein 247486cb7d Remove stale workaround 4 months ago
Tamir Duberstein 5397c1ca4b Remove unused `allow(dead_code)`
See 31fe9628cf.
4 months ago
Michal Rostecki 6dab7176f5 chore: Bless public API 4 months ago
Michal Rostecki a75fc2f769 aya-log: Allow logging `core::net::Ipv4Addr` and `core::net::Ipv6Addr`
IP address types are available in `core`, 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` and `Ipv6Formatter`.
* Support them with `DisplayHint::Ip`.
* Add support for formatting `[u8; 4]`, to be able to handle
  `Ipv4Addr::octets`.
4 months ago
ajwerner 2cd9858ea9
Merge pull request #991 from l2dy/typo-1
docs(aya): fix typo
4 months ago
Zero King f1773d5af4 docs(aya): fix typo 4 months ago
Dave Tucker 8015e10079
Merge pull request #989 from aya-rs/codegen
Update libbpf to 686f600bca59e107af4040d0838ca2b02c14ff50
4 months ago
dave-tucker 8d7446e011 [codegen] Update libbpf to 686f600bca59e107af4040d0838ca2b02c14ff50
Update libbpf to 686f600bca59e107af4040d0838ca2b02c14ff50

Files changed:
M	aya-obj/src/generated/linux_bindings_aarch64.rs
M	aya-obj/src/generated/linux_bindings_armv7.rs
M	aya-obj/src/generated/linux_bindings_powerpc64.rs
M	aya-obj/src/generated/linux_bindings_riscv64.rs
M	aya-obj/src/generated/linux_bindings_s390x.rs
M	aya-obj/src/generated/linux_bindings_x86_64.rs

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
4 months ago
Dave Tucker 104f449c0f
Merge pull request #988 from tyrone-wu/codegen/bpf-stats-type
codegen: add `bpf_stats_type` to codegen
4 months ago
tyrone-wu 86e279ef0a
codegen: add bpf_stats_type
Added `bpf_stats_type` enum to codegen bindings.

Refs: #959
4 months ago
Dave Tucker d5414bf10c
Merge pull request #983 from ajwerner/fix-variable-name
aya::programs::uprobe: fix bad variable name
4 months ago
Andrew Werner d413e2f285 aya::programs::uprobe: fix bad variable name
The variable fn_name was very much *not* the fn_name, but rather the
object file path.
4 months ago
Wouter Dullaert b8a22fa040 feat(aya-ebpf): Add memmove to the public-api 4 months ago
Wouter Dullaert fb0a339adf feat(aya-ebpf): Add integration test for memmove implementation 4 months ago
Wouter Dullaert 7ad3926d99 feat(aya-ebpf): Implement memmove
The compiler will emit this function for certain operations, but aya
currently does not provide an implementation.
This leads to ebpf loading failures as the kernel can't find the symbol when
loading the program.

The implementation is based on https://github.com/rust-lang/compiler-builtins/blob/master/src/mem/mod.rs#L29-L40
and https://github.com/rust-lang/compiler-builtins/blob/master/src/mem/impls.rs#L128-L135
Only the simplest case has been implemented, none of the word optimizations,
since memcpy also doesn't seem to have them.
4 months ago
dependabot[bot] 09815d3c0c
Merge pull request #980 from aya-rs/dependabot/cargo/cargo-crates-95ee854e2a 4 months ago
dependabot[bot] d581431d9a
build(deps): update public-api requirement in the cargo-crates group
Updates the requirements on [public-api](https://github.com/Enselic/cargo-public-api) to permit the latest version.

Updates `public-api` to 0.35.1
- [Release notes](https://github.com/Enselic/cargo-public-api/releases)
- [Changelog](https://github.com/Enselic/cargo-public-api/blob/main/rustdoc-json/CHANGELOG.md)
- [Commits](https://github.com/Enselic/cargo-public-api/compare/public-api-v0.35.0...public-api-v0.35.1)

---
updated-dependencies:
- dependency-name: public-api
  dependency-type: direct:production
  dependency-group: cargo-crates
...

Signed-off-by: dependabot[bot] <support@github.com>
4 months ago
Tamir Duberstein bac059fd41 Bump kernel image revision
6.1.0-15 seems to have been pulled.
4 months ago
Dave Tucker 06aa5c8ed3
Merge pull request #978 from aya-rs/codegen
Update libbpf to c1a6c770c46c6e78ad6755bf596c23a4e6f6b216
4 months ago
dave-tucker 8b50a6a573 [codegen] Update libbpf to c1a6c770c46c6e78ad6755bf596c23a4e6f6b216
Update libbpf to c1a6c770c46c6e78ad6755bf596c23a4e6f6b216

Files changed:
M	aya-obj/src/generated/linux_bindings_aarch64.rs
M	aya-obj/src/generated/linux_bindings_armv7.rs
A	aya-obj/src/generated/linux_bindings_powerpc64.rs
M	aya-obj/src/generated/linux_bindings_riscv64.rs
A	aya-obj/src/generated/linux_bindings_s390x.rs
M	aya-obj/src/generated/linux_bindings_x86_64.rs
M	ebpf/aya-ebpf-bindings/src/aarch64/bindings.rs
M	ebpf/aya-ebpf-bindings/src/armv7/bindings.rs
A	ebpf/aya-ebpf-bindings/src/powerpc64/bindings.rs
A	ebpf/aya-ebpf-bindings/src/powerpc64/helpers.rs
M	ebpf/aya-ebpf-bindings/src/riscv64/bindings.rs
A	ebpf/aya-ebpf-bindings/src/s390x/bindings.rs
A	ebpf/aya-ebpf-bindings/src/s390x/helpers.rs
M	ebpf/aya-ebpf-bindings/src/x86_64/bindings.rs

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
4 months ago
Dave Tucker c34abd6418
Merge pull request #977 from dave-tucker/xtask-codegen-fix
chore(xtask): Create bindings dir
4 months ago
Dave Tucker b20b1f1b0a chore(xtask): Create bindings dir
If the bindings directory doesn't exist then create it.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
4 months ago
Dave Tucker 3bd71925cf
Merge pull request #976 from dave-tucker/fix-codegen-2
ci: Fix codegen and prep for s390/ppc64el
4 months ago
Dave Tucker 64ec062c84 ci: Fix codegen and prep for s390/ppc64el
Adds missing libelf headers that are now included
as part of libbpf-internal.h. Adds ppc64el and
s390x to the cross environment.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
4 months ago
Dave Tucker 3fc6f47281
Merge pull request #975 from dave-tucker/s390-ppc-codegen
chore(xtask): Add s390x and powerpc64 to codegen
4 months ago
Billy McFall 62efed1853 chore(xtask): Add s390x and powerpc64 to codegen
This commit adds the s390x and powerpc architectures
to codegen. This will enable an upcoming PR to add
support for aya to support theses architectures
in both aya and aya-ebpf.

Co-authored-by: Dave Tucker <dave@dtucker.co.uk>
Signed-off-by: Billy McFall <22157057+Billy99@users.noreply.github.com>
4 months ago
Tamir Duberstein bfafe9e786 public-api: regenerate
See https://github.com/rust-lang/rust/commit/ec201b86.
5 months ago
Tamir Duberstein 35aa9ac1a5 public-api: regenerate
See https://github.com/Enselic/cargo-public-api/pull/584.

Constant values are no longer considered part of the API.
5 months ago
belohnung 38d8e32baa fix(aya): fix panic when creating map on custom ubuntu kernel 5 months ago
Tamir Duberstein 78acd74bad Appease clippy
```
error: match can be simplified with `.unwrap_or_default()`
   --> aya/src/util.rs:157:13
    |
157 | /             match s.map(str::parse).transpose() {
158 | |                 Ok(option) => option,
159 | |                 Err(ParseIntError { .. }) => None,
160 | |             }
    | |_____________^ help: replace it with: `s.map(str::parse).transpose().unwrap_or_default()`
```
5 months ago
dependabot[bot] bf20a8c892
Merge pull request #965 from aya-rs/dependabot/cargo/cargo-crates-f36f6a6c13 5 months ago
dependabot[bot] 37777a0d5a
build(deps): update public-api requirement in the cargo-crates group
Updates the requirements on [public-api](https://github.com/Enselic/cargo-public-api) to permit the latest version.

Updates `public-api` to 0.33.1
- [Release notes](https://github.com/Enselic/cargo-public-api/releases)
- [Changelog](https://github.com/Enselic/cargo-public-api/blob/main/rustdoc-json/CHANGELOG.md)
- [Commits](https://github.com/Enselic/cargo-public-api/compare/public-api-v0.33.1...public-api-v0.33.1)

---
updated-dependencies:
- dependency-name: public-api
  dependency-type: direct:production
  dependency-group: cargo-crates
...

Signed-off-by: dependabot[bot] <support@github.com>
5 months ago
Tamir Duberstein 781914f058 Don't deny unused_qualifications
Nightly added stuff to the prelude.
5 months ago
tyrone-wu 5e13283f59 fix: fix rustdocs-args ordering in taplo to -D warnings
This fixes the current rustdoc build error by correcting the ordering of
`rustdoc-args` to `-D warnings`. Additionally, this also removes the
`recorder_arrays` field (defaults to false) so that the order is not
modified, which is what caused the error in the first place.
5 months ago
dependabot[bot] 0ec87f6e4f
Merge pull request #955 from aya-rs/dependabot/cargo/cargo-crates-d36358862b 6 months ago
dependabot[bot] dd92b41a59
build(deps): bump the cargo-crates group with 2 updates
Updates the requirements on [nix](https://github.com/nix-rust/nix) and [object](https://github.com/gimli-rs/object) to permit the latest version.

Updates `nix` to 0.28.0
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.28.0...v0.28.0)

Updates `object` to 0.35.0
- [Changelog](https://github.com/gimli-rs/object/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gimli-rs/object/compare/0.35.0...0.35.0)

---
updated-dependencies:
- dependency-name: nix
  dependency-type: direct:production
  dependency-group: cargo-crates
- dependency-name: object
  dependency-type: direct:production
  dependency-group: cargo-crates
...

Signed-off-by: dependabot[bot] <support@github.com>
6 months ago
Tamir Duberstein 4e843a3523 Remove deny(pointer_structural_match)
```
warning: lint `pointer_structural_match` has been removed: converted into hard error, see RFC #3535 <https://rust-lang.github.io/rfcs/3535-constants-in-patterns.html> for more information
  --> aya/src/lib.rs:57:5
   |
57 |     pointer_structural_match,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(renamed_and_removed_lints)]` on by default
```
6 months ago
Tamir Duberstein 683cedfe48 Appease clippy
warning: doc list item missing indentation
  --> test/integration-test/build.rs:20:5
   |
20 | /// prevent their use for the time being.
   |     ^
   |
   = help: if this is supposed to be its own paragraph, add a blank line
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
   = note: `#[warn(clippy::doc_lazy_continuation)]` on by default
help: indent this line
   |
20 | ///   prevent their use for the time being.
   |     ++
6 months ago
Tamir Duberstein 3808ad5520 Reduce dependabot toil 6 months ago
Alessandro Decina bde4b5f86b
Merge pull request #938 from swananan/enhance_urpobe_symbol_lookup
aya: add symbol lookup in associated debug files
6 months ago
Alessandro Decina c7898c596f Fix clippy 6 months ago
swananan 462514ed4c aya: adjust symbol lookup tests for object crate alignment requirements
The object::File::parse API requires parameter to be aligned with 8 bytes.
Adjusted the Vec in the tests with miri to meet this requirement.
6 months ago
Alessandro Decina a2c8fcab4e aya: bless API changes
The equivalent crate has a blanket implementation smh. We don't depend
on it directly it's pulled in by the object crate.
6 months ago