jj10306 created this revision.
jj10306 added reviewers: wallace, persona0220.
Herald added a project: All.
jj10306 requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
Update the Python tests (ie tests run via `lldb-dotest -p TestTrace`) to
handle new error introduced in D136610 <https://reviews.llvm.org/D136610>.
Test Plan:
`lldb-dotest -p TestTrace`
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D136801
Files:
lldb/test/API/commands/trace/TestTraceDumpFunctionCalls.py
lldb/test/API/commands/trace/TestTraceLoad.py
Index: lldb/test/API/commands/trace/TestTraceLoad.py
===================================================================
--- lldb/test/API/commands/trace/TestTraceLoad.py
+++ lldb/test/API/commands/trace/TestTraceLoad.py
@@ -13,11 +13,11 @@
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 @@
"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 @@
# 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 @@
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 @@
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 @@
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)
Index: lldb/test/API/commands/trace/TestTraceDumpFunctionCalls.py
===================================================================
--- lldb/test/API/commands/trace/TestTraceDumpFunctionCalls.py
+++ lldb/test/API/commands/trace/TestTraceDumpFunctionCalls.py
@@ -44,7 +44,7 @@
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 @@
{
"tracedSegments": [
{
- "firstInstructionId": "19532",
- "lastInstructionId": "19532"
+ "firstInstructionId": "19526",
+ "lastInstructionId": "19526"
}
]
}
@@ -73,7 +73,7 @@
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 @@
{
"tracedSegments": [
{
- "firstInstructionId": "61834",
- "lastInstructionId": "61834"
+ "firstInstructionId": "61833",
+ "lastInstructionId": "61833"
}
]
}
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits