[Lldb-commits] [PATCH] D125943: [trace][intelpt] Support system-wide tracing [11] - Read warnings and perf conversion in the client

walter erquinigo via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed May 18 19:22:10 PDT 2022


wallace created this revision.
wallace added a reviewer: jj10306.
Herald added a subscriber: pengfei.
Herald added a project: All.
wallace requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

- Add logging for when the live state of the process is refreshed
- Move error handling of the live state refreshing to Trace from TraceIntelPT. This allows refreshing to fail either at the plug-in level or at the base class level. The error is cached and it can be gotten every time RefreshLiveProcessState is invoked.
- Allow DoRefreshLiveProcessState to handle plugin-specific parameters.
- Add some encapsulation to prevent TraceIntelPT from accessing variables belonging to Trace.

Test done via logging:

  (lldb) b main
  Breakpoint 1: where = a.out`main + 20 at main.cpp:27:20, address = 0x00000000004023d9
  (lldb) r
  Process 2359706 launched: '/home/wallace/a.out' (x86_64)
  Process 2359706 stopped
  * thread #1, name = 'a.out', stop reason = breakpoint 1.1
      frame #0: 0x00000000004023d9 a.out`main at main.cpp:27:20
     24   };
     25  
     26   int main() {
  -> 27     std::vector<int> vvv;
     28     for (int i = 0; i < 100000; i++)
     29       vvv.push_back(i);
     30  
  (lldb) process trace start                                                                                        (lldb) log enable lldb target -F(lldb) n
  Process 2359706 stopped
  * thread #1, name = 'a.out', stop reason = step over
      frame #0: 0x00000000004023e8 a.out`main at main.cpp:28:12
     25  
     26   int main() {
     27     std::vector<int> vvv;
  -> 28     for (int i = 0; i < 100000; i++)
     29       vvv.push_back(i);
     30  
     31     std::deque<int> dq1 = {1, 2, 3};
  (lldb) thread trace dump instructions -c 2 -t                                                                     Trace.cpp:RefreshLiveProcessState                            Trace::RefreshLiveProcessState invoked
  TraceIntelPT.cpp:DoRefreshLiveProcessState                   TraceIntelPT found tsc conversion information
  thread #1: tid = 2359706
    a.out`std::vector<int, std::allocator<int>>::vector() + 26 at stl_vector.h:395:19
      54: [tsc=unavailable] 0x0000000000403a7c    retq   

See the logging lines at the end of the dump. They indicate that refreshing happened and that perf conversion information was found.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125943

Files:
  lldb/include/lldb/Target/Trace.h
  lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
  lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.h
  lldb/source/Target/Trace.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125943.430559.patch
Type: text/x-patch
Size: 8726 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220519/839da105/attachment-0001.bin>


More information about the lldb-commits mailing list