[Lldb-commits] [PATCH] D108050: [wip] [trace] Hierarchical Trace Representation (HTR) redesign and "call stack trace" visualization

Jakob Johnson via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 13 12:01:01 PDT 2021


jj10306 created this revision.
Herald added a subscriber: mgorny.
jj10306 requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Creating this patch so all the work from my internship is public and so I can continue to work on HTR if I'm able to get a hold of a machine supports Intel PT (-:

- Refactor/redesign the first iteration HTR implementation from https://reviews.llvm.org/D105741
- Add HTR support for TSC and add ability to see approximate timestamps in the trace visualization
- Change BasicSuperBlockPass to PatternMerge and the pass now is aware of functions

Here's an example of the "call stack trace" visualization:
F18512493: Screen Shot 2021-08-12 at 9.29.13 PM.png <https://reviews.llvm.org/F18512493>

The arrows in the image above point from a function call in the program to the corresponding block in the trace. Looking at the visualization on the right, you'll notice that the first two `push_back` blocks are significantly smaller than the third `push_back` block. 
Well, if we look at the code on the left, this is exactly what we would expect; the third call to `push_back` on line 9 will require a reallocation since we defined the capacity of the vector to be 2 on line 6!
Although contrived, this example illustrates how the "call stack trace" visualization allows you to gain deeper insight about the behavior of a program.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108050

Files:
  lldb/include/lldb/Target/TraceCursor.h
  lldb/source/Plugins/Trace/intel-pt/DecodedThread.cpp
  lldb/source/Plugins/Trace/intel-pt/DecodedThread.h
  lldb/source/Plugins/Trace/intel-pt/TraceCursorIntelPT.cpp
  lldb/source/Plugins/Trace/intel-pt/TraceCursorIntelPT.h
  lldb/source/Plugins/TraceExporter/common/CMakeLists.txt
  lldb/source/Plugins/TraceExporter/common/LayerHTR.cpp
  lldb/source/Plugins/TraceExporter/common/LayerHTR.h
  lldb/source/Plugins/TraceExporter/common/TraceHTR.cpp
  lldb/source/Plugins/TraceExporter/common/TraceHTR.h
  lldb/source/Plugins/TraceExporter/ctf/CommandObjectThreadTraceExportCTF.cpp
  lldb/test/API/commands/trace/TestTraceExport.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108050.366322.patch
Type: text/x-patch
Size: 65990 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210813/5ac7da28/attachment-0001.bin>


More information about the lldb-commits mailing list