simpleperf: fix symbolization for kernel modules.
Simpleperf makes a wrong assumption that the kernel always load
.text section of a kernel module at the start of its module memory.
This can map an ip addr of a module to a wrong symbol.
To fix it:
1. In KernelModuleDso, calculate min_vaddr and memory_offset, which
are used to do the conversion in IpToVaddrInFile().
2. Change record_file_reader/writer to store min_vaddr and memory_offset
of KernelModuleDso in the recording file.
3. To get module start addresses, Use CheckKernelSymbolAddress() in
GetLoadedModules().
Bug: 174076407
Test: run simpleperf_unit_test.
Test: run simpleperf manually to check symbols of kernel modules.
Change-Id: I2498564f78dcc34761c5fe3ae9ffa6b88a98a048
9 files changed