Skip to content
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

Merged
merged 1 commit into from Jun 8, 2023

Conversation

FedericoPonzi
Copy link
Contributor

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

@netlify
Copy link

netlify bot commented Jun 6, 2023

Deploy Preview for aya-rs-docs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 987e848
🔍 Latest deploy log https://app.netlify.com/sites/aya-rs-docs/deploys/64818eadfaa1860008ed6ffe
😎 Deploy Preview https://deploy-preview-625--aya-rs-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Collaborator

@alessandrod alessandrod left a 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

aya/src/util.rs Outdated Show resolved Hide resolved
aya/src/util.rs Outdated Show resolved Hide resolved
aya/src/util.rs Show resolved Hide resolved
aya/src/util.rs Outdated Show resolved Hide resolved
aya/src/util.rs Outdated Show resolved Hide resolved
aya/src/util.rs Outdated
"__s390_sys_",
];
let ksym = kernel_symbols()?;
let values = ksym.into_values().collect::<Vec<_>>();
Copy link
Collaborator

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

Copy link
Contributor Author

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
@alessandrod alessandrod merged commit 9cdae81 into aya-rs:main Jun 8, 2023
14 checks passed
@FedericoPonzi FedericoPonzi deleted the issue-534 branch June 10, 2023 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants