Skip to content

aya-utils: add syscall_prefix and syscall_fnname_add_prefix#625

Merged
alessandrod merged 1 commit into
aya-rs:mainfrom
FedericoPonzi:issue-534
Jun 8, 2023
Merged

aya-utils: add syscall_prefix and syscall_fnname_add_prefix#625
alessandrod merged 1 commit into
aya-rs:mainfrom
FedericoPonzi:issue-534

Conversation

@FedericoPonzi

Copy link
Copy Markdown
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

netlify Bot commented Jun 6, 2023

Copy link
Copy Markdown

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.

@alessandrod alessandrod left a comment

Copy link
Copy Markdown
Collaborator

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

Comment thread aya/src/util.rs Outdated
Comment thread aya/src/util.rs Outdated
@FedericoPonzi FedericoPonzi force-pushed the issue-534 branch 6 times, most recently from fb4dd31 to 7c604d3 Compare June 7, 2023 08:25
@FedericoPonzi FedericoPonzi requested a review from alessandrod June 7, 2023 11:13
Comment thread aya/src/util.rs
Comment thread aya/src/util.rs Outdated
Comment thread aya/src/util.rs Outdated
Comment thread aya/src/util.rs Outdated
"__s390_sys_",
];
let ksym = kernel_symbols()?;
let values = ksym.into_values().collect::<Vec<_>>();

Copy link
Copy Markdown
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
Copy Markdown
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
@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.

2 participants