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
14#include <memory>
15#include <optional>
16
17namespace lldb_private {
18namespace process_linux {
19
20/// Interface to be implemented by each 'process trace' strategy (per cpu, per
21/// thread, etc).
23public:
24 virtual ~IntelPTProcessTrace() = default;
25
26 virtual void ProcessDidStop() {}
27
28 virtual void ProcessWillResume() {}
29
30 /// Construct a minimal jLLDBTraceGetState response for this process trace.
32
33 virtual bool TracesThread(lldb::tid_t tid) const = 0;
34
35 /// \copydoc IntelPTThreadTraceCollection::TraceStart()
36 virtual llvm::Error TraceStart(lldb::tid_t tid) = 0;
37
38 /// \copydoc IntelPTThreadTraceCollection::TraceStop()
39 virtual llvm::Error TraceStop(lldb::tid_t tid) = 0;
40
41 /// \return
42 /// \b std::nullopt if this instance doesn't support the requested data, an
43 /// \a llvm::Error if this isntance supports it but fails at fetching it,
44 /// and \b Error::success() otherwise.
45 virtual llvm::Expected<std::optional<std::vector<uint8_t>>>
47};
48
49using IntelPTProcessTraceUP = std::unique_ptr<IntelPTProcessTrace>;
50
51} // namespace process_linux
52} // namespace lldb_private
53
54#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.
uint64_t tid_t
Definition lldb-types.h:85
jLLDBTraceGetBinaryData gdb-remote packet