TraceOptions.h revision 360660
1//===-- TraceOptions.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_TraceOptions_h_ 10#define liblldb_TraceOptions_h_ 11 12#include "lldb/lldb-defines.h" 13#include "lldb/lldb-enumerations.h" 14 15#include "lldb/Utility/StructuredData.h" 16 17namespace lldb_private { 18class TraceOptions { 19public: 20 TraceOptions() : m_trace_params(new StructuredData::Dictionary()) {} 21 22 const StructuredData::DictionarySP &getTraceParams() const { 23 return m_trace_params; 24 } 25 26 lldb::TraceType getType() const { return m_type; } 27 28 uint64_t getTraceBufferSize() const { return m_trace_buffer_size; } 29 30 uint64_t getMetaDataBufferSize() const { return m_meta_data_buffer_size; } 31 32 void setTraceParams(const StructuredData::DictionarySP &dict_obj) { 33 m_trace_params = dict_obj; 34 } 35 36 void setType(lldb::TraceType type) { m_type = type; } 37 38 void setTraceBufferSize(uint64_t size) { m_trace_buffer_size = size; } 39 40 void setMetaDataBufferSize(uint64_t size) { m_meta_data_buffer_size = size; } 41 42 void setThreadID(lldb::tid_t thread_id) { m_thread_id = thread_id; } 43 44 lldb::tid_t getThreadID() const { return m_thread_id; } 45 46private: 47 lldb::TraceType m_type; 48 uint64_t m_trace_buffer_size; 49 uint64_t m_meta_data_buffer_size; 50 lldb::tid_t m_thread_id; 51 52 /// m_trace_params is meant to hold any custom parameters 53 /// apart from meta buffer size and trace size. 54 /// The interpretation of such parameters is left to 55 /// the lldb-server. 56 StructuredData::DictionarySP m_trace_params; 57}; 58} 59 60#endif // liblldb_TraceOptions_h_ 61