Commit Graph

1669 Commits (b84ede10b9c4813f221fade16b60d5ced4ecdc58)
 

Author SHA1 Message Date
tyrone-wu b84ede10b9 aya-ebpf/macros: separate probe to probe ctx & retprobe to retprobe ctx
Added logic in expand function in both kprobe.rs and uprobe.rs for valid
macros. Now, kprobe & uprobe proc macros only accept ProbeContext, and
kretprobe & uretprobe only accept RetProbeContext.

Ref: #700
5 months ago
tyrone-wu 2d38b23b99 aya-ebpf/programs: moved ret from ProbeContext into new RetProbeContext
Created retprobe.rs to hold RetProbeContext and moved the ret from
ProbeContext in probe.rs into RetProbeContext. Now, only kprobe (which
uses ProbeContext) can access args, and kretprobe (which uses
RetProbeContext) can access ret.

Fixes: #700
5 months ago
Tamir Duberstein ac58601fb9 Revert "Disable false-positive clippy lint"
This reverts commit b552c83300.

Upstream fixed the false positive in
https://github.com/rust-lang/rust-clippy/commit/62fd1d5377c0bb917761b9f.
5 months ago
Tamir Duberstein 57cd35172f Appease clippy
```
  warning: casting `u8` to `u64` may become silently lossy if you later change the type
  warning: casting `u16` to `u64` may become silently lossy if you later change the type
  warning: casting `u32` to `u64` may become silently lossy if you later change the type
  warning: casting `i64` to `u64` may lose the sign of the value
  warning: casting `i8` to `i64` may become silently lossy if you later change the type
  warning: casting `i64` to `u64` may lose the sign of the value
  warning: casting `i16` to `i64` may become silently lossy if you later change the type
  warning: casting `i32` to `i64` may become silently lossy if you later change the type
     --> ebpf/aya-ebpf/src/helpers.rs:753:27
      |
  753 |                   PrintkArg(x as $via as u64)
      |                             ^
  ...
  759 | / impl_integer_promotion!(
  760 | |   char:  via u64,
  761 | |   u8:    via u64,
  762 | |   u16:   via u64,
  ...   |
  770 | |   isize: via i64,
  771 | | );
      | |_- in this macro invocation
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
      = note: this warning originates in the macro `impl_integer_promotion` (in Nightly builds, run with -Z macro-backtrace for more info)
```

