[Lldb-commits] [PATCH] D122254: [trace][intelpt] Introduce instruction Ids
walter erquinigo via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri Mar 25 18:14:05 PDT 2022
wallace updated this revision to Diff 418361.
wallace marked 2 inline comments as done.
wallace added a comment.
Some updates:
- Modified `thread trace dump instructions` to accept one single thread instead of many. The reason is that, with the new --id argument, traversing multiple threads doesn't make sense anymore, as the id might only exist in one single thread. Besides that, it's really not very useful to analyze multiple threads in parallel by chunks. You normally want to analyze one of them at a time.
- I couldn't find a simple way to create the repeat command directly from `GetRepeatCommand` because it's not easy to quickly find what the next instruction is going to be in the repeat command. In fact, finding the id of that future instruction requires to actually traverse the instructions up to that point, but the traversal only happens in DoExecute, which is invoked after GetRepeatCommand. As a simple workarou nd, I'm adding a " repeat" positional argument that won't be parsed by CommandOptions but will still indicate that a repeat is happening. I was able to remove the --continue flag from Options.td, thus reducing the amount of code needed to handle the repeat. Not only that, I was able to get rid of the map<tid, TraceInstructionDumper> that I had in the CommandObject that I was using to continue the iteration in the repeat commands. Now I'm using the last iterated id to computed where the next one will be, thus creating a new brand new dumper with each command making this class simpler.
- I can't pass the Stream to TraceInstructionDumperOptions because when that object is crea ted the Stream is not yet available.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D122254/new/
https://reviews.llvm.org/D122254
Files:
lldb/include/lldb/Target/TraceCursor.h
lldb/include/lldb/Target/TraceInstructionDumper.h
lldb/source/Commands/CommandObjectThread.cpp
lldb/source/Commands/Options.td
lldb/source/Plugins/Trace/intel-pt/TraceCursorIntelPT.cpp
lldb/source/Plugins/Trace/intel-pt/TraceCursorIntelPT.h
lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
lldb/source/Plugins/TraceExporter/common/TraceHTR.cpp
lldb/source/Target/TraceInstructionDumper.cpp
lldb/test/API/commands/trace/TestTraceDumpInstructions.py
lldb/test/API/commands/trace/TestTraceStartStop.py
lldb/test/API/commands/trace/TestTraceTimestampCounters.py
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122254.418361.patch
Type: text/x-patch
Size: 51758 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220326/3af2f74c/attachment-0001.bin>
More information about the lldb-commits
mailing list