[Lldb-commits] [lldb] c9885f7 - [trace][intel pt][simple] Fix TestTraceSave

Walter Erquinigo via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 21 11:01:03 PDT 2022


Author: Walter Erquinigo
Date: 2022-10-21T11:00:55-07:00
New Revision: c9885f74f45510d287ceca034c761f1787a201d9

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

LOG: [trace][intel pt][simple] Fix TestTraceSave

That test was failing due to a wrong else statement. Now it passes.

Added: 
    

Modified: 
    lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
index 1db34d8fe840d..a732d4df51b83 100644
--- a/lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
+++ b/lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
@@ -89,7 +89,7 @@ TraceIntelPTSP TraceIntelPT::CreateInstanceForPostmortemTrace(
   trace_sp->m_storage.tsc_conversion =
       bundle_description.tsc_perf_zero_conversion;
 
-  if (bundle_description.cpus && trace_mode == TraceMode::UserMode) {
+  if (bundle_description.cpus) {
     std::vector<cpu_id_t> cpus;
 
     for (const JSONCpu &cpu : *bundle_description.cpus) {
@@ -102,8 +102,12 @@ TraceIntelPTSP TraceIntelPT::CreateInstanceForPostmortemTrace(
       cpus.push_back(cpu.id);
     }
 
-    trace_sp->m_storage.multicpu_decoder.emplace(trace_sp);
-  } else {
+    if (trace_mode == TraceMode::UserMode) {
+      trace_sp->m_storage.multicpu_decoder.emplace(trace_sp);
+    }
+  }
+
+  if (!bundle_description.cpus || trace_mode == TraceMode::KernelMode) {
     for (const ThreadPostMortemTraceSP &thread : traced_threads) {
       trace_sp->m_storage.thread_decoders.try_emplace(
           thread->GetID(), std::make_unique<ThreadDecoder>(thread, *trace_sp));


        


More information about the lldb-commits mailing list