Pass an array of bytes instead of u64 to avoid clippy sign warnings.
5 months ago
Tamir Duberstein b21f2a1945 Mark aya-tool publish=false
This is for internal use, get it off the API treadmill.
5 months ago
Tamir Duberstein 73751fb878 public-api: regenerate
See https://github.com/rayon-rs/either/pull/101.
5 months ago
Alessandro Decina 843f4a6cc6 Release aya-log-ebpf v0.1.0 5 months ago
Alessandro Decina 2eac95f6d9 Release aya-log-ebpf-macros v0.1.0 5 months ago
Alessandro Decina 04ee35d139 Release aya-log-parser v0.1.13 5 months ago
Alessandro Decina 1d515fe810 chore: add missing changelogs 5 months ago
Tamir Duberstein 80920ddf3f public-api: regenerate
This is roughly a revert of af1a9b39112a8341ef049c8697bed3350e76f2f1;
see https://github.com/rust-lang/rust/pull/123638.
5 months ago
dependabot[bot] e90e3433d9
Merge pull request #925 from aya-rs/dependabot/cargo/production-dependencies-4e57039e67 5 months ago
dependabot[bot] 7f4c1d7892
build(deps): update rustdoc-json requirement
Updates the requirements on [rustdoc-json](https://github.com/Enselic/cargo-public-api) to permit the latest version.

Updates `rustdoc-json` to 0.8.9
- [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/rustdoc-json-v0.8.6...rustdoc-json-v0.8.9)

---
updated-dependencies:
- dependency-name: rustdoc-json
  dependency-type: direct:production
  dependency-group: production-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
5 months ago
Tamir Duberstein 09442c2cbe Appease clippy
```
  warning: transmute used without annotations
     --> aya-log-common/src/lib.rs:220:41
      |
  220 |         let bytes = unsafe { core::mem::transmute::<_, [u8; 16]>(self) };
      |                                         ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider adding missing annotations: `transmute::<[u16; 8], [u8; 16]>`
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
      = note: `#[warn(clippy::missing_transmute_annotations)]` on by default

  error: transmute used without annotations
      --> aya/src/maps/mod.rs:1130:52
       |
  1130 |                     .copy_from_slice(unsafe { mem::transmute(TEST_NAME) });
       |                                                    ^^^^^^^^^ help: consider adding missing annotations: `transmute::<&str, &[i8]>`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
  note: the lint level is defined here
      --> aya/src/lib.rs:41:5
       |
  41   |     clippy::all,
       |     ^^^^^^^^^^^
       = note: `#[deny(clippy::missing_transmute_annotations)]` implied by `#[deny(clippy::all)]`
```
6 months ago
Alessandro Decina c3ae6f90d8 Release aya-ebpf v0.1.0 6 months ago
Alessandro Decina a6f4739b5b chore: aya-ebpf-macros: uncomment aya-ebpf dev-dep
This wasn't meant to be committed, cargo-smart-release. Commenting is
needed to fix the cyclic dep aya-ebpf-macros -> aya-ebpf ->
aya-ebpf-macros. See
https://github.com/rust-lang/cargo/issues/4242#issuecomment-413203081
6 months ago
Alessandro Decina 9d24bbe316 Release aya-ebpf-macros v0.1.0 6 months ago
Alessandro Decina 90f68dbd07 Release aya-ebpf-macros v0.1.0 6 months ago
Alessandro Decina eb3947bf14 Release aya-ebpf-macros v0.1.0, aya-ebpf v0.1.0 6 months ago
Alessandro Decina a34c5e43b8 Release aya-ebpf-bindings v0.1.0, aya-ebpf-macros v0.1.0, aya-ebpf v0.1.0 6 months ago
Alessandro Decina a4ae8adb0d chore: add version keys to Cargo.toml(s) 6 months ago
Alessandro Decina b8964d3fd2 Release aya-ebpf-bindings v0.1.0, aya-ebpf-macros v0.1.0, aya-ebpf v0.1.0 6 months ago
Alessandro Decina c7fe60d47e chore: add changelogs 6 months ago
Alessandro Decina e372fcf653 Release aya-ebpf-cty v0.2.1, aya-ebpf-bindings v0.1.0, aya-ebpf-macros v0.1.0, aya-ebpf v0.1.0 6 months ago
Kevin Ji df9fe94216 xtask: Bless public-api changes 6 months ago
Kevin Ji b06ff40278 xtask: Generate new bindings 6 months ago
Tamir Duberstein af1a9b3911 public-api: regenerate
Auto trait bounds have changed in one of:
- https://github.com/rust-lang/rust/pull/123340.
- https://github.com/rust-lang/rust/pull/123375.
6 months ago
tyrone-wu b23973dd9c xtask: corrected bpf to ebpf for path to aya-ebpf-bindings in codegen
Currently, when running `cargo +nightly xtask codegen` locally and in
the codegen GHA workflow, an error occurs with only "Error: bindgen
failed" displayed.

This was due to a path using "bpf/..." instead of "ebpf/...". It is now
corrected to "ebpf", and bindgen fails should now display a more direct
message on why it failed.

Fixes: #914
6 months ago
Tamir Duberstein b552c83300 Disable false-positive clippy lint
See https://github.com/rust-lang/rust-clippy/issues/12537.
6 months ago
Tamir Duberstein 0a32dacd2f Appease clippy
```
  error: unnecessary structure name repetition
     --> aya/src/bpf.rs:198:57
      |
  198 |     pub fn btf(&mut self, btf: Option<&'a Btf>) -> &mut EbpfLoader<'a> {
      |                                                         ^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  note: the lint level is defined here
     --> aya/src/lib.rs:42:5
      |
  42  |     clippy::use_self,
      |     ^^^^^^^^^^^^^^^^

  error: unnecessary structure name repetition
     --> aya/src/bpf.rs:222:54
      |
  222 |     pub fn allow_unsupported_maps(&mut self) -> &mut EbpfLoader<'a> {
      |                                                      ^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self

  error: unnecessary structure name repetition
     --> aya/src/bpf.rs:243:69
      |
  243 |     pub fn map_pin_path<P: AsRef<Path>>(&mut self, path: P) -> &mut EbpfLoader<'a> {
      |                                                                     ^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self

  error: unnecessary structure name repetition
     --> aya/src/bpf.rs:292:15
      |
  292 |     ) -> &mut EbpfLoader<'a> {
      |               ^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self

  error: unnecessary structure name repetition
     --> aya/src/bpf.rs:313:73
      |
  313 |     pub fn set_max_entries(&mut self, name: &'a str, size: u32) -> &mut EbpfLoader<'a> {
      |                                                                         ^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self

  error: unnecessary structure name repetition
     --> aya/src/bpf.rs:335:56
      |
  335 |     pub fn extension(&mut self, name: &'a str) -> &mut EbpfLoader<'a> {
      |                                                        ^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self

  error: unnecessary structure name repetition
     --> aya/src/bpf.rs:353:75
      |
  353 |     pub fn verifier_log_level(&mut self, level: VerifierLogLevel) -> &mut EbpfLoader<'a> {
      |                                                                           ^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
```

See https://github.com/rust-lang/rust-clippy/pull/12386.
6 months ago
Tamir Duberstein c302f8370d public-api: regenerate
Nightly now exposes `core::marker::Freeze`.

https://github.com/rust-lang/rust/pull/121840
6 months ago
dependabot[bot] 85a3b2e4d2
Merge pull request #905 from aya-rs/dependabot/cargo/production-dependencies-3ec3d1981c 6 months ago
dependabot[bot] f019ca33ed
build(deps): bump the production-dependencies group with 1 update
Updates the requirements on [object](https://github.com/gimli-rs/object) to permit the latest version.

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

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

Signed-off-by: dependabot[bot] <support@github.com>
6 months ago
Dave Tucker 63d8d4d34b
Merge pull request #528 from dave-tucker/rename-all-the-things
Rename Bpf -> Ebpf across all crates for consistency
6 months ago
Daniel Mellado a4e68ebdbf aya: include license in crate workspace
This PR includes the licenses files in the crate workspace subdirectory.
Without this, they won't be showing on crates.io and would be giving out
errors on tooling such as rust2rpm.

Signed-off-by: Daniel Mellado <dmellado@redhat.com>
7 months ago
Dave Tucker 715e62dd38 chore(aya): Bless public API
Bless the BpfError type alias

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
7 months ago
Michal Rostecki 57a69fe9d2 docs: Use `Ebpf` instead of `Bpf` 7 months ago
Michal Rostecki 110a76cb9a feat(aya): Provide a deprecated `BpfError` alias 7 months ago
Dave Tucker 5c6736b781 ci: Fix GH workflows with new crate names
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
7 months ago
Dave Tucker f81d320142 chore: Fix Mergify configuration
Fix paths and regexp for the new crate names and folders.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
7 months ago
Dave Tucker d0c244356f chore: Bless public API changes
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
7 months ago
Dave Tucker 8c79b71bd5 feat(aya): 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.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
7 months ago
Dave Tucker fd48c55466 feat(aya-obj)!: Rename BpfRelocationError -> EbpfRelocationError
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
7 months ago
Dave Tucker d7af6acb42 chore(aya-ebpf): Rename BpfContext -> EbpfContext
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
7 months ago
Dave Tucker a93e354620 feat(aya-log): Rename BpfLogger to EbpfLogger
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
7 months ago
Dave Tucker cf3e2ca677 feat(aya-obj)!: Rename BpfSectionKind to EbpfSectionKind
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
7 months ago
Dave Tucker ea8073793e chore(aya-ebpf-macros): Rename bpf -> ebpf
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
7 months ago
Dave Tucker 41c61560ea chore(aya-ebpf): Rename bpf -> ebpf
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
7 months ago
Dave Tucker 70ac91dc1e chore(aya-ebpf-bindings): Rename bpf -> ebpf
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
7 months ago
Dave Tucker 21f570a19c chore(aya-ebpf-cty): Rename bpf -> ebpf
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
7 months ago