#include "Python.h"
#include "pycore_ceval.h"
#include "pycore_frame.h"
#include "pycore_interp.h"
#ifdef PY_HAVE_PERF_TRAMPOLINE
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/syscall.h>
PerfMapJitState;
static PerfMapJitState perf_jit_map_state;
#define PERF_JIT_CODE_PADDING …
#define trampoline_api …
uword;
CodeComments;
#define Pd …
#define MB …
#define EM_386 …
#define EM_X86_64 …
#define EM_ARM …
#define EM_AARCH64 …
#define EM_RISCV …
#define TARGET_ARCH_IA32 …
#define TARGET_ARCH_X64 …
#define TARGET_ARCH_ARM …
#define TARGET_ARCH_ARM64 …
#define TARGET_ARCH_RISCV32 …
#define TARGET_ARCH_RISCV64 …
#define FLAG_generate_perf_jitdump …
#define FLAG_write_protect_code …
#define FLAG_write_protect_vm_isolate …
#define FLAG_code_comments …
#define UNREACHABLE() …
static uword GetElfMachineArchitecture(void) { … }
Header;
enum PerfEvent { … };
struct BaseEvent { … };
CodeLoadEvent;
CodeUnwindingInfoEvent;
static const intptr_t nanoseconds_per_second = …;
static const uint8_t DwarfUData4 = …;
static const uint8_t DwarfSData4 = …;
static const uint8_t DwarfPcRel = …;
static const uint8_t DwarfDataRel = …;
EhFrameHeader;
static int64_t get_current_monotonic_ticks(void) { … }
static int64_t get_current_time_microseconds(void) { … }
static size_t round_up(int64_t value, int64_t multiple) { … }
static void perf_map_jit_write_fully(const void* buffer, size_t size) { … }
static void perf_map_jit_write_header(int pid, FILE* out_file) { … }
static void* perf_map_jit_init(void) { … }
#define DWRF_CIE_VERSION …
enum { … };
enum
{ … };
enum { … };
enum { … };
enum { … };
enum { … };
enum { … };
enum { … };
enum { … };
ELFObjectContext;
static uint32_t
elfctx_append_string(ELFObjectContext* ctx, const char* str)
{ … }
static void
elfctx_append_sleb128(ELFObjectContext* ctx, int32_t v)
{ … }
static void
elfctx_append_uleb128(ELFObjectContext* ctx, uint32_t v)
{ … }
#define DWRF_U8(x) …
#define DWRF_I8(x) …
#define DWRF_U16(x) …
#define DWRF_U32(x) …
#define DWRF_ADDR(x) …
#define DWRF_UV(x) …
#define DWRF_SV(x) …
#define DWRF_STR(str) …
#define DWRF_ALIGNNOP(s) …
#define DWRF_SECTION(name, stmt) …
static void
elf_init_ehframe(ELFObjectContext* ctx)
{ … }
static void perf_map_jit_write_entry(void *state, const void *code_addr,
unsigned int code_size, PyCodeObject *co)
{ … }
static int perf_map_jit_fini(void* state) { … }
_PyPerf_Callbacks _Py_perfmap_jit_callbacks = …;
#endif