[Lldb-commits] [PATCH] D121935: added intel-pt build instructions for lldb

walter erquinigo via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 17 11:40:43 PDT 2022


wallace requested changes to this revision.
wallace added a comment.

Thank you very much for helping out with the documentaiton!

As Jonas said, move the file to lldb/docs/intel_pt.rst and modify the necessary bits (some CMake changes) so that the documentation eventually appears in https://lldb.llvm.org/index.html as an "Tracing with Intel PT" section under the "Testing LLDB using QEMU" section. 
You can follow the format of https://lldb.llvm.org/use/qemu-testing.html for the document.



================
Comment at: lldb/source/Plugins/Trace/intel-pt/README.md:1
+## Instructions to build LLDB with Intel® PT Support
+
----------------
Tracing with Intel Processor Trace (Intel PT)


================
Comment at: lldb/source/Plugins/Trace/intel-pt/README.md:2
+## Instructions to build LLDB with Intel® PT Support
+
+### Before you get started
----------------
Intel PT is a technology available in modern Intel CPUs that allows efficient tracing of all the instructions executed by a process. LLDB can collect traces and dump them using its symbolication stack. You can read more here https://easyperf.net/blog/2019/08/23/Intel-Processor-Trace.


================
Comment at: lldb/source/Plugins/Trace/intel-pt/README.md:3
+
+### Before you get started
+
----------------
Prerequisites


================
Comment at: lldb/source/Plugins/Trace/intel-pt/README.md:5
+
+1. Confirm that your processor is an Intel® x86_64 based processor.
+
----------------



================
Comment at: lldb/source/Plugins/Trace/intel-pt/README.md:11
+    ```
+    The output of this should be a number greater than ...?
+
----------------



================
Comment at: lldb/source/Plugins/Trace/intel-pt/README.md:15
+
+1. Clone [LibIPT library](https://github.com/intel/libipt). The Intel® Processor Trace Decoder Library is Intel's® reference implementation for decoding Intel® PT. 
+    ```bash
----------------



================
Comment at: lldb/source/Plugins/Trace/intel-pt/README.md:15-40
+1. Clone [LibIPT library](https://github.com/intel/libipt). The Intel® Processor Trace Decoder Library is Intel's® reference implementation for decoding Intel® PT. 
+    ```bash
+    git clone git at github.com:intel/libipt.git
+    ```
+
+2. Clone [the LLVM Project](https://github.com/llvm/llvm-project) in its entirety from Github or Phabricator.
+    ```bash
----------------
wallace wrote:
> 
Let's keep it concise and direct


================
Comment at: lldb/source/Plugins/Trace/intel-pt/README.md:20-23
+2. Clone [the LLVM Project](https://github.com/llvm/llvm-project) in its entirety from Github or Phabricator.
+    ```bash
+    git clone git at github.com:llvm/llvm-project.git
+    ```
----------------
remove this, because you can assume the developer already knows how to build lldb


================
Comment at: lldb/source/Plugins/Trace/intel-pt/README.md:25-27
+3. Create build directories for both of these projects, outside the repositories.
+    ```bash
+    mkdir lldb-build libipt-build
----------------
only keep libipt-build


================
Comment at: lldb/source/Plugins/Trace/intel-pt/README.md:42-60
+5. Now it is time to build LLDB and link the LibIPT build and header files into it. Start by configuring all the build files for LLDB from LLVM.
+    ```bash
+    cmake \                
+      -B lldb-build \
+      -G Ninja \
+            -DLLVM_ENABLE_PROJECTS="clang;libcxx;lldb;libcxxabi" \
+            -DLLDB_BUILD_INTEL_PT=ON \
----------------



================
Comment at: lldb/source/Plugins/Trace/intel-pt/README.md:62-81
+7. When the build completes after a few decades, test it by running the version you just built.
+    ```bash
+    ./bin/lldb <program>
+    ```
+    Inside LLDB, set a breakpoint and start the process runnning
+    ```lldb
+    (lldb) break main
----------------
Instead of these instructions, you can use the internal documentation I have for using Intel PT.

https://pastebin.com/UiJJ32uh

Copy paste it here and add the appropriate formatting as a "How to use" section :)


================
Comment at: lldb/source/Plugins/Trace/intel-pt/README.md:85-86
+
+Some details about how Intel® Processor Trace works are in [this great blog post](https://engineering.fb.com/2021/04/27/developer-tools/reverse-debugging/).
+Other things about how LLDB works with this are included in [the RFC document](https://docs.google.com/document/d/1cOVTGp1sL_HBXjP9eB7qjVtDNr5xnuZvUUtv43G5eVI/edit#) for this.
+
----------------



================
Comment at: lldb/source/Plugins/Trace/intel-pt/README.md:90
+- https://easyperf.net/blog/2019/08/30/Intel-PT-part2#appendix-how-to-build-gdb-with-intel-pt-support
+- https://reviews.llvm.org/D91679
----------------
just delete this one


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121935/new/

https://reviews.llvm.org/D121935



More information about the lldb-commits mailing list