Adds a new module kernel_image to dump kcore's code segments and a new library drir2trace to convert DR's IR to trace entries.
(1) Adds a new module kernel_image 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', dump all code segments to 'kimage', and store all code segment's metadata, such as offset, length, and base, to 'kimage.metadata'.
(2) Updates drpt2ir to support getting raw bits of every instruction from 'kimage' and 'kimage.metadata'. drpt2ir uses two functions to load the kernel code segments. The load_kcore() can get code segments from 'kcore' generated by the Linux perf command. And the load_kernel_image() can get code segments from 'kimage' generated by the kernel_image module.
(3)Updates drpt2trace to support a new working mode: DR Mode. Adds a new option "-mode" to drpt2trace to let the user choose the working mode of drpt2trace. In the current implementation, drpt2trace supports three modes to convert: SIDEBAND Mode(-mode SIDEBAND), ELF Mode(-mode ELF) and DR Mode(-mode DR). And the "DR" mode is used to check whether the syscall PT trace generated by drcachesim is correct.
(4) Adds a new library drir2trace. This library converts DR's IR format to a list of trace_entry_t instances. We only convert DR's IR format to TRACE_TYPE_INSTR type instances in the current implementation.
(5) Updates raw2trace to support PT raw data converting In the current implementation, raw2trace invokes drpt2ir and drir2trace to convert every syscall's PT raw data to a list of trace_entry_t instances. And it writes all these trace_entry_t instances to the trace file.
(6) Updates the test used to check if dr$sim's kernel PT output is correct. In the current implementation, the test executes drcachesim to analyze the output userspace and kernel space trace first, and then it uses drpt2trace to check whether the first syscall's PT raw data is correct.
Issue: #5505