-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bring aya-log into aya, creating a Monorepo #350
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for aya-rs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
dave-tucker
force-pushed
the
monorepo
branch
12 times, most recently
from
July 27, 2022 17:42
21facc6
to
d5bbef2
Compare
Make BpfLogger::init(bpf) log using the default logger. Add BpfLoger::init_with_logger(bpf, logger) for logging using a custom logger instance.
Needed for crates.io
This way aya will create one perf buffer for each cpu
This change moves away argument formatting from eBPF to the userspace. eBPF part of aya-log writes unformatted log message and all arguments to the perf buffer and the userspace part of aya-log is formatting the message after receiving all arguments. Aya-based project to test this change: https://github.com/vadorovsky/aya-log-example Fixes: #4 Signed-off-by: Michal Rostecki <vadorovsky@gmail.com> Signed-off-by: Tuetuopay <tuetuopay@me.com> Co-authored-by: Tuetuopay <tuetuopay@me.com>
Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
This seems to help the verifier keep track of where we're writing into LOG_BUF
1024 is too small for many kernel string limits (i.e. PATH_MAX, which is 4096). Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
eBPF verifier rejects programs which are not checking the bounds of the log buffer before writing any arguments. This change ensures that written log arguments. In practice, it means that doing this kind of checks is not going to be needed in eBPF program code anymore: https://github.com/alessandrod/aya-echo-tracepoint/blob/33a1aee2eaa7503615a444ffa574dfba2be943f9/echo-ebpf/src/main.rs#L47 Tested on: https://github.com/vadorovsky/aya-echo-tracepoint/tree/876f8b45511d0818b683de9a2196e8103b92e1a7 Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
This ensures that macro expansion works properly and that expanded code compiles Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Updates the requirements on [aya](https://github.com/aya-rs/aya) to permit the latest version. - [Release notes](https://github.com/aya-rs/aya/releases) - [Commits](aya-rs/aya@aya-v0.10.7...aya-v0.11.0) --- updated-dependencies: - dependency-name: aya dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
This change adds checks in `TagLenValue.write()` to ensure that the size of written data doesn't exceed the buffer size. Verifier in recent kernel versions requires the bound to be a constant value, so using `buf.len()` does not work. Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
Change 821ba0b243fd removed the `size > buf.len()` check, which was a mistake, because we might write to a subslice of the whole buffer, so then `buf` can be lower than `LOG_BUF_CAPACITY`. This change compares `size` with `min::(buf.len(), LOG_BUF_CAPACITY)` instead. Fixes: 821ba0b243fd ("Ensure log buffer bounds") Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
This commit moves the aya-log projects from the subtree and adds them to the main cargo workspace. It also brings the BPF crates into the workspace and moves the macro crates up a level since they aren't BPF code. Miri was disabled for aya-bpf as the previous config wasn't actually checking anything. CI, clippy, fmt and release configurations have all been adjusted appropriately. CI was not properly running for other supported arches which was also ixed here. Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
vadorovsky
approved these changes
Jul 28, 2022
dave-tucker
added
fix
A PR that is a small change or fixes a bug
aya-log
Relating to aya-log
aya-log-ebpf
Relating to aya-log-ebpf
labels
Feb 23, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
aya-log
Relating to aya-log
aya-log-ebpf
Relating to aya-log-ebpf
fix
A PR that is a small change or fixes a bug
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
aya-log
directory.Note: I think this now ensures that aya-log-bpf@main and aya-bpf@main always rely on the same commit since they follow a
path
dep in the same repository.