LLDB mainline
IntelPTProcessTrace.h
Go to the documentation of this file.
1//===-- IntelPTProcessTrace.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_IntelPTProcessTrace_H_
10#define liblldb_IntelPTProcessTrace_H_
11
13#include <memory>
14#include <optional>
15
16namespace lldb_private {
17namespace process_linux {
18
19/// Interface to be implemented by each 'process trace' strategy (per cpu, per
20/// thread, etc).
22public:
23 virtual ~IntelPTProcessTrace() = default;
24
25 virtual void ProcessDidStop() {}
26
27 virtual void ProcessWillResume() {}
28
29 /// Construct a minimal jLLDBTraceGetState response for this process trace.
31
32 virtual bool TracesThread(lldb::tid_t tid) const = 0;
33
34 /// \copydoc IntelPTThreadTraceCollection::TraceStart()
35 virtual llvm::Error TraceStart(lldb::tid_t tid) = 0;
36
37 /// \copydoc IntelPTThreadTraceCollection::TraceStop()
38 virtual llvm::Error TraceStop(lldb::tid_t tid) = 0;
39
40 /// \return
41 /// \b std::nullopt if this instance doesn't support the requested data, an
42 /// \a llvm::Error if this isntance supports it but fails at fetching it,
43 /// and \b Error::success() otherwise.
44 virtual llvm::Expected<std::optional<std::vector<uint8_t>>>
46};
47
48using IntelPTProcessTraceUP = std::unique_ptr<IntelPTProcessTrace>;
49
50} // namespace process_linux
51} // namespace lldb_private
52
53#endif // liblldb_IntelPTProcessTrace_H_
Interface to be implemented by each 'process trace' strategy (per cpu, per thread,...
virtual TraceIntelPTGetStateResponse GetState()=0
Construct a minimal jLLDBTraceGetState response for this process trace.
virtual llvm::Error TraceStart(lldb::tid_t tid)=0
Start tracing the thread given by its tid.
virtual llvm::Expected< std::optional< std::vector< uint8_t > > > TryGetBinaryData(const TraceGetBinaryDataRequest &request)=0
virtual bool TracesThread(lldb::tid_t tid) const =0
virtual llvm::Error TraceStop(lldb::tid_t tid)=0
Stop tracing the thread given by its tid.
std::unique_ptr< IntelPTProcessTrace > IntelPTProcessTraceUP
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
uint64_t tid_t
Definition: lldb-types.h:84
jLLDBTraceGetBinaryData gdb-remote packet