llvm/lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp

//===-- IntelPTSingleBufferTrace.cpp --------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#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) {}

/// Return the Linux perf event type for Intel PT.
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) {}

/// Create a \a perf_event_attr configured for
/// an IntelPT event.
///
/// \return
///   A \a perf_event_attr if successful,
///   or an \a llvm::Error otherwise.
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 {}