Conversation
| pid: -1, | ||
| tid: 0, | ||
| address: module.base_address, | ||
| length: module.size, |
There was a problem hiding this comment.
A surprising coincidence, but I have been working on something similar locally. I've found an issue with using the extents from /proc/modules. Details below:
When CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC is enabled, .text and .data goes into separate memory regions. However /proc/modules reports start of .text as the basis but the module_total_size (code). So combining these two values will get you overlapping module ranges, and in samply overlapping module ranges will evict the previous one, causing symbolization to fail.
This probably needs to be taken upstream but until then I think we might need to clamp the module extents so that they don't overlap.
There was a problem hiding this comment.
Sorry, I got confused. On x64, CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC is not enabled, so it's not due to it. The correct explanation seems to be that data symbols precedes .text so using total size is still wrong.
There was a problem hiding this comment.
I pushed b8822c6, is this what you had in mind?
There was a problem hiding this comment.
Thanks, I'll test when I'm back at desk.
There was a problem hiding this comment.
Okay, the kernel module bases seem to resolve correctly, but symbolization for modules does not work. You probably need to parse module entries from kallsyms as well. Do you plan to do it? Otherwise I can see if I can pick up some of my local changes on top.
There was a problem hiding this comment.
I quickly created a module symbol parser in 9eaf3fa. It seems to symbolize correctly on my end.
There was a problem hiding this comment.
Nice, thanks, cherry-picked it
Mimics `perf` so the kernel and modules' symbols are registered in `Converter`.
f25cd32 to
133b718
Compare
133b718 to
c9de5c9
Compare
|
I'm curious how you're running samply in a way that gives you useful kernel symbols here. Did you change your |
|
On my end, I have both kptr_restrict and perf_event_paranoid relaxed. That allows reading kallsyms without root. But in any case root should work. https://github.com/torvalds/linux/blob/master/kernel/ksyms_common.c |
e01b5c6 to
e31872e
Compare
e31872e to
b8822c6
Compare
Kernel samples are not recorded nor decoded during
samply record. This PR is mainly two commits:perf, so thatConverteris notified of the kernel symbolsBased on #734.