-
Notifications
You must be signed in to change notification settings - Fork 170
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
API for creating a custom Linux kernel program #463
Comments
Notes from our discussion in the January meeting:
|
Thanks for the summary!
To clarify this point, I was more concerned about gdbstub implementations (and things like it) that don't yet have the ability to report the vmcoreinfo. In those cases, then the only way we know that we're debugging the kernel is if the user tells us (e.g., by passing a vmlinux file to
So we probably still need another interface, whether it's |
Currently, it's not documented anywhere, but the only way to create a
Program
that has theIS_LINUX_KERNEL
flag set is to go throughdrgn_program_set_core_dump_fd_internal()
.drgn/libdrgn/program.c
Lines 327 to 691 in 64d82dd
This means that it's not possible to create a Program that represents the kernel with a custom memory reader. This was the goal of #246, which enabled a really interesting use case, even if setting program flags may not be the preferred way to do so.
It seems to me that as of now, it wouldn't be terribly hard to support this. As far as I can tell, the following things would be necessary:
IS_LINUX_KERNEL
flag should be set.With that, I believe that the next time
Program.loaded_modules()
is called, the kernel module iterator would be activated, and assuming the memory readers work, drgn should be able to proceed as normal.I was thinking one interesting way to achieve this could be a
Program.linux_kernel_main_module()
function which does the above and then returns the kernel main module. However, I'm not sure that it's the right API, so I feel like that's an area to discuss.The text was updated successfully, but these errors were encountered: