Commit Graph

2081 Commits (0b732c3d468ecb9855b58bd61be2b0972baa3a8a)
 

Author SHA1 Message Date
Xiaobo Liu 0b732c3d46 aya-log: simplify map name matching using direct Option comparison
Replace match statement with direct Option comparison for cleaner code

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
5 days ago
Xiaobo Liu cab559b9d9 aya-log: Use `None` instead of wildcard in `Format` impls
The `Format` implementations for various types were using a wildcard `_`
to match the `None` case on `Option<DisplayHint>`.

This is incorrect as it would also match any `Some(...)` variants that
were not explicitly handled, leading to unexpected behavior.

This commit changes the wildcard `_` to an explicit `None` match to
ensure that only the `None` case is handled, making the matching more
explicit and correct.

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
5 days ago
Michal Rostecki 727dfcd7ee
ci: Fix bpf-linker installation (#1295)
We've recently added an xtask to bpf-linker (aya-rs/bpf-linker#282),
which resulted in multiple binary targets. Therefore, bpf-linker has
to be installed with the following command:

```
cargo install --git https://github.com/aya-rs/bpf-linker.git bpf-linker
```

The last argument (`bpf-linker`) specifies the binary target.
7 days ago
Tamir Duberstein 35332f2288
aya: remove `AsyncPerfEventArray{,Buffer}`
Rather than support N async runtimes, push this to the user. The
relevant types (`PerfEventArrayBuffer` and `RingBuffer`) implement
`As{,Raw}Fd` which is sufficient with integration with tokio, smol, and
other async runtimes.
2 weeks ago
Thomas Bertschinger ab182be622 aya: `construct_debuglink_path()` should be infallible
`construct_debuglink_path()` returns a `Result`, but it doesn't actually
do anything that can fail. This means callers must do a useless
`unwrap()` to get at the return value.

This fixes the signature to reflect that the function is infallible.
2 weeks ago
Tamir Duberstein 0b1fbe1cd3
integration-test: add missing `test_log` decorator
Use the fully qualified macro name which composes better with
`test_case` and makes it easier to spot cases where it is missing.
2 weeks ago
Tamir Duberstein 61376c4608
aya-log: Remove tokio dep
Require the caller to provide their own executor.
2 weeks ago
Tamir Duberstein 3f02127b6b
aya: `impl AsFd for RingBuf`
This bound is needed for e.g. `smol::Async`.
2 weeks ago
Tamir Duberstein 9be2d723ce
aya-log: Replace AsyncPerfEventArray with RingBuf
This doesn't get us to zero copy because the reserve/submit APIs do not
support DSTs for reasons I don't remember.

Now that it is unused in userspace, move `LOG_BUF_CAPACITY` to
`aya-log-ebpf` by making its type `LogValueLength` which obviates the
need for `log_value_length_sufficient`.
2 weeks ago
Tamir Duberstein 8fb19264da
aya-log-ebpf: tidy up `macro_support`
Move top level items into and remove unused items from `macro_support`.
2 weeks ago
Tamir Duberstein 600927d6fc
aya-log-ebpf: use destructuring 2 weeks ago
Tamir Duberstein 90c2165231
Avoid shadowing `buf` 2 weeks ago
Tamir Duberstein 6a9ef2b43b
Replace macros with loops 2 weeks ago
Tamir Duberstein 87188f621a
Remove pointless `map_err` calls 2 weeks ago
Tamir Duberstein 44b26b3b50 integration-test: use only readable interest 2 weeks ago
Tamir Duberstein 5fa52ac5c1 integration-test: remove an allocation 2 weeks ago
Tamir Duberstein f08772ec2f test-distro: enable rust backtrace 2 weeks ago
dependabot[bot] cfff75166c build(deps): update public-api requirement in the cargo-crates group
Updates the requirements on [public-api](https://github.com/cargo-public-api/cargo-public-api) to permit the latest version.

Updates `public-api` to 0.47.1
- [Release notes](https://github.com/cargo-public-api/cargo-public-api/releases)
- [Changelog](https://github.com/cargo-public-api/cargo-public-api/blob/main/CHANGELOG.md)
- [Commits](https://github.com/cargo-public-api/cargo-public-api/compare/public-api-v0.47.0...public-api-v0.47.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
4 weeks ago
Tamir Duberstein 30d5c9f53e Remove dead code expectation fixed upstream
See https://github.com/rust-lang/rust/commit/c93fac7d64394c6b926d863c19.
4 weeks ago
tamird bd0424ca61 aya-obj, aya-ebpf-bindings: regenerate
libbpf commit: 20ea95b4505c477af3b6ff6ce9d19cee868ddc5d
1 month ago
Tamir Duberstein eda29958f8 Use CRABBY_GITHUB_TOKEN for regen PRs
See https://github.com/peter-evans/create-pull-request/issues/48.
1 month ago
dependabot[bot] 6d5826fe99
Merge pull request #1277 from aya-rs/dependabot/cargo/cargo-crates-2948a9e609 1 month ago
dependabot[bot] f96250e80d
build(deps): bump the cargo-crates group with 2 updates
Updates the requirements on [bindgen](https://github.com/rust-lang/rust-bindgen) and [which](https://github.com/harryfei/which-rs) to permit the latest version.

Updates `bindgen` to 0.71.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.71.0...v0.71.1)

Updates `which` to 7.0.3
- [Release notes](https://github.com/harryfei/which-rs/releases)
- [Changelog](https://github.com/harryfei/which-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/harryfei/which-rs/compare/7.0.0...7.0.3)

---
updated-dependencies:
- dependency-name: bindgen
  dependency-version: 0.71.1
  dependency-type: direct:production
  dependency-group: cargo-crates
- dependency-name: which
  dependency-version: 7.0.3
  dependency-type: direct:production
  dependency-group: cargo-crates
...

Signed-off-by: dependabot[bot] <support@github.com>
1 month ago
dependabot[bot] d1ed76e626
Merge pull request #1273 from aya-rs/dependabot/cargo/cargo-crates-af2cda06bf 2 months ago
dependabot[bot] a7e3e6d4d9
build(deps): bump the cargo-crates group with 2 updates
Updates the requirements on [cargo_metadata](https://github.com/oli-obk/cargo_metadata) and [object](https://github.com/gimli-rs/object) to permit the latest version.

Updates `cargo_metadata` to 0.19.2
- [Release notes](https://github.com/oli-obk/cargo_metadata/releases)
- [Changelog](https://github.com/oli-obk/cargo_metadata/blob/main/CHANGELOG.md)
- [Commits](https://github.com/oli-obk/cargo_metadata/compare/0.19.0...0.19.2)

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

---
updated-dependencies:
- dependency-name: cargo_metadata
  dependency-version: 0.19.2
  dependency-type: direct:production
  dependency-group: cargo-crates
- dependency-name: object
  dependency-version: 0.36.7
  dependency-type: direct:production
  dependency-group: cargo-crates
...

Signed-off-by: dependabot[bot] <support@github.com>
2 months ago
dependabot[bot] e239f3abbd
Merge pull request #1269 from aya-rs/dependabot/github_actions/github-actions-b6130af3f2 2 months ago
dependabot[bot] e1fa363619
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 19 to 20
- [Release notes](https://github.com/davidanson/markdownlint-cli2-action/releases)
- [Commits](https://github.com/davidanson/markdownlint-cli2-action/compare/v19...v20)

---
updated-dependencies:
- dependency-name: DavidAnson/markdownlint-cli2-action
  dependency-version: '20'
  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 37257fe7cd
Fix MD059/descriptive-link-text 2 months ago
Tamir Duberstein ccf6c4707f aya-ebpf: disable generic_const_exprs
This has recently regressed on nightly.

See https://github.com/rust-lang/rust/issues/141492.
2 months ago
Tamir Duberstein 4f654865e9 aya-ebpf: add a dedicated generic_const_exprs cfg 2 months ago
Tamir Duberstein 630a767117 Split relocation tests into multiple files
This avoids requiring kernel support for all types of relocations when
testing a specific type.
2 months ago
Tamir Duberstein c8e9037ca6 Avoid uncontrolled stdout into cargo
This fixes rebuild on change of C sources by black-holing:
- Output of `make` (harmless).
- Output of `llmv-objcopy` (harmful: binary data).
2 months ago
Tamir Duberstein 025b6eaa0d Use a macro to reduce boilerplate 2 months ago
Tamir Duberstein b6daf463e6 Remove stale comment since a1b46ece05 2 months ago
Mehnaz Yunus 4b5ba53a36 aya: implement TryFrom<[Program Type]> for FdLink for various program types
Implements TryFrom for FdLink for CgroupSkb, CgroupSock, CgroupSockAddr
and SockOps program types. This allows support for link pinning for
these program types, aligning with the documentation for FdLink.

Fixes: #739

Co-authored-by: Benjamin Barzen <bbarzen@amazon.com>
2 months ago
Tyrone Wu 7a0dabc295 aya: short-circuit info field if non-zero
Short-circuits `CACHE` to true if the field is non-zero.

This saves from executing the probing logic since the logic essentially
checks if the field can process (or doesn't error) non-zero value.
2 months ago
Tyrone Wu 23bc5b5836 aya,aya-obj: cache feat probed info fields
Cached probed for ProgramInfo fields instead of exposing it through
global FEATURE. Probing occurs on cache miss, which happens when first
accessing the field, *and* if the field is 0.
2 months ago
Tyrone Wu bd492860f5 aya: add feature probing for map type
Add API that probes whether kernel supports a map type.
2 months ago
Tyrone Wu ab77decd9a aya,aya-obj: add feature probing program type
Adds API that probes whether kernel supports a program type.
2 months ago
Dave Tucker f74a157907
Merge pull request #1262 from dave-tucker/stabilize-links
feat(aya): Make LinkInfo and loaded_links public
3 months ago
Dave Tucker 7dba5a41ad feat(aya): Make LinkInfo and loaded_links public
We have had loaded_links in the API as `#[doc(hidden)]` for a while.
I've been using it in bpfman and it's been fine. This commit does the
minimal work required to make the API stable.

We expose a `LinkInfo` type - similar to `ProgInfo` - which wraps the
generated type. In this case, `bpf_link_info`.

A few accessor functions have been added for `id`, `link_type` and
`program_id`. There are many more fields that could be (eventually)
made public.

As a convenience, `LinkInfo` can be retrieved from an existing FdLink
by using `FdLink::info()`.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 months ago
dependabot[bot] 92c73a72e7
Merge pull request #1263 from aya-rs/dependabot/cargo/cargo-crates-b22b264ef4 3 months ago
dependabot[bot] 95c03e6600
build(deps): update nix requirement in the cargo-crates group
Updates the requirements on [nix](https://github.com/nix-rust/nix) to permit the latest version.

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

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

Signed-off-by: dependabot[bot] <support@github.com>
3 months ago
Omri Steiner 33c9f2b2b2 aya: uprobe: use PathBuf for ResolveSymbolError::DebuglinkAccessError
Makes no sense to use a string, as it's a path.
This breaks the public API.
3 months ago
Omri Steiner 90d5604877 aya: uprobe attach: use mmap instead of reading whole binaries to memory 3 months ago
Omri Steiner 647100faa7 aya: clean up resolve_symbol a bit
Instead of using intermediate values to extend the lifetime of the
object::File, we just separate the branches.
3 months ago
Omri Steiner 3aded0e0a5 aya: move Mmap struct to aya::util 3 months ago
Tamir Duberstein 583709f6a0 appease `clippy::uninlined-format-args` 3 months ago
dependabot[bot] c65a200e9a
Merge pull request #1256 from aya-rs/dependabot/cargo/cargo-crates-9bb5a8e9c0 3 months ago
dependabot[bot] c0ff1aa0cc
build(deps): update network-types requirement in the cargo-crates group
Updates the requirements on [network-types](https://github.com/vadorovsky/network-types) to permit the latest version.

Updates `network-types` to 0.0.7
- [Release notes](https://github.com/vadorovsky/network-types/releases)
- [Changelog](https://github.com/vadorovsky/network-types/blob/main/CHANGELOG.md)
- [Commits](https://github.com/vadorovsky/network-types/compare/v0.0.7...v0.0.7)

---
updated-dependencies:
- dependency-name: network-types
  dependency-version: 0.0.7
  dependency-type: direct:production
  dependency-group: cargo-crates
...

Signed-off-by: dependabot[bot] <support@github.com>
3 months ago