1 //===-- TraceIntelPTGDBRemotePackets.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 LLDB_UTILITY_TRACEINTELPTGDBREMOTEPACKETS_H
10 #define LLDB_UTILITY_TRACEINTELPTGDBREMOTEPACKETS_H
11 
12 #include "lldb/Utility/TraceGDBRemotePackets.h"
13 
14 /// See docs/lldb-gdb-remote.txt for more information.
15 namespace lldb_private {
16 
17 /// jLLDBTraceStart gdb-remote packet
18 /// \{
19 struct TraceIntelPTStartRequest : TraceStartRequest {
20   /// Size in bytes to use for each thread's trace buffer.
21   int64_t threadBufferSize;
22 
23   /// Whether to enable TSC
24   bool enableTsc;
25 
26   /// PSB packet period
27   llvm::Optional<int64_t> psbPeriod;
28 
29   /// Required when doing "process tracing".
30   ///
31   /// Limit in bytes on all the thread traces started by this "process trace"
32   /// instance. When a thread is about to be traced and the limit would be hit,
33   /// then a "tracing" stop event is triggered.
34   llvm::Optional<int64_t> processBufferSizeLimit;
35 };
36 
37 bool fromJSON(const llvm::json::Value &value, TraceIntelPTStartRequest &packet,
38               llvm::json::Path path);
39 
40 llvm::json::Value toJSON(const TraceIntelPTStartRequest &packet);
41 /// \}
42 
43 } // namespace lldb_private
44 
45 #endif // LLDB_UTILITY_TRACEINTELPTGDBREMOTEPACKETS_H
46