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

Do not calculate syscall prefix proactively in C++ API #1755

Merged
merged 1 commit into from
May 14, 2018

Conversation

palmtenor
Copy link
Member

@palmtenor palmtenor commented May 11, 2018

Currently do calculate the syscall prefix in BPF::init, which requires loading kallsyms etc. But a lot of times the functionality will not be used. This commit changes that we only calculate the syscall prefix the first time we call get_syscall_fnname

Also change to use the KSym class directly for better destruct production

KSyms ksym;
uint64_t addr;

if (ksym.resolve_name(nullptr, "sys_bpf", &addr))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just poorman's folly::Optional...

@yonghong-song
Copy link
Collaborator

LGTM. Thanks!

@yonghong-song
Copy link
Collaborator

@palmtenor Could you add some commit summary? Current commit has a empty summary and github by default refuses to merge.

Currently do calculate the syscall prefix in BPF::init, which requires
loading kallsyms etc. But a lot of times the functionality will not be
used. This commit changes that we only calculate the syscall prefix the
first time we call get_syscall_fnname

Also change to use the KSym class directly for better destruct
production
@palmtenor
Copy link
Member Author

@yonghong-song Done. Sorry for that!

@yonghong-song yonghong-song merged commit db6e293 into iovisor:master May 14, 2018
banh-gao pushed a commit to banh-gao/bcc that referenced this pull request Jun 21, 2018
Currently do calculate the syscall prefix in BPF::init, which requires
loading kallsyms etc. But a lot of times the functionality will not be
used. This commit changes that we only calculate the syscall prefix the
first time we call get_syscall_fnname

Also change to use the KSym class directly for better destruct
production
@palmtenor palmtenor deleted the delayksym branch July 10, 2018 21:28
CrackerCat pushed a commit to CrackerCat/bcc that referenced this pull request Jul 31, 2024
Currently do calculate the syscall prefix in BPF::init, which requires
loading kallsyms etc. But a lot of times the functionality will not be
used. This commit changes that we only calculate the syscall prefix the
first time we call get_syscall_fnname

Also change to use the KSym class directly for better destruct
production
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