[Lldb-commits] [lldb] 17c65e5 - [intelpt] Update Python tests to account for new errrors
Jakob Johnson via lldb-commits
lldb-commits at lists.llvm.org
Thu Oct 27 05:09:23 PDT 2022
Author: Jakob Johnson
Date: 2022-10-27T05:09:08-07:00
New Revision: 17c65e51b91620181662302e9abd7e9694154c5d
URL: https://github.com/llvm/llvm-project/commit/17c65e51b91620181662302e9abd7e9694154c5d
DIFF: https://github.com/llvm/llvm-project/commit/17c65e51b91620181662302e9abd7e9694154c5d.diff
LOG: [intelpt] Update Python tests to account for new errrors
Update the Python tests (ie tests run via `lldb-dotest -p TestTrace`) to
handle new error introduced in D136610.
Test Plan:
`lldb-dotest -p TestTrace`
Differential Revision: https://reviews.llvm.org/D136801
Added:
Modified:
lldb/test/API/commands/trace/TestTraceDumpFunctionCalls.py
lldb/test/API/commands/trace/TestTraceLoad.py
Removed:
################################################################################
diff --git a/lldb/test/API/commands/trace/TestTraceDumpFunctionCalls.py b/lldb/test/API/commands/trace/TestTraceDumpFunctionCalls.py
index 0a8b4f4d2a3dd..a022dd3b31522 100644
--- a/lldb/test/API/commands/trace/TestTraceDumpFunctionCalls.py
+++ b/lldb/test/API/commands/trace/TestTraceDumpFunctionCalls.py
@@ -44,7 +44,7 @@ def testFunctionCallsWithErrors(self):
m.out`foo() + 65 at multi_thread.cpp:12:21 to 12:21 [4, 19524]
[call tree #1]
-<tracing errors> [19532, 19532]'''])
+<tracing errors> [19526, 19526]'''])
self.expect("thread trace dump function-calls 2 -J",
substrs=['''[
@@ -59,8 +59,8 @@ def testFunctionCallsWithErrors(self):
{
"tracedSegments": [
{
- "firstInstructionId": "19532",
- "lastInstructionId": "19532"
+ "firstInstructionId": "19526",
+ "lastInstructionId": "19526"
}
]
}
@@ -73,7 +73,7 @@ def testFunctionCallsWithErrors(self):
m.out`bar() + 30 at multi_thread.cpp:19:3 to 20:6 [5, 61831]
[call tree #1]
-<tracing errors> [61834, 61834]'''])
+<tracing errors> [61833, 61833]'''])
self.expect("thread trace dump function-calls 3 -J",
substrs=['''[
@@ -88,8 +88,8 @@ def testFunctionCallsWithErrors(self):
{
"tracedSegments": [
{
- "firstInstructionId": "61834",
- "lastInstructionId": "61834"
+ "firstInstructionId": "61833",
+ "lastInstructionId": "61833"
}
]
}
diff --git a/lldb/test/API/commands/trace/TestTraceLoad.py b/lldb/test/API/commands/trace/TestTraceLoad.py
index 298be086b2046..09d7e0b7aabe5 100644
--- a/lldb/test/API/commands/trace/TestTraceLoad.py
+++ b/lldb/test/API/commands/trace/TestTraceLoad.py
@@ -13,11 +13,11 @@ def testLoadMultiCoreTrace(self):
trace_description_file_path = os.path.join(src_dir, "intelpt-multi-core-trace", "trace.json")
self.traceLoad(traceDescriptionFilePath=trace_description_file_path, substrs=["intel-pt"])
self.expect("thread trace dump instructions 2 -t",
- substrs=["19532: [20456513.000 ns] (error) expected tracing enabled event",
+ substrs=["19526: [19691636.212 ns] (error) decoding truncated: TSC 40450075478109270 exceeds maximum TSC value 40450075477704372, will skip decoding the remaining data of the PSB (skipping 774 of 825 bytes)",
"m.out`foo() + 65 at multi_thread.cpp:12:21",
- "9524: [19691630.226 ns] 0x0000000000400ba7 jg 0x400bb3"])
+ "9524: [19691632.221 ns] 0x0000000000400ba7 jg 0x400bb3"])
self.expect("thread trace dump instructions 3 -t",
- substrs=["61831: [19736134.073 ns] 0x0000000000400bd7 addl $0x1, -0x4(%rbp)",
+ substrs=["61831: [19736132.088 ns] 0x0000000000400bd7 addl $0x1, -0x4(%rbp)",
"m.out`bar() + 26 at multi_thread.cpp:20:6"])
self.expect("thread trace dump info --json",
@@ -62,20 +62,20 @@ def testLoadMultiCoreTrace(self):
"traceTechnology": "intel-pt",
"threadStats": {
"tid": 3497496,
- "traceItemsCount": 19533,
+ "traceItemsCount": 19527,
"memoryUsage": {
- "totalInBytes": "176065",
- "avgPerItemInBytes": 9.''', '''},
+ "totalInBytes": "175819",
+ "avgPerItemInBytes": 9.0038920469094084''', '''},
"timingInSeconds": {
"Decoding instructions": ''', '''
},
"events": {
- "totalCount": 11,
+ "totalCount": 5,
"individualCounts": {
"software disabled tracing": 1,
"trace synchronization point": 1,
"CPU core changed": 1,
- "HW clock tick": 8
+ "HW clock tick": 2
}
},
"errors": {
@@ -116,11 +116,12 @@ def testLoadCompactMultiCoreTrace(self):
# we'll load the compact trace and make sure it works
self.traceLoad(os.path.join(compact_trace_bundle_dir, "trace.json"), substrs=["intel-pt"])
self.expect("thread trace dump instructions 2 -t",
- substrs=["19532: [20456513.000 ns] (error) expected tracing enabled event",
+ substrs=["19526: [19691636.212 ns] (error) decoding truncated: TSC 40450075478109270 exceeds maximum TSC value 40450075477704372, will skip decoding the remaining data of the PSB (skipping 774 of 825 bytes)",
"m.out`foo() + 65 at multi_thread.cpp:12:21",
- "19524: [19691630.226 ns] 0x0000000000400ba7 jg 0x400bb3"])
+ "19524: [19691632.221 ns] 0x0000000000400ba7 jg 0x400bb3"])
self.expect("thread trace dump instructions 3 -t",
- substrs=["61831: [19736134.073 ns] 0x0000000000400bd7 addl $0x1, -0x4(%rbp)",
+ substrs=["61833: [19736136.079 ns] (error) decoding truncated: TSC 40450075478174268 exceeds maximum TSC value 40450075477820383, will skip decoding the remaining data of the PSB (skipping 296 of 297 bytes)",
+ "61831: [19736132.088 ns] 0x0000000000400bd7 addl $0x1, -0x4(%rbp)",
"m.out`bar() + 26 at multi_thread.cpp:20:6"])
# This reduced the number of continuous executions to look at
@@ -135,11 +136,11 @@ def testLoadMultiCoreTraceWithStringNumbers(self):
trace_description_file_path = os.path.join(src_dir, "intelpt-multi-core-trace", "trace_with_string_numbers.json")
self.traceLoad(traceDescriptionFilePath=trace_description_file_path, substrs=["intel-pt"])
self.expect("thread trace dump instructions 2 -t",
- substrs=["19532: [20456513.000 ns] (error) expected tracing enabled event",
+ substrs=["19526: [19691636.212 ns] (error) decoding truncated: TSC 40450075478109270 exceeds maximum TSC value 40450075477704372, will skip decoding the remaining data of the PSB (skipping 774 of 825 bytes)",
"m.out`foo() + 65 at multi_thread.cpp:12:21",
- "19524: [19691630.226 ns] 0x0000000000400ba7 jg 0x400bb3"])
+ "19524: [19691632.221 ns] 0x0000000000400ba7 jg 0x400bb3"])
self.expect("thread trace dump instructions 3 -t",
- substrs=["61831: [19736134.073 ns] 0x0000000000400bd7 addl $0x1, -0x4(%rbp)",
+ substrs=["61831: [19736132.088 ns] 0x0000000000400bd7 addl $0x1, -0x4(%rbp)",
"m.out`bar() + 26 at multi_thread.cpp:20:6"])
@testSBAPIAndCommands
@@ -148,11 +149,11 @@ def testLoadMultiCoreTraceWithMissingThreads(self):
trace_description_file_path = os.path.join(src_dir, "intelpt-multi-core-trace", "trace_missing_threads.json")
self.traceLoad(traceDescriptionFilePath=trace_description_file_path, substrs=["intel-pt"])
self.expect("thread trace dump instructions 3 -t",
- substrs=["19532: [20456513.000 ns] (error) expected tracing enabled event",
+ substrs=["19526: [19691636.212 ns] (error) decoding truncated: TSC 40450075478109270 exceeds maximum TSC value 40450075477704372, will skip decoding the remaining data of the PSB (skipping 774 of 825 bytes)",
"m.out`foo() + 65 at multi_thread.cpp:12:21",
- "19524: [19691630.226 ns] 0x0000000000400ba7 jg 0x400bb3"])
+ "19524: [19691632.221 ns] 0x0000000000400ba7 jg 0x400bb3"])
self.expect("thread trace dump instructions 2 -t",
- substrs=["61831: [19736134.073 ns] 0x0000000000400bd7 addl $0x1, -0x4(%rbp)",
+ substrs=["61831: [19736132.088 ns] 0x0000000000400bd7 addl $0x1, -0x4(%rbp)",
"m.out`bar() + 26 at multi_thread.cpp:20:6"])
@testSBAPIAndCommands
@@ -300,10 +301,10 @@ def testLoadTraceCursor(self):
self.assertEqual(cursor.GetEventTypeAsString(), "CPU core changed")
self.assertEqual(cursor.GetCPU(), 51)
- cursor.GoToId(19532)
+ cursor.GoToId(19526)
self.assertTrue(cursor.IsError())
- self.assertEqual(cursor.GetError(), "expected tracing enabled event")
+ self.assertEqual(cursor.GetError(), "decoding truncated: TSC 40450075478109270 exceeds maximum TSC value 40450075477704372, will skip decoding the remaining data of the PSB (skipping 774 of 825 bytes)")
cursor.GoToId(19524)
More information about the lldb-commits
mailing list