llvm-project/lldb/source
Walter Erquinigo 602497d672 [trace] [intel pt] Create a "process trace save" command
added new command "process trace save -d <directory>".
-it saves a JSON file as <directory>/trace.json, with the main properties of the trace session.
-it saves binary Intel-pt trace as <directory>/thread_id.trace; each file saves each thread.
-it saves modules to the directory <directory>/modules .
-it only works for live process and it only support Intel-pt right now.

Example:
```
b main
run
process trace start
n
process trace save -d /tmp/mytrace
```
A file named trace.json and xxx.trace should be generated in /tmp/mytrace. To load the trace that was just saved:
```
trace load /tmp/mytrace
thread trace dump instructions
```
You should see the instructions of the trace got printed.

To run a test:
```
cd ~/llvm-sand/build/Release/fbcode-x86_64/toolchain
ninja lldb-dotest
./bin/lldb-dotest -p TestTraceSave
```

Reviewed By: wallace

Differential Revision: https://reviews.llvm.org/D107669
2021-08-27 09:34:01 -07:00
..
API Ah, fix formatting, I didn't notice lldb-instr's code 2021-08-16 13:46:54 -07:00
Breakpoint [lldb] Use a struct to pass function search options to Module::FindFunction 2021-08-05 10:18:14 -07:00
Commands [trace] [intel pt] Create a "process trace save" command 2021-08-27 09:34:01 -07:00
Core [LLDB][GUI] Add initial searcher support 2021-08-25 13:55:11 -07:00
DataFormatters [nfc] [lldb] Prevent needless copies of DataExtractor 2021-08-04 20:35:53 +02:00
Expression [lldb] [gdb-remote] Add eOpenOptionReadWrite for future gdb compat 2021-08-09 12:06:59 +02:00
Host Update logic to close inherited file descriptors. 2021-08-19 14:40:43 -07:00
Initialization [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
Interpreter [lldb] [gdb-remote] Add eOpenOptionReadWrite for future gdb compat 2021-08-09 12:06:59 +02:00
Plugins [trace] [intel pt] Create a "process trace save" command 2021-08-27 09:34:01 -07:00
Symbol [lldb][NFC] Remove unused header include 2021-08-19 11:06:56 -07:00
Target [LLDB][GUI] Add Process Launch form 2021-08-18 15:43:30 -07:00
Utility [lldb][AArch64] Add memory tag writing to lldb-server 2021-07-27 12:02:17 +01:00
CMakeLists.txt
lldb.cpp [lldb] Reinstate support for LLDB_VERSION_STRING 2021-02-22 16:56:00 -08:00