[Lldb-commits] [lldb] 2098e2f - [trace][intel pt][simple] Fix errors after switching to libipt's top of tree

Walter Erquinigo via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 25 14:35:21 PDT 2022


Author: Walter Erquinigo
Date: 2022-10-25T14:34:27-07:00
New Revision: 2098e2f472578f793c565b669500dca454b4a608

URL: https://github.com/llvm/llvm-project/commit/2098e2f472578f793c565b669500dca454b4a608
DIFF: https://github.com/llvm/llvm-project/commit/2098e2f472578f793c565b669500dca454b4a608.diff

LOG: [trace][intel pt][simple] Fix errors after switching to libipt's top of tree

These tests were being tested against a version of libipt from last
year. We just updated libipt to top of tree and many errors broke
because the new version of libipt emits more events than the older one,
which is fine.

`./bin/lldb-dotest -p TestTrace` passes

Added: 
    

Modified: 
    lldb/test/API/commands/trace/TestTraceDumpFunctionCalls.py
    lldb/test/API/commands/trace/TestTraceDumpInfo.py
    lldb/test/API/commands/trace/TestTraceDumpInstructions.py
    lldb/test/API/commands/trace/TestTraceEvents.py
    lldb/test/API/commands/trace/TestTraceLoad.py
    lldb/test/API/commands/trace/TestTraceStartStop.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/commands/trace/TestTraceDumpFunctionCalls.py b/lldb/test/API/commands/trace/TestTraceDumpFunctionCalls.py
