LLDB  mainline
Public Member Functions | Private Member Functions | List of all members
lldb_private::trace_intel_pt::TraceIntelPTSessionSaver Class Reference

#include <TraceIntelPTSessionSaver.h>

Public Member Functions

llvm::Error SaveToDisk (TraceIntelPT &trace_ipt, FileSpec directory)
 Save the Intel PT trace of a live process to the specified directory, which will be created if needed. More...
 

Private Member Functions

llvm::Expected< JSONTraceIntelPTTraceBuildTraceSection (TraceIntelPT &trace_ipt)
 Build trace section of the intel-pt trace session description file. More...
 

Detailed Description

Definition at line 21 of file TraceIntelPTSessionSaver.h.

Member Function Documentation

◆ BuildTraceSection()

llvm::Expected< JSONTraceIntelPTTrace > TraceIntelPTSessionSaver::BuildTraceSection ( TraceIntelPT trace_ipt)
private

Build trace section of the intel-pt trace session description file.

Parameters
[in]trace_iptThe Intel PT trace.
Returns
The trace section an llvm::Error in case of failures.

Definition at line 72 of file TraceIntelPTSessionSaver.cpp.

References lldb_private::trace_intel_pt::TraceIntelPT::GetCPUInfo().

◆ SaveToDisk()

llvm::Error TraceIntelPTSessionSaver::SaveToDisk ( TraceIntelPT trace_ipt,
FileSpec  directory 
)

Save the Intel PT trace of a live process to the specified directory, which will be created if needed.

This will also create a file <directory>/trace.json with the main properties of the trace session, along with others files which contain the actual trace data. The trace.json file can be used later as input for the "trace load" command to load the trace in LLDB.

Parameters
[in]trace_iptThe Intel PT trace to be saved to disk.
[in]directoryThe directory where the trace files will be saved.
Returns
llvm::success if the operation was successful, or an llvm::Error otherwise.

Definition at line 34 of file TraceIntelPTSessionSaver.cpp.

References lldb_private::trace_intel_pt::TraceIntelPT::GetLiveProcess(), lldb_private::trace_intel_pt::TraceIntelPT::GetLiveThreadBuffer(), lldb_private::FileSpec::GetPath(), lldb_private::trace_intel_pt::TraceIntelPT::IsTraced(), and llvm::json::toJSON().

Referenced by lldb_private::trace_intel_pt::TraceIntelPT::SaveLiveTraceToDisk().


The documentation for this class was generated from the following files: