Commit Graph

1808 Commits (1f8b1635dbc43842b73da33e36bb51079cacd0df)
 

Author SHA1 Message Date
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.
11 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.
11 months ago
Tamir Duberstein 4025861780 Don't hardcode /usr/local/opt 11 months ago
Tamir Duberstein 28545d3331 Use macos-13 11 months ago
Tamir Duberstein 247486cb7d Remove stale workaround 11 months ago
Tamir Duberstein 5397c1ca4b Remove unused `allow(dead_code)`
See 31fe9628cf.
11 months ago
Michal Rostecki 6dab7176f5 chore: Bless public API 11 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`.
11 months ago
ajwerner 2cd9858ea9
Merge pull request #991 from l2dy/typo-1
docs(aya): fix typo
11 months ago
Zero King f1773d5af4 docs(aya): fix typo 11 months ago
Dave Tucker 8015e10079
Merge pull request #989 from aya-rs/codegen
Update libbpf to 686f600bca59e107af4040d0838ca2b02c14ff50
11 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>
11 months ago
Dave Tucker 104f449c0f
Merge pull request #988 from tyrone-wu/codegen/bpf-stats-type
codegen: add `bpf_stats_type` to codegen
11 months ago
martinsoees d7e5f31b68 cargo fmt 11 months ago
martinsoees 492feb2147 Remove relocation test by type
The 'ignore_map_by_type' function has been removed. Also renamed test function and simplified the relocation builder since 'by_name' is the only option now
11 months ago
martinsoees 787d08b031 remove unintended explicit type declaration in code unrelated to this PR 11 months ago
martinsoees 0b0d4c7e97 Map import unused in usage example 11 months ago
martinsoees 37de0d1a26 Merge branch 'main' into ebpfloader_disable_unsupported_maps 11 months ago
martinsoees 71ec04eb25 Proper rustdoc reference to Ebpfloader::set_global 11 months ago
martinsoees 2e0bc82078 Review comments
- Removed 'ignore_map_by_type' since 'ignore_map_by_name' makes more sense
11 months ago
martinsoees 7b9f1d26d1 Review comments
- Removed 'ignore_map_by_type' since 'ignore_map_by_name' makes more sense
11 months ago
tyrone-wu 86e279ef0a
codegen: add bpf_stats_type
Added `bpf_stats_type` enum to codegen bindings.

Refs: #959
11 months ago
Dave Tucker d5414bf10c
Merge pull request #983 from ajwerner/fix-variable-name
aya::programs::uprobe: fix bad variable name
11 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.
11 months ago
Wouter Dullaert b8a22fa040 feat(aya-ebpf): Add memmove to the public-api 11 months ago
Wouter Dullaert fb0a339adf feat(aya-ebpf): Add integration test for memmove implementation 11 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.
11 months ago
dependabot[bot] 09815d3c0c
Merge pull request #980 from aya-rs/dependabot/cargo/cargo-crates-95ee854e2a 11 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>
11 months ago
Tamir Duberstein bac059fd41 Bump kernel image revision
6.1.0-15 seems to have been pulled.
11 months ago
Dave Tucker 06aa5c8ed3
Merge pull request #978 from aya-rs/codegen
Update libbpf to c1a6c770c46c6e78ad6755bf596c23a4e6f6b216
11 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>
11 months ago
Dave Tucker c34abd6418
Merge pull request #977 from dave-tucker/xtask-codegen-fix
chore(xtask): Create bindings dir
11 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>
11 months ago
Dave Tucker 3bd71925cf
Merge pull request #976 from dave-tucker/fix-codegen-2
ci: Fix codegen and prep for s390/ppc64el
11 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>
11 months ago
Dave Tucker 3fc6f47281
Merge pull request #975 from dave-tucker/s390-ppc-codegen
chore(xtask): Add s390x and powerpc64 to codegen
11 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>
11 months ago
Tamir Duberstein bfafe9e786 public-api: regenerate
See https://github.com/rust-lang/rust/commit/ec201b86.
12 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.
12 months ago
martinsoees d9cd8de7fc Properly cfg gate std and non-std 12 months ago
martinsoees b05ab1599d Applied cargo fmt to fix formatting 12 months ago
martinsoees c3084fd6a7 removed newline at end of file 12 months ago
martinsoees ad2dc1b7f0 Fixed doc test 12 months ago
martinsoees 0e35566479 indentation 12 months ago
martinsoees b49c3001f1 Added integration tests for ignoring maps by type and by name 12 months ago
martinsoees aad4ad4fd3 Changed name to 'ignore_map_by_type' and created a similar function that does the same by name. Fixed renaming and added the new 3rd argument to relocate_maps() for rbpf test case 12 months ago
belohnung 38d8e32baa fix(aya): fix panic when creating map on custom ubuntu kernel 12 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()`
```
12 months ago
martinsoees c725b9d69e All tests are passing now 12 months ago