#include "Perf.h"
#include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
#include "lldb/Host/linux/Support.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/MemoryBuffer.h"
#include <linux/version.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
usingnamespacelldb_private;
usingnamespaceprocess_linux;
usingnamespacellvm;
Expected<LinuxPerfZeroTscConversion>
lldb_private::process_linux::LoadPerfTscConversionParameters() { … }
void resource_handle::MmapDeleter::operator()(void *ptr) { … }
void resource_handle::FileDescriptorDeleter::operator()(long *ptr) { … }
llvm::Expected<PerfEvent> PerfEvent::Init(perf_event_attr &attr,
std::optional<lldb::pid_t> pid,
std::optional<lldb::cpu_id_t> cpu,
std::optional<long> group_fd,
unsigned long flags) { … }
llvm::Expected<PerfEvent> PerfEvent::Init(perf_event_attr &attr,
std::optional<lldb::pid_t> pid,
std::optional<lldb::cpu_id_t> cpu) { … }
llvm::Expected<resource_handle::MmapUP>
PerfEvent::DoMmap(void *addr, size_t length, int prot, int flags,
long int offset, llvm::StringRef buffer_name) { … }
llvm::Error PerfEvent::MmapMetadataAndDataBuffer(size_t num_data_pages,
bool data_buffer_write) { … }
llvm::Error PerfEvent::MmapAuxBuffer(size_t num_aux_pages) { … }
llvm::Error PerfEvent::MmapMetadataAndBuffers(size_t num_data_pages,
size_t num_aux_pages,
bool data_buffer_write) { … }
long PerfEvent::GetFd() const { … }
perf_event_mmap_page &PerfEvent::GetMetadataPage() const { … }
ArrayRef<uint8_t> PerfEvent::GetDataBuffer() const { … }
ArrayRef<uint8_t> PerfEvent::GetAuxBuffer() const { … }
Expected<std::vector<uint8_t>> PerfEvent::GetReadOnlyDataBuffer() { … }
Expected<std::vector<uint8_t>> PerfEvent::GetReadOnlyAuxBuffer() { … }
Error PerfEvent::DisableWithIoctl() { … }
bool PerfEvent::IsEnabled() const { … }
Error PerfEvent::EnableWithIoctl() { … }
size_t PerfEvent::GetEffectiveDataBufferSize() const { … }
Expected<PerfEvent>
lldb_private::process_linux::CreateContextSwitchTracePerfEvent(
lldb::cpu_id_t cpu_id, const PerfEvent *parent_perf_event) { … }