llvm-project/lldb
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
..
bindings [lldb] Add AllocateMemory/DeallocateMemory to the SBProcess API 2021-07-16 00:45:22 +02:00
cmake [lldb] [cmake] Add LLVM_LIT_ARGS override support for standalone builds 2021-08-09 23:36:01 +02:00
docs [tests] [trace] Add a more comprehensive test for `thread trace export ctf` command 2021-08-11 20:50:10 -07:00
examples [lldb/Plugins] Add ScriptedProcess Process Plugin 2021-07-22 14:47:33 +02:00
include/lldb [trace] [intel pt] Create a "process trace save" command 2021-08-27 09:34:01 -07:00
packages/Python [test] Migrate -gcc-toolchain with space separator to --gcc-toolchain= 2021-08-20 15:24:58 -07:00
resources [lldb] Remove stale LLDB-Info.plist 2021-01-08 10:12:16 -08:00
scripts Prefer /usr/bin/env xxx over /usr/bin/xxx where xxx = perl, python, awk 2021-02-25 11:32:27 +01:00
source [trace] [intel pt] Create a "process trace save" command 2021-08-27 09:34:01 -07:00
test [trace] [intel pt] Create a "process trace save" command 2021-08-27 09:34:01 -07:00
third_party/Python/module [LLDB] Change pexpect timeout to 30 to 60 2021-08-02 06:34:11 +05:00
tools Fix two bugs with stack corefiles patch, restrict test built debugserver 2021-08-11 17:19:31 -07:00
unittests [lldb][NFC] Remove unused method RichManglingContext::IsFunction 2021-08-23 11:45:55 -07:00
utils [lldb] Match test dependencies name to other LLVM projects. 2021-05-21 00:10:27 -07:00
.clang-format
.clang-tidy [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
.gitignore
CMakeLists.txt [lldb] skip host build for lldb_tblgen with LLDB_TABLEGEN_EXE set 2021-08-13 14:18:03 -07:00
CODE_OWNERS.txt
LICENSE.TXT
use_lldb_suite_root.py