index d37920bc719b2..0a8b4f4d2a3dd 100644
--- a/lldb/test/API/commands/trace/TestTraceDumpFunctionCalls.py
+++ b/lldb/test/API/commands/trace/TestTraceDumpFunctionCalls.py
@@ -11,15 +11,15 @@ def testDumpSimpleFunctionCalls(self):
         error=True, substrs=['error: no thread with index: "2"'])
 
       self.expect("thread trace dump function-calls 1 -j",
-        substrs=['[{"tracedSegments":[{"firstInstructionId":"1","lastInstructionId":"22"}]}]'])
+        substrs=['[{"tracedSegments":[{"firstInstructionId":"3","lastInstructionId":"26"}]}]'])
 
       self.expect("thread trace dump function-calls 1 -J",
         substrs=['''[
   {
     "tracedSegments": [
       {
-        "firstInstructionId": "1",
-        "lastInstructionId": "22"
+        "firstInstructionId": "3",
+        "lastInstructionId": "26"
       }
     ]
   }
@@ -30,7 +30,7 @@ def testDumpSimpleFunctionCalls(self):
         substrs=['''thread #1: tid = 3842849
 
 [call tree #0]
-a.out`main + 4 at main.cpp:2 to 4:0  [1, 22]'''])
+a.out`main + 4 at main.cpp:2 to 4:0  [3, 26]'''])
 
     def testFunctionCallsWithErrors(self):
       self.expect("trace load -v " +
@@ -104,43 +104,43 @@ def testInlineFunctionCalls(self):
       self.expect("c")
       self.expect("thread trace dump function-calls",
         substrs=['''[call tree #0]
-a.out`main + 8 at inline.cpp:15:7 to 16:14  [1, 5]
-  a.out`foo(int) at inline.cpp:8:16 to 9:15  [6, 13]
-    a.out`foo(int) + 22 [inlined] mult(int, int) at inline.cpp:2:7 to 5:10  [14, 21]
-  a.out`foo(int) + 49 at inline.cpp:9:15 to 12:1  [22, 26]
-a.out`main + 25 at inline.cpp:16:14 to 16:14  [27, 27]'''])
+a.out`main + 8 at inline.cpp:15:7 to 16:14  [2, 6]
+  a.out`foo(int) at inline.cpp:8:16 to 9:15  [7, 14]
+    a.out`foo(int) + 22 [inlined] mult(int, int) at inline.cpp:2:7 to 5:10  [15, 22]
+  a.out`foo(int) + 49 at inline.cpp:9:15 to 12:1  [23, 27]
+a.out`main + 25 at inline.cpp:16:14 to 16:14  [28, 28]'''])
 
       self.expect("thread trace dump function-calls -J",
         substrs=['''[
   {
     "tracedSegments": [
       {
-        "firstInstructionId": "1",
-        "lastInstructionId": "5",
+        "firstInstructionId": "2",
+        "lastInstructionId": "6",
         "nestedCall": {
           "tracedSegments": [
             {
-              "firstInstructionId": "6",
-              "lastInstructionId": "13",
+              "firstInstructionId": "7",
+              "lastInstructionId": "14",
               "nestedCall": {
                 "tracedSegments": [
                   {
-                    "firstInstructionId": "14",
-                    "lastInstructionId": "21"
+                    "firstInstructionId": "15",
+                    "lastInstructionId": "22"
                   }
                 ]
               }
             },
             {
-              "firstInstructionId": "22",
-              "lastInstructionId": "26"
+              "firstInstructionId": "23",
+              "lastInstructionId": "27"
             }
           ]
         }
       },
       {
-        "firstInstructionId": "27",
-        "lastInstructionId": "27"
+        "firstInstructionId": "28",
+        "lastInstructionId": "28"
       }
     ]
   }
@@ -157,9 +157,9 @@ def testIncompleteInlineFunctionCalls(self):
         substrs=['''[call tree #0]
 a.out`main
   a.out`foo(int)
-    a.out`foo(int) + 36 [inlined] mult(int, int) + 14 at inline.cpp:4:5 to 5:10  [1, 5]
-  a.out`foo(int) + 49 at inline.cpp:9:15 to 12:1  [6, 10]
-a.out`main + 25 at inline.cpp:16:14 to 16:14  [11, 11]'''])
+    a.out`foo(int) + 36 [inlined] mult(int, int) + 14 at inline.cpp:4:5 to 5:10  [2, 6]
+  a.out`foo(int) + 49 at inline.cpp:9:15 to 12:1  [7, 11]
+a.out`main + 25 at inline.cpp:16:14 to 16:14  [12, 12]'''])
 
       self.expect("thread trace dump function-calls -J",
         substrs=['''[
@@ -170,24 +170,24 @@ def testIncompleteInlineFunctionCalls(self):
           "nestedCall": {
             "tracedSegments": [
               {
-                "firstInstructionId": "1",
-                "lastInstructionId": "5"
+                "firstInstructionId": "2",
+                "lastInstructionId": "6"
               }
             ]
           }
         },
         "tracedSegments": [
           {
-            "firstInstructionId": "6",
-            "lastInstructionId": "10"
+            "firstInstructionId": "7",
+            "lastInstructionId": "11"
           }
         ]
       }
     },
     "tracedSegments": [
       {
-        "firstInstructionId": "11",
-        "lastInstructionId": "11"
+        "firstInstructionId": "12",
+        "lastInstructionId": "12"
       }
     ]
   }
@@ -210,41 +210,41 @@ def testMultifileFunctionCalls(self):
         substrs=['''thread #1: tid = 815455
 
 [call tree #0]
-a.out`main + 15 at main.cpp:10 to 10:0  [1, 1]
-  a.out`symbol stub for: foo() to <+11>  [3, 5]
-    a.out`a.out[0x0000000000400510] to a.out[0x0000000000400516]  [6, 7]
+a.out`main + 15 at main.cpp:10 to 10:0  [3, 3]
+  a.out`symbol stub for: foo() to <+11>  [7, 9]
+    a.out`a.out[0x0000000000400510] to a.out[0x0000000000400516]  [10, 11]
 
 [call tree #1]
-<tracing errors>  [8, 8]
+<tracing errors>  [12, 12]
 
 [call tree #2]
-a.out`main + 20 at main.cpp:10 to 12:0  [10, 14]
-  a.out`main + 34 [inlined] inline_function() at main.cpp:4 to 6:0  [16, 20]
-a.out`main + 55 at main.cpp:14 to 16:0  [21, 25]
-  a.out`symbol stub for: foo() to <+0>  [26, 26]
-    libfoo.so`foo() at foo.cpp:3 to 4:0  [27, 30]
-      libfoo.so`symbol stub for: bar() to <+0>  [31, 31]
-        libbar.so`bar() at bar.cpp:1 to 4:0  [32, 40]
-    libfoo.so`foo() + 13 at foo.cpp:4 to 6:0  [41, 48]
-a.out`main + 68 at main.cpp:16 to 16:0  [49, 51]'''])
+a.out`main + 20 at main.cpp:10 to 12:0  [16, 22]
+  a.out`main + 34 [inlined] inline_function() at main.cpp:4 to 6:0  [26, 30]
+a.out`main + 55 at main.cpp:14 to 16:0  [31, 37]
+  a.out`symbol stub for: foo() to <+0>  [38, 38]
+    libfoo.so`foo() at foo.cpp:3 to 4:0  [39, 42]
+      libfoo.so`symbol stub for: bar() to <+0>  [43, 43]
+        libbar.so`bar() at bar.cpp:1 to 4:0  [44, 52]
+    libfoo.so`foo() + 13 at foo.cpp:4 to 6:0  [53, 60]
+a.out`main + 68 at main.cpp:16 to 16:0  [61, 63]'''])
 
       self.expect("thread trace dump function-calls -J",
         substrs=['''[
   {
     "tracedSegments": [
       {
-        "firstInstructionId": "1",
-        "lastInstructionId": "1",
+        "firstInstructionId": "3",
+        "lastInstructionId": "3",
         "nestedCall": {
           "tracedSegments": [
             {
-              "firstInstructionId": "3",
-              "lastInstructionId": "5",
+              "firstInstructionId": "7",
+              "lastInstructionId": "9",
               "nestedCall": {
                 "tracedSegments": [
                   {
-                    "firstInstructionId": "6",
-                    "lastInstructionId": "7"
+                    "firstInstructionId": "10",
+                    "lastInstructionId": "11"
                   }
                 ]
               }
@@ -257,48 +257,48 @@ def testMultifileFunctionCalls(self):
   {
     "tracedSegments": [
       {
-        "firstInstructionId": "8",
-        "lastInstructionId": "8"
+        "firstInstructionId": "12",
+        "lastInstructionId": "12"
       }
     ]
   },
   {
     "tracedSegments": [
       {
-        "firstInstructionId": "10",
-        "lastInstructionId": "14",
+        "firstInstructionId": "16",
+        "lastInstructionId": "22",
         "nestedCall": {
           "tracedSegments": [
             {
-              "firstInstructionId": "16",
-              "lastInstructionId": "20"
+              "firstInstructionId": "26",
+              "lastInstructionId": "30"
             }
           ]
         }
       },
       {
-        "firstInstructionId": "21",
-        "lastInstructionId": "25",
+        "firstInstructionId": "31",
+        "lastInstructionId": "37",
         "nestedCall": {
           "tracedSegments": [
             {
-              "firstInstructionId": "26",
-              "lastInstructionId": "26",
+              "firstInstructionId": "38",
+              "lastInstructionId": "38",
               "nestedCall": {
                 "tracedSegments": [
                   {
-                    "firstInstructionId": "27",
-                    "lastInstructionId": "30",
+                    "firstInstructionId": "39",
+                    "lastInstructionId": "42",
                     "nestedCall": {
                       "tracedSegments": [
                         {
-                          "firstInstructionId": "31",
-                          "lastInstructionId": "31",
+                          "firstInstructionId": "43",
+                          "lastInstructionId": "43",
                           "nestedCall": {
                             "tracedSegments": [
                               {
-                                "firstInstructionId": "32",
-                                "lastInstructionId": "40"
+                                "firstInstructionId": "44",
+                                "lastInstructionId": "52"
                               }
                             ]
                           }
@@ -307,8 +307,8 @@ def testMultifileFunctionCalls(self):
                     }
                   },
                   {
-                    "firstInstructionId": "41",
-                    "lastInstructionId": "48"
+                    "firstInstructionId": "53",
+                    "lastInstructionId": "60"
                   }
                 ]
               }
@@ -317,8 +317,8 @@ def testMultifileFunctionCalls(self):
         }
       },
       {
-        "firstInstructionId": "49",
-        "lastInstructionId": "51"
+        "firstInstructionId": "61",
+        "lastInstructionId": "63"
       }
     ]
   }

diff  --git a/lldb/test/API/commands/trace/TestTraceDumpInfo.py b/lldb/test/API/commands/trace/TestTraceDumpInfo.py
index c6a62c7cf9a15..2f22c09fcaac3 100644
--- a/lldb/test/API/commands/trace/TestTraceDumpInfo.py
+++ b/lldb/test/API/commands/trace/TestTraceDumpInfo.py
@@ -38,19 +38,20 @@ def testDumpRawTraceSize(self):
 
   Trace technology: intel-pt
 
-  Total number of trace items: 24
+  Total number of trace items: 28
 
   Memory usage:
     Raw trace size: 4 KiB
-    Total approximate memory usage (excluding raw trace): 0.21 KiB
+    Total approximate memory usage (excluding raw trace): 0.25 KiB
     Average memory usage per item (excluding raw trace): 9.00 bytes
 
   Timing for this thread:
     Decoding instructions: ''', '''
 
   Events:
-    Number of individual events: 3
+    Number of individual events: 7
       software disabled tracing: 2
+      hardware disabled tracing: 4
       trace synchronization point: 1'''],
             patterns=["Decoding instructions: \d.\d\ds"])
 
@@ -64,18 +65,19 @@ def testDumpRawTraceSizeJSON(self):
   "traceTechnology": "intel-pt",
   "threadStats": {
     "tid": 3842849,
-    "traceItemsCount": 24,
+    "traceItemsCount": 28,
     "memoryUsage": {
-      "totalInBytes": "216",
+      "totalInBytes": "252",
       "avgPerItemInBytes": 9
     },
     "timingInSeconds": {
       "Decoding instructions": 0''', '''
     },
     "events": {
-      "totalCount": 3,
+      "totalCount": 7,
       "individualCounts": {
         "software disabled tracing": 2,
+        "hardware disabled tracing": 4,
         "trace synchronization point": 1
       }
     },

diff  --git a/lldb/test/API/commands/trace/TestTraceDumpInstructions.py b/lldb/test/API/commands/trace/TestTraceDumpInstructions.py
index d166f5dbd4aa2..7be054b6f6726 100644
--- a/lldb/test/API/commands/trace/TestTraceDumpInstructions.py
+++ b/lldb/test/API/commands/trace/TestTraceDumpInstructions.py
@@ -1,7 +1,5 @@
-import lldb
 from intelpt_testcase import *
 from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
 from lldbsuite.test.decorators import *
 
 class TestTraceDumpInstructions(TraceIntelPTTestCaseBase):
@@ -34,32 +32,32 @@ def testRawDumpInstructionsInJSON(self):
             substrs=["intel-pt"])
 
         self.expect("thread trace dump instructions --raw --count 5 --forwards --json",
-            substrs=['''[{"id":1,"loadAddress":"0x400511"}''',
-                     '''{"id":3,"loadAddress":"0x400518"}''',
-                     '''{"id":4,"loadAddress":"0x40051f"}''',
-                     '''{"id":5,"loadAddress":"0x400529"}''',
-                     '''{"id":6,"loadAddress":"0x40052d"}'''])
+            substrs=['''[{"id":3,"loadAddress":"0x400511"}''',
+                     '''{"id":7,"loadAddress":"0x400518"}''',
+                     '''{"id":8,"loadAddress":"0x40051f"}''',
+                     '''{"id":9,"loadAddress":"0x400529"}''',
+                     '''{"id":10,"loadAddress":"0x40052d"}'''])
 
         self.expect("thread trace dump instructions --raw --count 5 --forwards --pretty-json",
             substrs=['''[
   {
-    "id": 1,
+    "id": 3,
     "loadAddress": "0x400511"
   },
   {
-    "id": 3,
+    "id": 7,
     "loadAddress": "0x400518"
   },
   {
-    "id": 4,
+    "id": 8,
     "loadAddress": "0x40051f"
   },
   {
-    "id": 5,
+    "id": 9,
     "loadAddress": "0x400529"
   },
   {
-    "id": 6,
+    "id": 10,
     "loadAddress": "0x40052d"
   }
 ]'''])
@@ -76,23 +74,23 @@ def testRawDumpInstructionsInJSONToFile(self):
         with open(outfile, "r") as out:
             self.assertEqual(out.read(), '''[
   {
-    "id": 1,
+    "id": 3,
     "loadAddress": "0x400511"
   },
   {
-    "id": 3,
+    "id": 7,
     "loadAddress": "0x400518"
   },
   {
-    "id": 4,
+    "id": 8,
     "loadAddress": "0x40051f"
   },
   {
-    "id": 5,
+    "id": 9,
     "loadAddress": "0x400529"
   },
   {
-    "id": 6,
+    "id": 10,
     "loadAddress": "0x40052d"
   }
 ]''')
@@ -104,13 +102,9 @@ def testRawDumpInstructions(self):
 
         self.expect("thread trace dump instructions --raw --count 21 --forwards",
             substrs=['''thread #1: tid = 3842849
-    1: 0x0000000000400511
-    3: 0x0000000000400518
-    4: 0x000000000040051f
-    5: 0x0000000000400529
-    6: 0x000000000040052d
-    7: 0x0000000000400521
-    8: 0x0000000000400525
+    3: 0x0000000000400511
+    7: 0x0000000000400518
+    8: 0x000000000040051f
     9: 0x0000000000400529
     10: 0x000000000040052d
     11: 0x0000000000400521
@@ -124,45 +118,49 @@ def testRawDumpInstructions(self):
     19: 0x0000000000400521
     20: 0x0000000000400525
     21: 0x0000000000400529
-    22: 0x000000000040052d'''])
+    22: 0x000000000040052d
+    23: 0x0000000000400521
+    24: 0x0000000000400525
+    25: 0x0000000000400529
+    26: 0x000000000040052'''])
 
         # We check if we can pass count and skip
         self.expect("thread trace dump instructions --count 5 --skip 6 --raw --forwards",
             substrs=['''thread #1: tid = 3842849
-    6: 0x000000000040052d
-    7: 0x0000000000400521
-    8: 0x0000000000400525
+    7: 0x0000000000400518
+    8: 0x000000000040051f
     9: 0x0000000000400529
-    10: 0x000000000040052d'''])
+    10: 0x000000000040052d
+    11: 0x0000000000400521'''])
 
         self.expect("thread trace dump instructions --count 5 --skip 6 --raw",
             substrs=['''thread #1: tid = 3842849
-    17: 0x0000000000400529
-    16: 0x0000000000400525
-    15: 0x0000000000400521
-    14: 0x000000000040052d
-    13: 0x0000000000400529'''])
+    21: 0x0000000000400529
+    20: 0x0000000000400525
+    19: 0x0000000000400521
+    18: 0x000000000040052d
+    17: 0x0000000000400529'''])
 
         # We check if we can pass count and skip and instruction id in hex
-        self.expect("thread trace dump instructions --count 5 --skip 6 --raw --id 0xA",
+        self.expect("thread trace dump instructions --count 5 --skip 6 --raw --id 0xE",
             substrs=['''thread #1: tid = 3842849
