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
aya-utils: add syscall_prefix and syscall_fnname_add_prefix #625
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! See comments
fb4dd31
to
7c604d3
Compare
aya/src/util.rs
Outdated
"__s390_sys_", | ||
]; | ||
let ksym = kernel_symbols()?; | ||
let values = ksym.into_values().collect::<Vec<_>>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should collect here, you can use ksym.values()
multiple times
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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