This is to reduce the size of the trace further and has appreciable results.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Change in memory use is appreciable.
thread #1: tid = 40371 Raw trace size: 4 KiB Total number of instructions: 145011 Total approximate memory usage: 1840.96 KiB Average memory usage per instruction: 13.00 bytes Number of TSC decoding errors: 0
Tests still need to be updated.
only mostly cosmetic changes needed. Thanks for this. I'm glad that we are bringing the usage down
lldb/source/Plugins/Trace/intel-pt/DecodedThread.cpp | ||
---|---|---|
55–56 | ||
58–63 | let's give better names to these variables | |
67–68 | we can stop using next_load_address because we now have access to the entire trace | |
179 | you also need to include m_instruction_timestamps, probably m_instruction_timestamps.size() * (sizeof(size_t) + sizeof(uint64_t)) | |
lldb/source/Plugins/Trace/intel-pt/DecodedThread.h | ||
127 | lowercase tsc because it's a variable | |
129–136 | I regret having created this method because it forces us to have a certain interface for the storage of the instructions. Let's just delete this method and create one new method size_t GetInstructionsCount() const; which should be able to replace all the external calls to this method | |
147 | ||
151–162 | Now that DecodedThread knows everything, we can simplify this method a bit. First, we can remove the parameter next_load_address, because it can easily be gotten by checking the instruction at index insn_index + 1 | |
185–191 | +1 | |
210 | ||
212 | ||
lldb/source/Plugins/Trace/intel-pt/TraceCursorIntelPT.cpp | ||
23–30 |
just remove a small comment and good to go!
lldb/source/Plugins/Trace/intel-pt/DecodedThread.h | ||
---|---|---|
143–146 | remove this |
lowercase tsc because it's a variable