aya-utils: add syscall_prefix and syscall_fnname_add_prefix#625
Merged
Conversation
✅ Deploy Preview for aya-rs-docs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
alessandrod
requested changes
Jun 6, 2023
alessandrod
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the PR! See comments
fb4dd31 to
7c604d3
Compare
alessandrod
reviewed
Jun 8, 2023
alessandrod
reviewed
Jun 8, 2023
| "__s390_sys_", | ||
| ]; | ||
| let ksym = kernel_symbols()?; | ||
| let values = ksym.into_values().collect::<Vec<_>>(); |
Collaborator
There was a problem hiding this comment.
I don't think we should collect here, you can use ksym.values() multiple times
Contributor
Author
There was a problem hiding this comment.
because there is no contains in values(), I've replaced contains() with any()
These two functions are needed because kernel symbols representing syscalls have architecture-specific prefixes. These are the equivalent of bcc's get_syscall_fnname and get_syscall_prefix. Solves: aya-rs#534
alessandrod
approved these changes
Jun 8, 2023
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
These two functions are needed because kernel symbols representing syscalls have architecture-specific prefixes.
These are the equivalent of bcc's get_syscall_fnname and get_syscall_prefix.
Solves: #534
Inspired by https://github.com/iovisor/bcc/blob/a078cbc7cfbdcee88c9cf3e2b76c2c8c1517e478/src/python/bcc/__init__.py#L804