Adds a new module kcore_copy, and updates drpt2ir and drpt2trace.
(1) Adds a new module kcore_copy to dump kcore's code segments. This module can read '/proc/modules' and '/proc/kallsyms' to get all module's information. Then it bases on the module's information to locate all code segments in '/proc/kcore', and dump all bytes and metadata of code segments to a ELF format file.
(2) Updates drpt2trace to support two working modes: ELF Mode and SIDEBAND Mode. Adds a new option "-mode" to drpt2trace to let the user choose the working mode of drpt2trace. In the current implementation, drpt2trace supports two modes to convert:
-
ELF (-mode ELF): the user provides an ELF file that contains all the instruction bytes. So, for example, we can use this mode to convert the kernel trace and the short-term user trace, where it's likely that we'll not have an image switch.
-
SIDEBAND (-mode SIDEBAND): the user must provide sideband data and parameters. In this mode, the converter uses sideband decoders to simulate image switches during the conversion. For example, we can use this mode to convert the traces where the instruction bytes are located in multiple images.
(3) Updates the test to check if dr$sim's kernel PT output is correct.
Issue: #5505