[Lldb-commits] [PATCH] D126990: [trace][intelpt] Support system-wide tracing [15] - Make triple optional

Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 16 11:23:25 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGef9970759b5b: [trace][intelpt] Support system-wide tracing [15] - Make triple optional (authored by Walter Erquinigo <wallace at fb.com>).
Herald added a subscriber: Michael137.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126990

Files:
  lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.h
  lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSessionFileParser.cpp
  lldb/test/API/commands/trace/TestTraceLoad.py
  lldb/test/API/commands/trace/intelpt-multi-core-trace/trace.json
  lldb/test/API/commands/trace/intelpt-trace/trace_bad2.json


Index: lldb/test/API/commands/trace/intelpt-trace/trace_bad2.json
===================================================================
--- lldb/test/API/commands/trace/intelpt-trace/trace_bad2.json
+++ lldb/test/API/commands/trace/intelpt-trace/trace_bad2.json
@@ -2,14 +2,13 @@
   "type": "intel-pt",
   "cpuInfo": {
     "vendor": "GenuineIntel",
-    "family": 6,
+    "family": "123",
     "model": 79,
     "stepping": 1
   },
   "processes": [
     {
       "pid": 1234,
-      "triple": "x86_64-*-linux",
       "threads": [
         {
           "tid": 5678,
Index: lldb/test/API/commands/trace/intelpt-multi-core-trace/trace.json
===================================================================
--- lldb/test/API/commands/trace/intelpt-multi-core-trace/trace.json
+++ lldb/test/API/commands/trace/intelpt-multi-core-trace/trace.json
@@ -38,8 +38,7 @@
         {
           "tid": 3497497
         }
-      ],
-      "triple": "x86_64-unknown-linux-gnu"
+      ]
     }
   ],
   "tscPerfZeroConversion": {
Index: lldb/test/API/commands/trace/TestTraceLoad.py
===================================================================
--- lldb/test/API/commands/trace/TestTraceLoad.py
+++ lldb/test/API/commands/trace/TestTraceLoad.py
@@ -94,9 +94,9 @@
     "stepping": integer
   },'''])
 
-        # Now we test a missing field in the global session file
+        # Now we test a wrong cpu family field in the global session file
         self.expect("trace load -v " + os.path.join(src_dir, "intelpt-trace", "trace_bad2.json"), error=True,
-            substrs=['error: missing value at traceSession.processes[1].triple', "Context", "Schema"])
+            substrs=['error: expected uint64_t at traceSession.cpuInfo.family', "Context", "Schema"])
 
         # Now we test a missing field in the intel-pt settings
         self.expect("trace load -v " + os.path.join(src_dir, "intelpt-trace", "trace_bad4.json"), error=True,
Index: lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSessionFileParser.cpp
===================================================================
--- lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSessionFileParser.cpp
+++ lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSessionFileParser.cpp
@@ -88,7 +88,7 @@
 TraceIntelPTSessionFileParser::ParseProcess(const JSONProcess &process) {
   TargetSP target_sp;
   Status error = m_debugger.GetTargetList().CreateTarget(
-      m_debugger, /*user_exe_path*/ StringRef(), process.triple,
+      m_debugger, /*user_exe_path*/ StringRef(), process.triple.getValueOr(""),
       eLoadDependentsNo,
       /*platform_options*/ nullptr, target_sp);
 
@@ -161,8 +161,8 @@
   "processes": [
     {
       "pid": integer,
-      "triple": string,
-          // clang/llvm target triple.
+      "triple"?: string,
+          // Optional clang/llvm target triple.
       "threads": [
         {
           "tid": integer,
Index: lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.h
===================================================================
--- lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.h
+++ lldb/source/Plugins/Trace/intel-pt/TraceIntelPTJSONStructs.h
@@ -36,7 +36,7 @@
 
 struct JSONProcess {
   int64_t pid;
-  std::string triple;
+  llvm::Optional<std::string> triple;
   std::vector<JSONThread> threads;
   std::vector<JSONModule> modules;
 };


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126990.437622.patch
Type: text/x-patch
Size: 3346 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220616/732d2e9f/attachment.bin>


More information about the lldb-commits mailing list