Commit Graph

1898 Commits (2f757b2091d28a17c90495ee2955e7f8d1bc5ec5)
 

Author SHA1 Message Date
Dave Tucker 2f757b2091
Merge pull request #482 from ishanjain28/add_mips_support
Added MIPS bindings
3 weeks ago
Dave Tucker 2eaae09c31 chore(aya-ebpf-cty): Add mips support
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 weeks ago
Dave Tucker 1495a93c45 ci: Include mips architecture in tests
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 weeks ago
Dave Tucker 1ccac3c135 feat(ebpf): Implement FromPtRegs for mips
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 weeks ago
Ishan Jain 3ff609114e feat(aya): Added MIPS bindings
Updated `aya-obj/src/generated/mod.rs` and
`bpf/aya-bpf-bindings/src/lib.rs to use the mips bindings.
3 weeks ago
Dave Tucker 66da8742fe
Merge pull request #1155 from aya-rs/codegen
Update libbpf to 324f3c3846d99c8a1e1384a55591f893f0ae5de4
3 weeks ago
dave-tucker 701a933345 [codegen] Update libbpf to 324f3c3846d99c8a1e1384a55591f893f0ae5de4
Update libbpf to 324f3c3846d99c8a1e1384a55591f893f0ae5de4

Files changed:
M	aya-obj/src/generated/btf_internal_bindings.rs
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_mips.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
M	ebpf/aya-ebpf-bindings/src/aarch64/bindings.rs
M	ebpf/aya-ebpf-bindings/src/armv7/bindings.rs
A	ebpf/aya-ebpf-bindings/src/mips/bindings.rs
A	ebpf/aya-ebpf-bindings/src/mips/helpers.rs
M	ebpf/aya-ebpf-bindings/src/powerpc64/bindings.rs
M	ebpf/aya-ebpf-bindings/src/riscv64/bindings.rs
M	ebpf/aya-ebpf-bindings/src/s390x/bindings.rs
M	ebpf/aya-ebpf-bindings/src/x86_64/bindings.rs
3 weeks ago
Dave Tucker fdd25cd434
Merge pull request #1154 from dave-tucker/fix-codegen
chore(codegen): Fix duplicate BPF_F_LINK
3 weeks ago
Dave Tucker d92284e4f8 chore(codegen): Fix duplicate BPF_F_LINK
Per the comment added in the code, there are 2 definitions of
BPF_F_LINK in the kernel headers. Once is in an anonymous enum which
bindgen will constify, and once is via a #define macro. The values are
identical. The fix is to exclude BPF_F_LINK from the list of variables
in bindgen removing one of the duplicate definitions.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 weeks ago
Dave Tucker b960fd27b3
Merge pull request #1152 from dave-tucker/codegen-mips
ci: Install libc6-dev-mips-cross for codegen
3 weeks ago
Dave Tucker 3b41205059 ci: Install libc6-dev-mips-cross for codegen
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 weeks ago
Dave Tucker fd30e2e809
Merge pull request #1151 from dave-tucker/task-fd-query
chore(xtask): Add bindings for bpf_task_fd_type
3 weeks ago
Dave Tucker 74fad66599 chore(xtask): Add bindings for bpf_task_fd_type
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 weeks ago
Dave Tucker 16ca7256fc
Merge pull request #1150 from dave-tucker/mips-codegen
chore(xtask): Add mips to codegen
3 weeks ago
Ishan Jain 91fb73092e chore(xtask): Add mips to codegen
This will generate bindings for mips the next time that the codegen job
is run.

Signed-off-by: Ishan Jain <contact@ishanjain.me>
Co-authored-by: Dave Tucker <dave@dtucker.co.uk>
3 weeks ago
Tamir Duberstein 0429ed2fa2 Appease clippy
```
error: manual implementation of `ok`
   --> aya/src/util.rs:261:28
    |
261 |                   let addr = match u64::from_str_radix(addr, 16) {
    |  ____________________________^
262 | |                     Ok(addr) => Some(addr),
263 | |                     Err(ParseIntError { .. }) => None,
264 | |                 }?;
    | |_________________^ help: replace with: `u64::from_str_radix(addr, 16).ok()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_err

error: struct pattern is not needed for a unit variant
    --> aya-obj/src/obj.rs:1705:44
     |
1705 |             section: ProgramSection::KProbe { .. },
     |                                            ^^^^^^^ help: remove the struct pattern
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern
note: the lint level is defined here
    --> aya-obj/src/lib.rs:68:9
     |
68   | #![deny(clippy::all, missing_docs)]
     |         ^^^^^^^^^^^
     = note: `#[deny(clippy::unneeded_struct_pattern)]` implied by `#[deny(clippy::all)]`

error: struct pattern is not needed for a unit variant
    --> aya-obj/src/obj.rs:1769:44
     |
1769 |             section: ProgramSection::KProbe { .. },
     |                                            ^^^^^^^ help: remove the struct pattern
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern

error: struct pattern is not needed for a unit variant
    --> aya-obj/src/obj.rs:1787:44
     |
1787 |             section: ProgramSection::KProbe { .. },
     |                                            ^^^^^^^ help: remove the struct pattern
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern

error: struct pattern is not needed for a unit variant
    --> aya-obj/src/obj.rs:1919:48
     |
1919 |                 section: ProgramSection::KProbe { .. },
     |                                                ^^^^^^^ help: remove the struct pattern
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern

error: struct pattern is not needed for a unit variant
    --> aya-obj/src/obj.rs:2041:52
     |
2041 |                 section: ProgramSection::TracePoint { .. },
     |                                                    ^^^^^^^ help: remove the struct pattern
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern

error: struct pattern is not needed for a unit variant
    --> aya-obj/src/obj.rs:2058:52
     |
2058 |                 section: ProgramSection::TracePoint { .. },
     |                                                    ^^^^^^^ help: remove the struct pattern
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern

error: struct pattern is not needed for a unit variant
    --> aya-obj/src/obj.rs:2081:54
     |
2081 |                 section: ProgramSection::SocketFilter { .. },
     |                                                      ^^^^^^^ help: remove the struct pattern
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern

error: struct pattern is not needed for a unit variant
    --> aya-obj/src/obj.rs:2151:55
     |
2151 |                 section: ProgramSection::RawTracePoint { .. },
     |                                                       ^^^^^^^ help: remove the struct pattern
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern

error: struct pattern is not needed for a unit variant
    --> aya-obj/src/obj.rs:2168:55
     |
2168 |                 section: ProgramSection::RawTracePoint { .. },
     |                                                       ^^^^^^^ help: remove the struct pattern
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern

error: struct pattern is not needed for a unit variant
    --> aya-obj/src/obj.rs:2243:55
     |
2243 |                 section: ProgramSection::BtfTracePoint { .. },
     |                                                       ^^^^^^^ help: remove the struct pattern
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern

error: struct pattern is not needed for a unit variant
    --> aya-obj/src/obj.rs:2266:59
     |
2266 |                 section: ProgramSection::SkSkbStreamParser { .. },
     |                                                           ^^^^^^^ help: remove the struct pattern
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern

error: struct pattern is not needed for a unit variant
    --> aya-obj/src/obj.rs:2289:59
     |
2289 |                 section: ProgramSection::SkSkbStreamParser { .. },
     |                                                           ^^^^^^^ help: remove the struct pattern
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern

error: struct pattern is not needed for a unit variant
    --> aya-obj/src/obj.rs:2410:58
     |
2410 |                 section: ProgramSection::CgroupSkbIngress { .. },
     |                                                          ^^^^^^^ help: remove the struct pattern
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern

error: struct pattern is not needed for a unit variant
    --> aya-obj/src/obj.rs:2433:58
     |
2433 |                 section: ProgramSection::CgroupSkbIngress { .. },
     |                                                          ^^^^^^^ help: remove the struct pattern
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern

error: struct pattern is not needed for a unit variant
    --> aya-obj/src/obj.rs:2456:51
     |
2456 |                 section: ProgramSection::CgroupSkb { .. },
     |                                                   ^^^^^^^ help: remove the struct pattern
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern

error: struct pattern is not needed for a unit variant
    --> aya-obj/src/obj.rs:2479:51
     |
