LLDB  mainline
IntelPTPerThreadProcessTrace.h
Go to the documentation of this file.
1 //===-- IntelPTPerThreadProcessTrace.h ------------------------ -*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef liblldb_IntelPTPerThreadProcessTrace_H_
10 #define liblldb_IntelPTPerThreadProcessTrace_H_
11 
12 #include "IntelPTProcessTrace.h"
15 
16 namespace lldb_private {
17 namespace process_linux {
18 
19 /// Manages a "process trace" instance by tracing each thread individually.
21 public:
22  /// Start tracing the current process by tracing each of its tids
23  /// individually.
24  ///
25  /// \param[in] request
26  /// Intel PT configuration parameters.
27  ///
28  /// \param[in] current_tids
29  /// List of tids currently alive. In the future, whenever a new thread is
30  /// spawned, they should be traced by calling the \a TraceStart(tid) method.
31  ///
32  /// \return
33  /// An \a IntelPTMultiCoreTrace instance if tracing was successful, or
34  /// an \a llvm::Error otherwise.
35  static llvm::Expected<std::unique_ptr<IntelPTPerThreadProcessTrace>>
36  Start(const TraceIntelPTStartRequest &request,
37  llvm::ArrayRef<lldb::tid_t> current_tids);
38 
39  bool TracesThread(lldb::tid_t tid) const override;
40 
41  llvm::Error TraceStart(lldb::tid_t tid) override;
42 
43  llvm::Error TraceStop(lldb::tid_t tid) override;
44 
46 
47  llvm::Expected<llvm::Optional<std::vector<uint8_t>>>
48  TryGetBinaryData(const TraceGetBinaryDataRequest &request) override;
49 
50 private:
52  : m_tracing_params(request) {}
53 
55  /// Params used to trace threads when the user started "process tracing".
57 };
58 
59 } // namespace process_linux
60 } // namespace lldb_private
61 
62 #endif // liblldb_IntelPTPerThreadProcessTrace_H_
lldb_private::process_linux::IntelPTPerThreadProcessTrace::m_tracing_params
TraceIntelPTStartRequest m_tracing_params
Params used to trace threads when the user started "process tracing".
Definition: IntelPTPerThreadProcessTrace.h:56
lldb_private::TraceGetBinaryDataRequest
jLLDBTraceGetBinaryData gdb-remote packet
Definition: TraceGDBRemotePackets.h:149
lldb_private::process_linux::IntelPTPerThreadProcessTrace::GetState
TraceIntelPTGetStateResponse GetState() override
Construct a minimal jLLDBTraceGetState response for this process trace.
Definition: IntelPTPerThreadProcessTrace.cpp:37
lldb_private::process_linux::IntelPTPerThreadProcessTrace::TryGetBinaryData
llvm::Expected< llvm::Optional< std::vector< uint8_t > > > TryGetBinaryData(const TraceGetBinaryDataRequest &request) override
Definition: IntelPTPerThreadProcessTrace.cpp:49
lldb_private::TraceIntelPTGetStateResponse
Definition: TraceIntelPTGDBRemotePackets.h:111
IntelPTThreadTraceCollection.h
lldb_private::process_linux::IntelPTThreadTraceCollection
Manages a list of thread traces.
Definition: IntelPTThreadTraceCollection.h:18
lldb_private::process_linux::IntelPTProcessTrace
Interface to be implemented by each 'process trace' strategy (per cpu, per thread,...
Definition: IntelPTProcessTrace.h:21
lldb_private::process_linux::IntelPTPerThreadProcessTrace::m_thread_traces
IntelPTThreadTraceCollection m_thread_traces
Definition: IntelPTPerThreadProcessTrace.h:54
lldb_private::process_linux::IntelPTPerThreadProcessTrace::TracesThread
bool TracesThread(lldb::tid_t tid) const override
Definition: IntelPTPerThreadProcessTrace.cpp:16
lldb_private::process_linux::IntelPTPerThreadProcessTrace::Start
static llvm::Expected< std::unique_ptr< IntelPTPerThreadProcessTrace > > Start(const TraceIntelPTStartRequest &request, llvm::ArrayRef< lldb::tid_t > current_tids)
Start tracing the current process by tracing each of its tids individually.
Definition: IntelPTPerThreadProcessTrace.cpp:55
lldb_private::TraceIntelPTStartRequest
jLLDBTraceStart gdb-remote packet
Definition: TraceIntelPTGDBRemotePackets.h:33
lldb_private::process_linux::IntelPTPerThreadProcessTrace::TraceStop
llvm::Error TraceStop(lldb::tid_t tid) override
Stop tracing the thread given by its tid.
Definition: IntelPTPerThreadProcessTrace.cpp:20
lldb_private::process_linux::IntelPTPerThreadProcessTrace::IntelPTPerThreadProcessTrace
IntelPTPerThreadProcessTrace(const TraceIntelPTStartRequest &request)
Definition: IntelPTPerThreadProcessTrace.h:51
lldb_private::process_linux::IntelPTPerThreadProcessTrace
Manages a "process trace" instance by tracing each thread individually.
Definition: IntelPTPerThreadProcessTrace.h:20
IntelPTProcessTrace.h
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
Error
llvm::Error Error
Definition: UdtRecordCompleter.cpp:30
IntelPTSingleBufferTrace.h
lldb_private::process_linux::IntelPTPerThreadProcessTrace::TraceStart
llvm::Error TraceStart(lldb::tid_t tid) override
Start tracing the thread given by its tid.
Definition: IntelPTPerThreadProcessTrace.cpp:24
lldb::tid_t
uint64_t tid_t
Definition: lldb-types.h:86