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

Allow KernelResolver to load only kallsyms or just the kernel image. #11

Merged
merged 1 commit into from
Sep 26, 2022

Conversation

ThinkerYzu1
Copy link
Collaborator

Issue #7 mentioned that the BlazeSym doesn't resolve any address in the kernel space if a kernel image is not given or installed in the system. KernelResolver required both kallsyms and a kernel image to create itself successfully. However, the resolver should at least partially work even with only kallsyms.

Signed-off-by: Kui-Feng Lee kuifeng@fb.com

Issue libbpf#7 mentioned that the BlazeSym doesn't resolve any address in
the kernel space if a kernel image is not given or installed in the
system. KernelResolver required both kallsyms and a kernel image to
create itself successfully. However, the resolver should at least
partially work even with only kallsyms.

Signed-off-by: Kui-Feng Lee <kuifeng@fb.com>
Copy link
Member

@anakryiko anakryiko left a comment

Choose a reason for hiding this comment

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

just a naming nit, but otherwise LGTM.

BTW, does kernel resolver supports returning inline functions for kernel addresses?

let ksymresolver = cache_holder.get_ksym_cache().get_resolver(kallsyms)?;
let kernelresolver = ElfResolver::new(kernel_image, 0, cache_holder)?;
let ksymresolver = cache_holder.get_ksym_cache().get_resolver(kallsyms);
let kernelresolver = ElfResolver::new(kernel_image, 0, cache_holder);
Copy link
Member

Choose a reason for hiding this comment

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

naming nit. It's not clear what's the difference between ksymresolver and kernelresolver, tbh. maybe at least call kernelresolve an kelfresolver or something along those lines to point out that it's relying on ELF file?

@ThinkerYzu1
Copy link
Collaborator Author

Thanks!

@ThinkerYzu1 ThinkerYzu1 merged commit 6f39cac into libbpf:master Sep 26, 2022
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