|
|
|||
File indexing completed on 2026-05-10 08:42:43
0001 //===-- SBTrace.h -----------------------------------------------*- C++ -*-===// 0002 // 0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 0004 // See https://llvm.org/LICENSE.txt for license information. 0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 0006 // 0007 //===----------------------------------------------------------------------===// 0008 0009 #ifndef LLDB_API_SBTRACE_H 0010 #define LLDB_API_SBTRACE_H 0011 0012 #include "lldb/API/SBDefines.h" 0013 #include "lldb/API/SBError.h" 0014 #include "lldb/API/SBTraceCursor.h" 0015 0016 namespace lldb { 0017 0018 class LLDB_API SBTrace { 0019 public: 0020 /// Default constructor for an invalid Trace object. 0021 SBTrace(); 0022 0023 /// See SBDebugger::LoadTraceFromFile. 0024 static SBTrace LoadTraceFromFile(SBError &error, SBDebugger &debugger, 0025 const SBFileSpec &trace_description_file); 0026 0027 /// Get a \a TraceCursor for the given thread's trace. 0028 /// 0029 /// \param[out] error 0030 /// This will be set with an error in case of failures. 0031 // 0032 /// \param[in] thread 0033 /// The thread to get a \a TraceCursor for. 0034 // 0035 /// \return 0036 /// A \a SBTraceCursor. If the thread is not traced or its trace 0037 /// information failed to load, an invalid \a SBTraceCursor is returned 0038 /// and the \p error parameter is set. 0039 SBTraceCursor CreateNewCursor(SBError &error, SBThread &thread); 0040 0041 /// Save the trace to the specified directory, which will be created if 0042 /// needed. This will also create a file \a <directory>/trace.json with the 0043 /// main properties of the trace session, along with others files which 0044 /// contain the actual trace data. The trace.json file can be used later as 0045 /// input for the "trace load" command to load the trace in LLDB, or for the 0046 /// method \a SBDebugger.LoadTraceFromFile(). 0047 /// 0048 /// \param[out] error 0049 /// This will be set with an error in case of failures. 0050 /// 0051 /// \param[in] bundle_dir 0052 /// The directory where the trace files will be saved. 0053 /// 0054 /// \param[in] compact 0055 /// Try not to save to disk information irrelevant to the traced processes. 0056 /// Each trace plug-in implements this in a different fashion. 0057 /// 0058 /// \return 0059 /// A \a SBFileSpec pointing to the bundle description file. 0060 SBFileSpec SaveToDisk(SBError &error, const SBFileSpec &bundle_dir, 0061 bool compact = false); 0062 0063 /// \return 0064 /// A description of the parameters to use for the \a SBTrace::Start 0065 /// method, or \b null if the object is invalid. 0066 const char *GetStartConfigurationHelp(); 0067 0068 /// Start tracing all current and future threads in a live process using a 0069 /// provided configuration. This is referred as "process tracing" in the 0070 /// documentation. 0071 /// 0072 /// This is equivalent to the command "process trace start". 0073 /// 0074 /// This operation fails if it is invoked twice in a row without 0075 /// first stopping the process trace with \a SBTrace::Stop(). 0076 /// 0077 /// If a thread is already being traced explicitly, e.g. with \a 0078 /// SBTrace::Start(const SBThread &thread, const SBStructuredData 0079 /// &configuration), it is left unaffected by this operation. 0080 /// 0081 /// \param[in] configuration 0082 /// Dictionary object with custom fields for the corresponding trace 0083 /// technology. 0084 /// 0085 /// Full details for the trace start parameters that can be set can be 0086 /// retrieved by calling \a SBTrace::GetStartConfigurationHelp(). 0087 /// 0088 /// \return 0089 /// An error explaining any failures. 0090 SBError Start(const SBStructuredData &configuration); 0091 0092 /// Start tracing a specific thread in a live process using a provided 0093 /// configuration. This is referred as "thread tracing" in the documentation. 0094 /// 0095 /// This is equivalent to the command "thread trace start". 0096 /// 0097 /// If the thread is already being traced by a "process tracing" operation, 0098 /// e.g. with \a SBTrace::Start(const SBStructuredData &configuration), this 0099 /// operation fails. 0100 /// 0101 /// \param[in] configuration 0102 /// Dictionary object with custom fields for the corresponding trace 0103 /// technology. 0104 /// 0105 /// Full details for the trace start parameters that can be set can be 0106 /// retrieved by calling \a SBTrace::GetStartConfigurationHelp(). 0107 /// 0108 /// \return 0109 /// An error explaining any failures. 0110 SBError Start(const SBThread &thread, const SBStructuredData &configuration); 0111 0112 /// Stop tracing all threads in a live process. 0113 /// 0114 /// If a "process tracing" operation is active, e.g. \a SBTrace::Start(const 0115 /// SBStructuredData &configuration), this effectively prevents future threads 0116 /// from being traced. 0117 /// 0118 /// This is equivalent to the command "process trace stop". 0119 /// 0120 /// \return 0121 /// An error explaining any failures. 0122 SBError Stop(); 0123 0124 /// Stop tracing a specific thread in a live process regardless of whether the 0125 /// thread was traced explicitly or as part of a "process tracing" operation. 0126 /// 0127 /// This is equivalent to the command "thread trace stop". 0128 /// 0129 /// \return 0130 /// An error explaining any failures. 0131 SBError Stop(const SBThread &thread); 0132 0133 explicit operator bool() const; 0134 0135 bool IsValid(); 0136 0137 protected: 0138 friend class SBTarget; 0139 0140 SBTrace(const lldb::TraceSP &trace_sp); 0141 0142 lldb::TraceSP m_opaque_sp; 0143 /// deprecated 0144 lldb::ProcessWP m_opaque_wp; 0145 }; 0146 } // namespace lldb 0147 0148 #endif // LLDB_API_SBTRACE_H
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|