#include "IntelPTSingleBufferTrace.h"
#include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
#include "lldb/Utility/Status.h"
#include "lldb/Utility/StreamString.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/TargetParser/Host.h"
#include <linux/perf_event.h>
#include <sstream>
#include <sys/syscall.h>
#include <unistd.h>
usingnamespacelldb;
usingnamespacelldb_private;
usingnamespaceprocess_linux;
usingnamespacellvm;
const char kOSEventIntelPTTypeFile[] = …;
const char kPSBPeriodCapFile[] = …;
const char kPSBPeriodValidValuesFile[] = …;
const char kPSBPeriodBitOffsetFile[] = …;
const char kTSCBitOffsetFile[] = …;
enum IntelPTConfigFileType { … };
static Expected<uint32_t> ReadIntelPTConfigFile(const char *file,
IntelPTConfigFileType type) { … }
Expected<uint32_t> process_linux::GetIntelPTOSEventType() { … }
static Error CheckPsbPeriod(size_t psb_period) { … }
#ifdef PERF_ATTR_SIZE_VER5
static Expected<uint64_t>
GeneratePerfEventConfigValue(bool enable_tsc,
std::optional<uint64_t> psb_period) { … }
static Expected<perf_event_attr>
CreateIntelPTPerfEventConfiguration(bool enable_tsc,
std::optional<uint64_t> psb_period) { … }
#endif
size_t IntelPTSingleBufferTrace::GetIptTraceSize() const { … }
Error IntelPTSingleBufferTrace::Pause() { … }
Error IntelPTSingleBufferTrace::Resume() { … }
Expected<std::vector<uint8_t>> IntelPTSingleBufferTrace::GetIptTrace() { … }
Expected<IntelPTSingleBufferTrace>
IntelPTSingleBufferTrace::Start(const TraceIntelPTStartRequest &request,
std::optional<lldb::tid_t> tid,
std::optional<cpu_id_t> cpu_id, bool disabled,
std::optional<int> cgroup_fd) { … }
const PerfEvent &IntelPTSingleBufferTrace::GetPerfEvent() const { … }