2479 |                 section: ProgramSection::CgroupSkb { .. },
     |                                                   ^^^^^^^ help: remove the struct pattern
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern

error: manual implementation of `ok`
   --> aya-log-common/src/lib.rs:168:36
    |
168 |       let wire_len: LogValueLength = match value.len().try_into() {
    |  ____________________________________^
169 | |         Ok(wire_len) => Some(wire_len),
170 | |         Err(TryFromIntError { .. }) => None,
171 | |     }?;
    | |_____^ help: replace with: `value.len().try_into().ok()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_err

error: manual implementation of `err`
   --> init/src/main.rs:141:30
    |
141 |           .filter_map(|result| match result {
    |  ______________________________^
142 | |             Ok(()) => None,
143 | |             Err(err) => Some(err),
144 | |         })
    | |_________^ help: replace with: `result.err()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_err

error: manual implementation of `err`
  --> xtask/src/public_api.rs:80:30
   |
80 |           .filter_map(|result| match result {
   |  ______________________________^
81 | |             Ok(()) => None,
82 | |             Err(err) => Some(err),
83 | |         })
   | |_________^ help: replace with: `result.err()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_err
```
3 weeks ago
Tamir Duberstein 2907bc678d ci: add ARM runner
Remove gcc-multilib which doesn't exist on arm64.
3 weeks ago
Tamir Duberstein e46fae7459 Update public-api to 0.43.0 4 weeks ago
Eric Long 1fe12b9990
Fix aya-ebpf-* riscv64 build (#1139)
bpf_target_arch should be riscv64, but target triple starts with riscv64gc (and possibly riscv64 followed by any combination of extensions).
1 month ago
tamird 29b821376e public-api: regenerate 1 month ago
Tamir Duberstein 356cf45914 Use Set (instead of Map) to hold links
This uses hashbrown instead of std because the latter relies on Borrow
which requires a reference; hashbrown's Equivalent is more flexible.
1 month ago
Tamir Duberstein 69144a977e Appease clippy
```
error: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator
   --> aya/src/programs/uprobe.rs:282:64
    |
282 |             let path = line.split(|b| b.is_ascii_whitespace()).last()?;
    |                                                                ^^^^^^ help: try: `next_back()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last
```
1 month ago
ajwerner 114e7a6906
Merge pull request #1133 from ajwerner/uprobe-cookie 1 month ago
Andrew Werner 628b7fb022 aya::programs::uprobe: add support for cookies
Fixes #1132.

Note that this change does not add support in the public API for kprobes
or tracepoints, but it's a trivial matter of plumbing.

Along the way, the Uprobe::attach API is cleaned up to make the
attachment location more coherent. The logic being: if we're going to be
breaking the API anyway, may as well clean it up a bit.

Furthermore, the aya::sys::bpf_link_attach function is cleaned up by
properly modeling the the union in the final field with a rust enum.
1 month ago
Mike Rostecki f34d355d7d bpf: Handle raw tracepoint arguments
Provide an `arg()` method in `RawTracepointArgs` wrapper of
`bpf_raw_tracepoint_args` and also in `RawTracepointContext`, so
it's directly available in raw tracepoint programs.

The methods and traits implemented here are unsafe. There is no
way to reliably check the number of available arguments, so
requesting a non-existing one leads to undefined behavior.
2 months ago
Tamir Duberstein 28a28c9872 aya-tool: enable clang_macro_fallback
See
https://docs.rs/bindgen/latest/bindgen/struct.Builder.html#method.clang_macro_fallback.
2 months ago
Tamir Duberstein be6370c7cd aya-tool: extract common helper 2 months ago
dependabot[bot] 1355a2094f
Merge pull request #1126 from aya-rs/dependabot/github_actions/github-actions-4fb87efe6a 2 months ago
dependabot[bot] e8b8467c18
build(deps): bump DavidAnson/markdownlint-cli2-action
Bumps the github-actions group with 1 update: [DavidAnson/markdownlint-cli2-action](https://github.com/davidanson/markdownlint-cli2-action).


Updates `DavidAnson/markdownlint-cli2-action` from 18 to 19
- [Release notes](https://github.com/davidanson/markdownlint-cli2-action/releases)
- [Commits](https://github.com/davidanson/markdownlint-cli2-action/compare/v18...v19)

---
updated-dependencies:
- dependency-name: DavidAnson/markdownlint-cli2-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2 months ago
Tamir Duberstein f26ccde136 Allow `+bpo` kernels
Seems 6.10 is now being marked `+bpo`.

Improve error handling while I'm here.
2 months ago
Noah Kennedy df053f095b
docs: update docs for load to mention include_bytes_aligned (#1119)
* docs: update docs for load to mention include_bytes_aligned

This macro is required if you are bundling programs statically into your binary, which is not an uncommon thing to do.

This change updates the documentation for the load function to mention this macro and the need for alignment.
2 months ago
Tamir Duberstein 78ee9a4634 Avoid useless conversions
Use native C types to avoid platform-dependent conversions.
2 months ago
Tamir Duberstein 4257643354 Clean up C type imports 2 months ago
Tamir Duberstein 41706d74e4 Narrow clippy allowances 2 months ago
Tamir Duberstein 1bf6a38619 Simplify `parse_param` 2 months ago
Michal Rostecki 4f0559f2af chore: Fix cippy errors 2 months ago
dependabot[bot] aea3efecd5
Merge pull request #1120 from aya-rs/dependabot/cargo/cargo-crates-f75f554572 2 months ago
dependabot[bot] af4254bc57
build(deps): update octorust requirement in the cargo-crates group
---
updated-dependencies:
- dependency-name: octorust
  dependency-type: direct:production
  dependency-group: cargo-crates
...

Signed-off-by: dependabot[bot] <support@github.com>
2 months ago
Tamir Duberstein d1457acc6d ci: cache downloads
We're seeing 429 from Github trying to download gen_init_cpio, so cache
it using actions cache. Since I'm here add this for kernel images as
well to save time waiting on slow Debian servers.
2 months ago
Tamir Duberstein cc2da4a2a4 ci: download gen_init_cpio with authentication
The raw endpoint[0] now[1] seems to return HTTP 429 on the first request
and unauthenticated API limits are exceeded after one request (so one of
ubuntu/macos builders fails). Hopefully this works with authentication.

Link: https://raw.githubusercontent.com/torvalds/linux/refs/heads/master/usr/gen_init_cpio.c [0]
Link: https://github.com/orgs/community/discussions/146957 [1]
2 months ago
dependabot[bot] 1dfcfbcf90
Merge pull request #1113 from aya-rs/dependabot/cargo/cargo-crates-ab63383a63 3 months ago
dependabot[bot] 4f3ea551f3
build(deps): update bindgen requirement in the cargo-crates group
Updates the requirements on [bindgen](https://github.com/rust-lang/rust-bindgen) to permit the latest version.

Updates `bindgen` to 0.70.1
- [Release notes](https://github.com/rust-lang/rust-bindgen/releases)
- [Changelog](https://github.com/rust-lang/rust-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/rust-bindgen/compare/v0.70.0...v0.70.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
3 months ago
Tamir Duberstein 5a43bedc01 Replace proc-macro-error with proc-macro2-diagnostics
proc-macro-error is unmaintained.
3 months ago
Tamir Duberstein dae394e199 aya-ebpf-macros: remove aya-ebpf version
The presence of this version specification causes cargo-smart-release to
trip on the circular dependency.

Fixes #1050.
3 months ago
Tamir Duberstein 3d8cb08b7f aya-build: add explicit irrefutable pattern
This is required in Rust 1.80 at least.
3 months ago
Tamir Duberstein 015c0df0f4 aya-build: enable anyhow/std
This is needed before Rust 1.81.
3 months ago
Tamir Duberstein 6970353b58 aya-build: add description 3 months ago
Tamir Duberstein b01bc3f49b Use Result in integration-test's build script
Something of an experiment.
3 months ago
Tamir Duberstein 2b2af44915 Extract aya-build for building eBPF crates
We'll use this in the template and book to avoid duplicating all the
code.
3 months ago
Tamir Duberstein e0c4948e36 Extract integration-common for shared types 3 months ago