-    4: 0x000000000040051f
-    3: 0x0000000000400518
-    1: 0x0000000000400511
+    8: 0x000000000040051f
+    7: 0x0000000000400518
+    3: 0x0000000000400511
     no more data'''])
 
         # We check if we can pass count and skip and instruction id in decimal
-        self.expect("thread trace dump instructions --count 5 --skip 6 --raw --id 10",
+        self.expect("thread trace dump instructions --count 5 --skip 6 --raw --id 14",
             substrs=['''thread #1: tid = 3842849
-    4: 0x000000000040051f
-    3: 0x0000000000400518
-    1: 0x0000000000400511
+    8: 0x000000000040051f
+    7: 0x0000000000400518
+    3: 0x0000000000400511
     no more data'''])
 
         # We check if we can access the thread by index id
         self.expect("thread trace dump instructions 1 --raw",
             substrs=['''thread #1: tid = 3842849
-    22: 0x000000000040052d'''])
+    26: 0x000000000040052d'''])
 
         # We check that we get an error when using an invalid thread index id
         self.expect("thread trace dump instructions 10", error=True,
@@ -177,30 +175,30 @@ def testDumpFullInstructionsWithMultipleThreads(self):
         self.expect("thread trace dump instructions 2 --count 2",
             substrs=['''thread #2: tid = 3842850
   a.out`main + 32 at main.cpp:4
-    22: 0x000000000040052d    jle    0x400521                  ; <+20> at main.cpp:5
-    21: 0x0000000000400529    cmpl   $0x3, -0x8(%rbp)'''])
+    26: 0x000000000040052d    jle    0x400521                  ; <+20> at main.cpp:5
+    25: 0x0000000000400529    cmpl   $0x3, -0x8(%rbp)'''])
 
         # We use custom --count and --skip, saving the command to history for later
         self.expect("thread trace dump instructions 2 --count 2 --skip 2", inHistory=True,
             substrs=['''thread #2: tid = 3842850
   a.out`main + 28 at main.cpp:4
-    21: 0x0000000000400529    cmpl   $0x3, -0x8(%rbp)
-    20: 0x0000000000400525    addl   $0x1, -0x8(%rbp)'''])
+    25: 0x0000000000400529    cmpl   $0x3, -0x8(%rbp)
+    24: 0x0000000000400525    addl   $0x1, -0x8(%rbp)'''])
 
         # We use a repeat command twice and ensure the previous count is used and the
         # start position moves with each command.
         self.expect("", inHistory=True,
             substrs=['''thread #2: tid = 3842850
   a.out`main + 20 at main.cpp:5
-    19: 0x0000000000400521    xorl   $0x1, -0x4(%rbp)
+    23: 0x0000000000400521    xorl   $0x1, -0x4(%rbp)
   a.out`main + 32 at main.cpp:4
-    18: 0x000000000040052d    jle    0x400521                  ; <+20> at main.cpp:5'''])
+    22: 0x000000000040052d    jle    0x400521                  ; <+20> at main.cpp:5'''])
 
         self.expect("", inHistory=True,
             substrs=['''thread #2: tid = 3842850
   a.out`main + 28 at main.cpp:4
-    17: 0x0000000000400529    cmpl   $0x3, -0x8(%rbp)
-    16: 0x0000000000400525    addl   $0x1, -0x8(%rbp'''])
+    21: 0x0000000000400529    cmpl   $0x3, -0x8(%rbp)
+    20: 0x0000000000400525    addl   $0x1, -0x8(%rbp'''])
 
     def testInvalidBounds(self):
         self.expect("trace load -v " +
@@ -210,10 +208,10 @@ def testInvalidBounds(self):
         self.expect("thread trace dump instructions --count 20 --forwards",
             substrs=['''thread #1: tid = 3842849
   a.out`main + 4 at main.cpp:2
-    1: 0x0000000000400511    movl   $0x0, -0x4(%rbp)
+    3: 0x0000000000400511    movl   $0x0, -0x4(%rbp)
   a.out`main + 11 at main.cpp:4
-    3: 0x0000000000400518    movl   $0x0, -0x8(%rbp)
-    4: 0x000000000040051f    jmp    0x400529                  ; <+28> at main.cpp:4'''])
+    7: 0x0000000000400518    movl   $0x0, -0x8(%rbp)
+    8: 0x000000000040051f    jmp    0x400529                  ; <+28> at main.cpp:4'''])
 
         # Should print no instructions if the position is out of bounds
         self.expect("thread trace dump instructions --skip 23",
@@ -229,7 +227,7 @@ def testWrongImage(self):
         self.expect("thread trace dump instructions --forwards",
             substrs=['''thread #1: tid = 3842849
     ...missing instructions
-    1: (error) no memory mapped at this address: 0x0000000000400511'''])
+    3: (error) no memory mapped at this address: 0x0000000000400511'''])
 
     def testWrongCPU(self):
         self.expect("trace load " +
@@ -241,35 +239,35 @@ def testMultiFileTraceWithMissingModuleInJSON(self):
         self.expect("trace load " +
             os.path.join(self.getSourceDir(), "intelpt-trace-multi-file", "multi-file-no-ld.json"))
 
-        self.expect("thread trace dump instructions --count 4 --id 5 --forwards --pretty-json",
+        self.expect("thread trace dump instructions --count 4 --id 9 --forwards --pretty-json",
             substrs=['''[
   {
-    "id": 5,
+    "id": 9,
     "loadAddress": "0x40054b",
     "module": "a.out",
     "symbol": "foo()",
     "mnemonic": "jmp"
   },
   {
-    "id": 6,
+    "id": 10,
     "loadAddress": "0x400510",
     "module": "a.out",
     "symbol": null,
     "mnemonic": "pushq"
   },
   {
-    "id": 7,
+    "id": 11,
     "loadAddress": "0x400516",
     "module": "a.out",
     "symbol": null,
     "mnemonic": "jmpq"
   },
   {
-    "id": 8,
+    "id": 12,
     "error": "no memory mapped at this address: 0x00007ffff7df1950"
   },
   {
-    "id": 10,
+    "id": 16,
     "loadAddress": "0x400674",
     "module": "a.out",
     "symbol": "main",
@@ -284,42 +282,42 @@ def testMultiFileTraceWithMissingModuleInJSON(self):
                 substrs=['''[
   {
     "id": 20,
-    "loadAddress": "0x400694",
+    "loadAddress": "0x400677",
     "module": "a.out",
-    "symbol": "inline_function()",
+    "symbol": "main",
     "mnemonic": "movl",
     "source": "/home/wallace/llvm-sand/external/llvm-project/lldb/test/API/commands/trace/intelpt-trace-multi-file/main.cpp",
-    "line": 6,
+    "line": 12,
     "column": 0
   },
   {
     "id": 21,
-    "loadAddress": "0x400697",
+    "loadAddress": "0x40067a",
     "module": "a.out",
     "symbol": "main",
-    "mnemonic": "movl",
+    "mnemonic": "addl",
     "source": "/home/wallace/llvm-sand/external/llvm-project/lldb/test/API/commands/trace/intelpt-trace-multi-file/main.cpp",
-    "line": 14,
+    "line": 12,
     "column": 0
   },
   {
     "id": 22,
-    "loadAddress": "0x40069a",
+    "loadAddress": "0x40067f",
     "module": "a.out",
     "symbol": "main",
-    "mnemonic": "addl",
+    "mnemonic": "movl",
     "source": "/home/wallace/llvm-sand/external/llvm-project/lldb/test/API/commands/trace/intelpt-trace-multi-file/main.cpp",
-    "line": 14,
+    "line": 12,
     "column": 0
   },
   {
-    "id": 23,
-    "loadAddress": "0x40069c",
+    "id": 26,
+    "loadAddress": "0x400682",
     "module": "a.out",
-    "symbol": "main",
+    "symbol": "inline_function()",
     "mnemonic": "movl",
     "source": "/home/wallace/llvm-sand/external/llvm-project/lldb/test/API/commands/trace/intelpt-trace-multi-file/main.cpp",
-    "line": 14,
+    "line": 4,
     "column": 0
   }
 ]'''])
@@ -345,148 +343,148 @@ def testMultiFileTraceWithMissingModule(self):
         self.expect("thread trace dump instructions --count 50 --forwards",
             substrs=['''thread #1: tid = 815455
   a.out`main + 15 at main.cpp:10
-    1: 0x000000000040066f    callq  0x400540                  ; symbol stub for: foo()
+    3: 0x000000000040066f    callq  0x400540                  ; symbol stub for: foo()
   a.out`symbol stub for: foo()
-    3: 0x0000000000400540    jmpq   *0x200ae2(%rip)           ; _GLOBAL_OFFSET_TABLE_ + 40
-    4: 0x0000000000400546    pushq  $0x2
-    5: 0x000000000040054b    jmp    0x400510
+    7: 0x0000000000400540    jmpq   *0x200ae2(%rip)           ; _GLOBAL_OFFSET_TABLE_ + 40
+    8: 0x0000000000400546    pushq  $0x2
+    9: 0x000000000040054b    jmp    0x400510
   a.out`(none)
-    6: 0x0000000000400510    pushq  0x200af2(%rip)            ; _GLOBAL_OFFSET_TABLE_ + 8
-    7: 0x0000000000400516    jmpq   *0x200af4(%rip)           ; _GLOBAL_OFFSET_TABLE_ + 16
+    10: 0x0000000000400510    pushq  0x200af2(%rip)            ; _GLOBAL_OFFSET_TABLE_ + 8
+    11: 0x0000000000400516    jmpq   *0x200af4(%rip)           ; _GLOBAL_OFFSET_TABLE_ + 16
     ...missing instructions
-    8: (error) no memory mapped at this address: 0x00007ffff7df1950
+    12: (error) no memory mapped at this address: 0x00007ffff7df1950
   a.out`main + 20 at main.cpp:10
-    10: 0x0000000000400674    movl   %eax, -0xc(%rbp)
+    16: 0x0000000000400674    movl   %eax, -0xc(%rbp)
   a.out`main + 23 at main.cpp:12
-    12: 0x0000000000400677    movl   -0xc(%rbp), %eax
-    13: 0x000000000040067a    addl   $0x1, %eax
-    14: 0x000000000040067f    movl   %eax, -0xc(%rbp)
+    20: 0x0000000000400677    movl   -0xc(%rbp), %eax
+    21: 0x000000000040067a    addl   $0x1, %eax
+    22: 0x000000000040067f    movl   %eax, -0xc(%rbp)
   a.out`main + 34 [inlined] inline_function() at main.cpp:4
-    16: 0x0000000000400682    movl   $0x0, -0x4(%rbp)
+    26: 0x0000000000400682    movl   $0x0, -0x4(%rbp)
   a.out`main + 41 [inlined] inline_function() + 7 at main.cpp:5
-    17: 0x0000000000400689    movl   -0x4(%rbp), %eax
-    18: 0x000000000040068c    addl   $0x1, %eax
-    19: 0x0000000000400691    movl   %eax, -0x4(%rbp)
+    27: 0x0000000000400689    movl   -0x4(%rbp), %eax
+    28: 0x000000000040068c    addl   $0x1, %eax
+    29: 0x0000000000400691    movl   %eax, -0x4(%rbp)
   a.out`main + 52 [inlined] inline_function() + 18 at main.cpp:6
-    20: 0x0000000000400694    movl   -0x4(%rbp), %eax
+    30: 0x0000000000400694    movl   -0x4(%rbp), %eax
   a.out`main + 55 at main.cpp:14
-    21: 0x0000000000400697    movl   -0xc(%rbp), %ecx
-    22: 0x000000000040069a    addl   %eax, %ecx
-    23: 0x000000000040069c    movl   %ecx, -0xc(%rbp)
+    31: 0x0000000000400697    movl   -0xc(%rbp), %ecx
+    32: 0x000000000040069a    addl   %eax, %ecx
+    33: 0x000000000040069c    movl   %ecx, -0xc(%rbp)
   a.out`main + 63 at main.cpp:16
-    25: 0x000000000040069f    callq  0x400540                  ; symbol stub for: foo()
+    37: 0x000000000040069f    callq  0x400540                  ; symbol stub for: foo()
   a.out`symbol stub for: foo()
-    26: 0x0000000000400540    jmpq   *0x200ae2(%rip)           ; _GLOBAL_OFFSET_TABLE_ + 40
+    38: 0x0000000000400540    jmpq   *0x200ae2(%rip)           ; _GLOBAL_OFFSET_TABLE_ + 40
   libfoo.so`foo() at foo.cpp:3
-    27: 0x00007ffff7bd96e0    pushq  %rbp
-    28: 0x00007ffff7bd96e1    movq   %rsp, %rbp
+    39: 0x00007ffff7bd96e0    pushq  %rbp
+    40: 0x00007ffff7bd96e1    movq   %rsp, %rbp
   libfoo.so`foo() + 4 at foo.cpp:4
-    29: 0x00007ffff7bd96e4    subq   $0x10, %rsp
-    30: 0x00007ffff7bd96e8    callq  0x7ffff7bd95d0            ; symbol stub for: bar()
+    41: 0x00007ffff7bd96e4    subq   $0x10, %rsp
+    42: 0x00007ffff7bd96e8    callq  0x7ffff7bd95d0            ; symbol stub for: bar()
   libfoo.so`symbol stub for: bar()
-    31: 0x00007ffff7bd95d0    jmpq   *0x200a4a(%rip)           ; _GLOBAL_OFFSET_TABLE_ + 32
+    43: 0x00007ffff7bd95d0    jmpq   *0x200a4a(%rip)           ; _GLOBAL_OFFSET_TABLE_ + 32
   libbar.so`bar() at bar.cpp:1
-    32: 0x00007ffff79d7690    pushq  %rbp
-    33: 0x00007ffff79d7691    movq   %rsp, %rbp
+    44: 0x00007ffff79d7690    pushq  %rbp
+    45: 0x00007ffff79d7691    movq   %rsp, %rbp
   libbar.so`bar() + 4 at bar.cpp:2
-    34: 0x00007ffff79d7694    movl   $0x1, -0x4(%rbp)
+    46: 0x00007ffff79d7694    movl   $0x1, -0x4(%rbp)
   libbar.so`bar() + 11 at bar.cpp:3
-    35: 0x00007ffff79d769b    movl   -0x4(%rbp), %eax
-    36: 0x00007ffff79d769e    addl   $0x1, %eax
-    37: 0x00007ffff79d76a3    movl   %eax, -0x4(%rbp)
+    47: 0x00007ffff79d769b    movl   -0x4(%rbp), %eax
+    48: 0x00007ffff79d769e    addl   $0x1, %eax
+    49: 0x00007ffff79d76a3    movl   %eax, -0x4(%rbp)
   libbar.so`bar() + 22 at bar.cpp:4
-    38: 0x00007ffff79d76a6    movl   -0x4(%rbp), %eax
-    39: 0x00007ffff79d76a9    popq   %rbp
-    40: 0x00007ffff79d76aa    retq''',
+    50: 0x00007ffff79d76a6    movl   -0x4(%rbp), %eax
+    51: 0x00007ffff79d76a9    popq   %rbp
+    52: 0x00007ffff79d76aa    retq''',
   '''libfoo.so`foo() + 13 at foo.cpp:4
-    41: 0x00007ffff7bd96ed    movl   %eax, -0x4(%rbp)
+    53: 0x00007ffff7bd96ed    movl   %eax, -0x4(%rbp)
   libfoo.so`foo() + 16 at foo.cpp:5
-    42: 0x00007ffff7bd96f0    movl   -0x4(%rbp), %eax
-    43: 0x00007ffff7bd96f3    addl   $0x1, %eax
-    44: 0x00007ffff7bd96f8    movl   %eax, -0x4(%rbp)
+    54: 0x00007ffff7bd96f0    movl   -0x4(%rbp), %eax
+    55: 0x00007ffff7bd96f3    addl   $0x1, %eax
+    56: 0x00007ffff7bd96f8    movl   %eax, -0x4(%rbp)
   libfoo.so`foo() + 27 at foo.cpp:6
-    45: 0x00007ffff7bd96fb    movl   -0x4(%rbp), %eax
-    46: 0x00007ffff7bd96fe    addq   $0x10, %rsp
-    47: 0x00007ffff7bd9702    popq   %rbp
-    48: 0x00007ffff7bd9703    retq''',
+    57: 0x00007ffff7bd96fb    movl   -0x4(%rbp), %eax
+    58: 0x00007ffff7bd96fe    addq   $0x10, %rsp
+    59: 0x00007ffff7bd9702    popq   %rbp
+    60: 0x00007ffff7bd9703    retq''',
   '''a.out`main + 68 at main.cpp:16
-    49: 0x00000000004006a4    movl   -0xc(%rbp), %ecx
-    50: 0x00000000004006a7    addl   %eax, %ecx
-    51: 0x00000000004006a9    movl   %ecx, -0xc(%rbp)
+    61: 0x00000000004006a4    movl   -0xc(%rbp), %ecx
+    62: 0x00000000004006a7    addl   %eax, %ecx
+    63: 0x00000000004006a9    movl   %ecx, -0xc(%rbp)
     no more data'''])
 
 
         self.expect("thread trace dump instructions --count 50",
             substrs=['''thread #1: tid = 815455
   a.out`main + 73 at main.cpp:16
-    51: 0x00000000004006a9    movl   %ecx, -0xc(%rbp)
-    50: 0x00000000004006a7    addl   %eax, %ecx
-    49: 0x00000000004006a4    movl   -0xc(%rbp), %ecx
+    63: 0x00000000004006a9    movl   %ecx, -0xc(%rbp)
+    62: 0x00000000004006a7    addl   %eax, %ecx
+    61: 0x00000000004006a4    movl   -0xc(%rbp), %ecx
   libfoo.so`foo() + 35 at foo.cpp:6
-    48: 0x00007ffff7bd9703    retq''',
-    '''47: 0x00007ffff7bd9702    popq   %rbp
-    46: 0x00007ffff7bd96fe    addq   $0x10, %rsp
-    45: 0x00007ffff7bd96fb    movl   -0x4(%rbp), %eax
+    60: 0x00007ffff7bd9703    retq''',
+    '''59: 0x00007ffff7bd9702    popq   %rbp
+    58: 0x00007ffff7bd96fe    addq   $0x10, %rsp
+    57: 0x00007ffff7bd96fb    movl   -0x4(%rbp), %eax
   libfoo.so`foo() + 24 at foo.cpp:5
-    44: 0x00007ffff7bd96f8    movl   %eax, -0x4(%rbp)
-    43: 0x00007ffff7bd96f3    addl   $0x1, %eax
-    42: 0x00007ffff7bd96f0    movl   -0x4(%rbp), %eax
+    56: 0x00007ffff7bd96f8    movl   %eax, -0x4(%rbp)
+    55: 0x00007ffff7bd96f3    addl   $0x1, %eax
+    54: 0x00007ffff7bd96f0    movl   -0x4(%rbp), %eax
   libfoo.so`foo() + 13 at foo.cpp:4
-    41: 0x00007ffff7bd96ed    movl   %eax, -0x4(%rbp)
+    53: 0x00007ffff7bd96ed    movl   %eax, -0x4(%rbp)
   libbar.so`bar() + 26 at bar.cpp:4
-    40: 0x00007ffff79d76aa    retq''',
-    '''39: 0x00007ffff79d76a9    popq   %rbp
-    38: 0x00007ffff79d76a6    movl   -0x4(%rbp), %eax
+    52: 0x00007ffff79d76aa    retq''',
+    '''51: 0x00007ffff79d76a9    popq   %rbp
+    50: 0x00007ffff79d76a6    movl   -0x4(%rbp), %eax
   libbar.so`bar() + 19 at bar.cpp:3
-    37: 0x00007ffff79d76a3    movl   %eax, -0x4(%rbp)
-    36: 0x00007ffff79d769e    addl   $0x1, %eax
-    35: 0x00007ffff79d769b    movl   -0x4(%rbp), %eax
+    49: 0x00007ffff79d76a3    movl   %eax, -0x4(%rbp)
+    48: 0x00007ffff79d769e    addl   $0x1, %eax
+    47: 0x00007ffff79d769b    movl   -0x4(%rbp), %eax
   libbar.so`bar() + 4 at bar.cpp:2
-    34: 0x00007ffff79d7694    movl   $0x1, -0x4(%rbp)
+    46: 0x00007ffff79d7694    movl   $0x1, -0x4(%rbp)
   libbar.so`bar() + 1 at bar.cpp:1
-    33: 0x00007ffff79d7691    movq   %rsp, %rbp
-    32: 0x00007ffff79d7690    pushq  %rbp
+    45: 0x00007ffff79d7691    movq   %rsp, %rbp
+    44: 0x00007ffff79d7690    pushq  %rbp
   libfoo.so`symbol stub for: bar()
-    31: 0x00007ffff7bd95d0    jmpq   *0x200a4a(%rip)           ; _GLOBAL_OFFSET_TABLE_ + 32
+    43: 0x00007ffff7bd95d0    jmpq   *0x200a4a(%rip)           ; _GLOBAL_OFFSET_TABLE_ + 32
   libfoo.so`foo() + 8 at foo.cpp:4
-    30: 0x00007ffff7bd96e8    callq  0x7ffff7bd95d0            ; symbol stub for: bar()
-    29: 0x00007ffff7bd96e4    subq   $0x10, %rsp
+    42: 0x00007ffff7bd96e8    callq  0x7ffff7bd95d0            ; symbol stub for: bar()
+    41: 0x00007ffff7bd96e4    subq   $0x10, %rsp
   libfoo.so`foo() + 1 at foo.cpp:3
-    28: 0x00007ffff7bd96e1    movq   %rsp, %rbp
-    27: 0x00007ffff7bd96e0    pushq  %rbp
+    40: 0x00007ffff7bd96e1    movq   %rsp, %rbp
+    39: 0x00007ffff7bd96e0    pushq  %rbp
   a.out`symbol stub for: foo()
-    26: 0x0000000000400540    jmpq   *0x200ae2(%rip)           ; _GLOBAL_OFFSET_TABLE_ + 40
+    38: 0x0000000000400540    jmpq   *0x200ae2(%rip)           ; _GLOBAL_OFFSET_TABLE_ + 40
   a.out`main + 63 at main.cpp:16
-    25: 0x000000000040069f    callq  0x400540                  ; symbol stub for: foo()
+    37: 0x000000000040069f    callq  0x400540                  ; symbol stub for: foo()
   a.out`main + 60 at main.cpp:14
-    23: 0x000000000040069c    movl   %ecx, -0xc(%rbp)
-    22: 0x000000000040069a    addl   %eax, %ecx
-    21: 0x0000000000400697    movl   -0xc(%rbp), %ecx
+    33: 0x000000000040069c    movl   %ecx, -0xc(%rbp)
+    32: 0x000000000040069a    addl   %eax, %ecx
+    31: 0x0000000000400697    movl   -0xc(%rbp), %ecx
   a.out`main + 52 [inlined] inline_function() + 18 at main.cpp:6
-    20: 0x0000000000400694    movl   -0x4(%rbp), %eax
+    30: 0x0000000000400694    movl   -0x4(%rbp), %eax
   a.out`main + 49 [inlined] inline_function() + 15 at main.cpp:5
-    19: 0x0000000000400691    movl   %eax, -0x4(%rbp)
-    18: 0x000000000040068c    addl   $0x1, %eax
-    17: 0x0000000000400689    movl   -0x4(%rbp), %eax
+    29: 0x0000000000400691    movl   %eax, -0x4(%rbp)
+    28: 0x000000000040068c    addl   $0x1, %eax
+    27: 0x0000000000400689    movl   -0x4(%rbp), %eax
   a.out`main + 34 [inlined] inline_function() at main.cpp:4
-    16: 0x0000000000400682    movl   $0x0, -0x4(%rbp)
+    26: 0x0000000000400682    movl   $0x0, -0x4(%rbp)
   a.out`main + 31 at main.cpp:12
-    14: 0x000000000040067f    movl   %eax, -0xc(%rbp)
-    13: 0x000000000040067a    addl   $0x1, %eax
-    12: 0x0000000000400677    movl   -0xc(%rbp), %eax
+    22: 0x000000000040067f    movl   %eax, -0xc(%rbp)
+    21: 0x000000000040067a    addl   $0x1, %eax
+    20: 0x0000000000400677    movl   -0xc(%rbp), %eax
   a.out`main + 20 at main.cpp:10
-    10: 0x0000000000400674    movl   %eax, -0xc(%rbp)
+    16: 0x0000000000400674    movl   %eax, -0xc(%rbp)
     ...missing instructions
-    8: (error) no memory mapped at this address: 0x00007ffff7df1950
+    12: (error) no memory mapped at this address: 0x00007ffff7df1950
   a.out`(none)
-    7: 0x0000000000400516    jmpq   *0x200af4(%rip)           ; _GLOBAL_OFFSET_TABLE_ + 16
-    6: 0x0000000000400510    pushq  0x200af2(%rip)            ; _GLOBAL_OFFSET_TABLE_ + 8
+    11: 0x0000000000400516    jmpq   *0x200af4(%rip)           ; _GLOBAL_OFFSET_TABLE_ + 16
+    10: 0x0000000000400510    pushq  0x200af2(%rip)            ; _GLOBAL_OFFSET_TABLE_ + 8
   a.out`symbol stub for: foo() + 11
-    5: 0x000000000040054b    jmp    0x400510
-    4: 0x0000000000400546    pushq  $0x2
-    3: 0x0000000000400540    jmpq   *0x200ae2(%rip)           ; _GLOBAL_OFFSET_TABLE_ + 40
+    9: 0x000000000040054b    jmp    0x400510
+    8: 0x0000000000400546    pushq  $0x2
+    7: 0x0000000000400540    jmpq   *0x200ae2(%rip)           ; _GLOBAL_OFFSET_TABLE_ + 40
   a.out`main + 15 at main.cpp:10
-    1: 0x000000000040066f    callq  0x400540                  ; symbol stub for: foo()
+    3: 0x000000000040066f    callq  0x400540                  ; symbol stub for: foo()
     no more data'''])
 
         self.expect("thread trace dump instructions --skip 100 --forwards", inHistory=True,
@@ -499,13 +497,13 @@ def testMultiFileTraceWithMissingModule(self):
 
         self.expect("thread trace dump instructions --raw --all --forwards",
             substrs=['''thread #1: tid = 815455
-    1: 0x000000000040066f
-    3: 0x0000000000400540''',
-    '''7: 0x0000000000400516
+    3: 0x000000000040066f
+    7: 0x0000000000400540''',
+    '''11: 0x0000000000400516
     ...missing instructions
-    8: (error) no memory mapped at this address: 0x00007ffff7df1950
-    10: 0x0000000000400674''',
-    '''49: 0x00000000004006a4
-    50: 0x00000000004006a7
-    51: 0x00000000004006a9
+    12: (error) no memory mapped at this address: 0x00007ffff7df1950
+    16: 0x0000000000400674''',
+    '''61: 0x00000000004006a4
+    62: 0x00000000004006a7
+    63: 0x00000000004006a9
     no more data'''])

diff  --git a/lldb/test/API/commands/trace/TestTraceEvents.py b/lldb/test/API/commands/trace/TestTraceEvents.py
index 2267cf6f8f00e..1078e4f2ed3be 100644
--- a/lldb/test/API/commands/trace/TestTraceEvents.py
+++ b/lldb/test/API/commands/trace/TestTraceEvents.py
@@ -52,56 +52,58 @@ def testPauseEvents(self):
       self.expect("thread trace dump instructions -e -f",
         patterns=[f'''thread #1: tid = .*
     0: \(event\) trace synchronization point \[offset \= 0x0xec0\]
+    1: \(event\) hardware disabled tracing
   a.out`main \+ 23 at main.cpp:12
-    1: {ADDRESS_REGEX}    movl .*
-    2: \(event\) software disabled tracing
-    3: {ADDRESS_REGEX}    addl .*
-    4: {ADDRESS_REGEX}    movl .*
-    5: \(event\) software disabled tracing
+    2: {ADDRESS_REGEX}    movl .*
+    3: \(event\) software disabled tracing
+    4: {ADDRESS_REGEX}    addl .*
+    5: {ADDRESS_REGEX}    movl .*
+    6: \(event\) software disabled tracing
   a.out`main \+ 34 \[inlined\] inline_function\(\) at main.cpp:4
-    6: {ADDRESS_REGEX}    movl .*
-  a.out`main \+ 41 \[inlined\] inline_function\(\) \+ 7 at main.cpp:5
     7: {ADDRESS_REGEX}    movl .*
-    8: {ADDRESS_REGEX}    addl .*
-    9: {ADDRESS_REGEX}    movl .*
-  a.out`main \+ 52 \[inlined\] inline_function\(\) \+ 18 at main.cpp:6
+  a.out`main \+ 41 \[inlined\] inline_function\(\) \+ 7 at main.cpp:5
+    8: {ADDRESS_REGEX}    movl .*
+    9: {ADDRESS_REGEX}    addl .*
     10: {ADDRESS_REGEX}    movl .*
-  a.out`main \+ 55 at main.cpp:14
+  a.out`main \+ 52 \[inlined\] inline_function\(\) \+ 18 at main.cpp:6
     11: {ADDRESS_REGEX}    movl .*
-    12: {ADDRESS_REGEX}    addl .*
-    13: {ADDRESS_REGEX}    movl .*
-    14: \(event\) software disabled tracing
+  a.out`main \+ 55 at main.cpp:14
+    12: {ADDRESS_REGEX}    movl .*
+    13: {ADDRESS_REGEX}    addl .*
+    14: {ADDRESS_REGEX}    movl .*
+    15: \(event\) software disabled tracing
   a.out`main \+ 63 at main.cpp:16
-    15: {ADDRESS_REGEX}    callq  .* ; symbol stub for: foo\(\)
-    16: \(event\) software disabled tracing
+    16: {ADDRESS_REGEX}    callq  .* ; symbol stub for: foo\(\)
+    17: \(event\) software disabled tracing
   a.out`symbol stub for: foo\(\)
-    17: {ADDRESS_REGEX}    jmpq'''])
+    18: {ADDRESS_REGEX}    jmpq'''])
 
       # We ensure that the paused events are printed correctly backward
-      self.expect("thread trace dump instructions -e --id 17",
+      self.expect("thread trace dump instructions -e --id 18",
         patterns=[f'''thread #1: tid = .*
   a.out`symbol stub for: foo\(\)
-    17: {ADDRESS_REGEX}    jmpq .*
-    16: \(event\) software disabled tracing
+    18: {ADDRESS_REGEX}    jmpq .*
+    17: \(event\) software disabled tracing
   a.out`main \+ 63 at main.cpp:16
-    15: {ADDRESS_REGEX}    callq  .* ; symbol stub for: foo\(\)
-    14: \(event\) software disabled tracing
+    16: {ADDRESS_REGEX}    callq  .* ; symbol stub for: foo\(\)
+    15: \(event\) software disabled tracing
   a.out`main \+ 60 at main.cpp:14
-    13: {ADDRESS_REGEX}    movl .*
-    12: {ADDRESS_REGEX}    addl .*
-    11: {ADDRESS_REGEX}    movl .*
+    14: {ADDRESS_REGEX}    movl .*
+    13: {ADDRESS_REGEX}    addl .*
+    12: {ADDRESS_REGEX}    movl .*
   a.out`main \+ 52 \[inlined\] inline_function\(\) \+ 18 at main.cpp:6
-    10: {ADDRESS_REGEX}    movl .*
+    11: {ADDRESS_REGEX}    movl .*
   a.out`main \+ 49 \[inlined\] inline_function\(\) \+ 15 at main.cpp:5
-    9: {ADDRESS_REGEX}    movl .*
-    8: {ADDRESS_REGEX}    addl .*
-    7: {ADDRESS_REGEX}    movl .*
+    10: {ADDRESS_REGEX}    movl .*
+    9: {ADDRESS_REGEX}    addl .*
+    8: {ADDRESS_REGEX}    movl .*
   a.out`main \+ 34 \[inlined\] inline_function\(\) at main.cpp:4
-    6: {ADDRESS_REGEX}    movl .*
-    5: \(event\) software disabled tracing
+    7: {ADDRESS_REGEX}    movl .*
+    6: \(event\) software disabled tracing
   a.out`main \+ 31 at main.cpp:12
-    4: {ADDRESS_REGEX}    movl .*
-    3: {ADDRESS_REGEX}    addl .*
-    2: \(event\) software disabled tracing
-    1: {ADDRESS_REGEX}    movl .*
+    5: {ADDRESS_REGEX}    movl .*
+    4: {ADDRESS_REGEX}    addl .*
+    3: \(event\) software disabled tracing
+    2: {ADDRESS_REGEX}    movl .*
+    1: \(event\) hardware disabled tracing
     0: \(event\) trace synchronization point \[offset \= 0x0xec0\]'''])

diff  --git a/lldb/test/API/commands/trace/TestTraceLoad.py b/lldb/test/API/commands/trace/TestTraceLoad.py
index 67a8f56e3f5e6..298be086b2046 100644
--- a/lldb/test/API/commands/trace/TestTraceLoad.py
+++ b/lldb/test/API/commands/trace/TestTraceLoad.py
@@ -184,19 +184,20 @@ def testLoadTrace(self):
 
   Trace technology: intel-pt
 
-  Total number of trace items: 24
+  Total number of trace items: 28
 
   Memory usage:
     Raw trace size: 4 KiB
-    Total approximate memory usage (excluding raw trace): 0.21 KiB
+    Total approximate memory usage (excluding raw trace): 0.25 KiB
     Average memory usage per item (excluding raw trace): 9.00 bytes
 
   Timing for this thread:
     Decoding instructions: ''', '''
 
   Events:
-    Number of individual events: 3
+    Number of individual events: 7
       software disabled tracing: 2
+      hardware disabled tracing: 4
       trace synchronization point: 1'''])
 
     @testSBAPIAndCommands

diff  --git a/lldb/test/API/commands/trace/TestTraceStartStop.py b/lldb/test/API/commands/trace/TestTraceStartStop.py
index 0f81816c58714..a0cc1ec55d77e 100644
--- a/lldb/test/API/commands/trace/TestTraceStartStop.py
+++ b/lldb/test/API/commands/trace/TestTraceStartStop.py
@@ -168,29 +168,29 @@ def testStartStopLiveThreads(self):
         self.expect("thread trace dump instructions -f",
             patterns=[f'''thread #1: tid = .*
   a.out`main \+ 4 at main.cpp:2
-    1: {ADDRESS_REGEX}    movl'''])
+    2: {ADDRESS_REGEX}    movl'''])
 
         # We can reconstruct the instructions up to the second line
         self.expect("n")
         self.expect("thread trace dump instructions -f",
             patterns=[f'''thread #1: tid = .*
   a.out`main \+ 4 at main.cpp:2
-    1: {ADDRESS_REGEX}    movl .*
+    2: {ADDRESS_REGEX}    movl .*
   a.out`main \+ 11 at main.cpp:4
-    3: {ADDRESS_REGEX}    movl .*
-    5: {ADDRESS_REGEX}    jmp  .* ; <\+28> at main.cpp:4
-    7: {ADDRESS_REGEX}    cmpl .*
-    9: {ADDRESS_REGEX}    jle  .* ; <\+20> at main.cpp:5'''])
+    4: {ADDRESS_REGEX}    movl .*
+    6: {ADDRESS_REGEX}    jmp  .* ; <\+28> at main.cpp:4
+    8: {ADDRESS_REGEX}    cmpl .*
+    10: {ADDRESS_REGEX}    jle  .* ; <\+20> at main.cpp:5'''])
 
         self.expect("thread trace dump instructions",
             patterns=[f'''thread #1: tid = .*
   a.out`main \+ 32 at main.cpp:4
-    9: {ADDRESS_REGEX}    jle  .* ; <\+20> at main.cpp:5
-    7: {ADDRESS_REGEX}    cmpl .*
-    5: {ADDRESS_REGEX}    jmp  .* ; <\+28> at main.cpp:4
-    3: {ADDRESS_REGEX}    movl .*
+    10: {ADDRESS_REGEX}    jle  .* ; <\+20> at main.cpp:5
+    8: {ADDRESS_REGEX}    cmpl .*
+    6: {ADDRESS_REGEX}    jmp  .* ; <\+28> at main.cpp:4
+    4: {ADDRESS_REGEX}    movl .*
   a.out`main \+ 4 at main.cpp:2
-    1: {ADDRESS_REGEX}    movl .* '''])
+    2: {ADDRESS_REGEX}    movl .* '''])
 
         # We stop tracing
         self.expect("thread trace stop")
@@ -206,12 +206,12 @@ def testStartStopLiveThreads(self):
         self.expect("thread trace dump instructions -f",
             patterns=[f'''thread #1: tid = .*
   a.out`main \+ 20 at main.cpp:5
-    1: {ADDRESS_REGEX}    xorl'''])
+    2: {ADDRESS_REGEX}    xorl'''])
 
         self.expect("thread trace dump instructions",
             patterns=[f'''thread #1: tid = .*
   a.out`main \+ 20 at main.cpp:5
-    1: {ADDRESS_REGEX}    xorl'''])
+    2: {ADDRESS_REGEX}    xorl'''])
 
         self.expect("c")
         # Now the process has finished, so the commands should fail


        


More information about the lldb-commits mailing list