trace_entry.h File Reference

DrMemtrace trace entry enum types and definitions. More...

#include <memory>
#include <stddef.h>
#include <stdint.h>
#include "utils.h"

Data Structures

struct  dynamorio::drmemtrace::_trace_entry_t
 

Namespaces

 dynamorio::drmemtrace
 

Macros

#define DRMEMTRACE_MODULE_LIST_FILENAME   "modules.log"
 
#define DRMEMTRACE_FUNCTION_LIST_FILENAME   "funclist.log"
 
#define DRMEMTRACE_ENCODING_FILENAME   "encodings.bin"
 
#define DRMEMTRACE_SERIAL_SCHEDULE_FILENAME   "serial_schedule.bin"
 
#define DRMEMTRACE_CPU_SCHEDULE_FILENAME   "cpu_schedule.bin.zip"
 
#define DRMEMTRACE_KERNEL_TRACE_SUBDIR   "kernel.raw"
 
#define DRMEMTRACE_KCORE_FILENAME   "kcore"
 
#define DRMEMTRACE_KALLSYMS_FILENAME   "kallsyms"
 

Typedefs

typedef uintptr_t dynamorio::drmemtrace::addr_t
 
typedef struct _trace_entry_t dynamorio::drmemtrace::trace_entry_t
 

Enumerations

enum  dynamorio::drmemtrace::trace_version_t {
  dynamorio::drmemtrace::TRACE_ENTRY_VERSION_NO_KERNEL_PC = 2,
  dynamorio::drmemtrace::TRACE_ENTRY_VERSION_KERNEL_PC = 3,
  dynamorio::drmemtrace::TRACE_ENTRY_VERSION_ENCODINGS = 4,
  dynamorio::drmemtrace::TRACE_ENTRY_VERSION_BRANCH_INFO = 5,
  dynamorio::drmemtrace::TRACE_ENTRY_VERSION_FREQUENT_TIMESTAMPS = 6,
  dynamorio::drmemtrace::TRACE_ENTRY_VERSION = TRACE_ENTRY_VERSION_FREQUENT_TIMESTAMPS
}
 
enum  dynamorio::drmemtrace::trace_type_t {
  dynamorio::drmemtrace::TRACE_TYPE_READ,
  dynamorio::drmemtrace::TRACE_TYPE_WRITE,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCH,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCHT0,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCH_READ_L1,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCHT1,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCH_READ_L2,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCHT2,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCH_READ_L3,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCHNTA,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCH_READ,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCH_WRITE,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCH_INSTR,
  dynamorio::drmemtrace::TRACE_TYPE_INSTR,
  dynamorio::drmemtrace::TRACE_TYPE_INSTR_DIRECT_JUMP,
  dynamorio::drmemtrace::TRACE_TYPE_INSTR_INDIRECT_JUMP,
  dynamorio::drmemtrace::TRACE_TYPE_INSTR_CONDITIONAL_JUMP,
  dynamorio::drmemtrace::TRACE_TYPE_INSTR_DIRECT_CALL,
  dynamorio::drmemtrace::TRACE_TYPE_INSTR_INDIRECT_CALL,
  dynamorio::drmemtrace::TRACE_TYPE_INSTR_RETURN ,
  dynamorio::drmemtrace::TRACE_TYPE_INSTR_FLUSH ,
  dynamorio::drmemtrace::TRACE_TYPE_DATA_FLUSH ,
  dynamorio::drmemtrace::TRACE_TYPE_THREAD_EXIT ,
  dynamorio::drmemtrace::TRACE_TYPE_FOOTER,
  dynamorio::drmemtrace::TRACE_TYPE_HARDWARE_PREFETCH,
  dynamorio::drmemtrace::TRACE_TYPE_MARKER,
  dynamorio::drmemtrace::TRACE_TYPE_INSTR_NO_FETCH ,
  dynamorio::drmemtrace::TRACE_TYPE_INSTR_SYSENTER,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCH_READ_L1_NT,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCH_READ_L2_NT,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCH_READ_L3_NT,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCH_INSTR_L1,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCH_INSTR_L1_NT,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCH_INSTR_L2,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCH_INSTR_L2_NT,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCH_INSTR_L3,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCH_INSTR_L3_NT,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCH_WRITE_L1,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCH_WRITE_L1_NT,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCH_WRITE_L2,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCH_WRITE_L2_NT,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCH_WRITE_L3,
  dynamorio::drmemtrace::TRACE_TYPE_PREFETCH_WRITE_L3_NT ,
  dynamorio::drmemtrace::TRACE_TYPE_INSTR_TAKEN_JUMP,
  dynamorio::drmemtrace::TRACE_TYPE_INSTR_UNTAKEN_JUMP,
  dynamorio::drmemtrace::TRACE_TYPE_INVALID
}
 
enum  dynamorio::drmemtrace::trace_marker_type_t {
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_KERNEL_EVENT,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_KERNEL_XFER,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_TIMESTAMP,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_CPU_ID,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_FUNC_ID,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_FUNC_RETADDR,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_FUNC_ARG,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_FUNC_RETVAL ,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_FILETYPE,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_CACHE_LINE_SIZE,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_INSTRUCTION_COUNT,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_VERSION,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_RSEQ_ABORT,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_WINDOW_ID,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_PHYSICAL_ADDRESS,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_PHYSICAL_ADDRESS_NOT_AVAILABLE,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_VIRTUAL_ADDRESS,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_PAGE_SIZE,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_SYSCALL_IDX,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_CHUNK_INSTR_COUNT,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_CHUNK_FOOTER,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_RECORD_ORDINAL,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_FILTER_ENDPOINT,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_RSEQ_ENTRY,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_SYSCALL,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_MAYBE_BLOCKING_SYSCALL,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_SYSCALL_TRACE_START,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_SYSCALL_TRACE_END ,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_SYSCALL_FAILED,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_DIRECT_THREAD_SWITCH,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_CORE_WAIT,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_CORE_IDLE,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_CONTEXT_SWITCH_START,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_CONTEXT_SWITCH_END,
  dynamorio::drmemtrace::TRACE_MARKER_TYPE_VECTOR_LENGTH
}
 
enum  dynamorio::drmemtrace::func_trace_t : uint64_t { dynamorio::drmemtrace::func_trace_t::TRACE_FUNC_ID_SYSCALL_BASE = 0x100000000ULL }
 
enum  dynamorio::drmemtrace::offline_file_type_t { ,
  dynamorio::drmemtrace::OFFLINE_FILE_TYPE_FILTERED = 0x01 ,
  dynamorio::drmemtrace::OFFLINE_FILE_TYPE_INSTRUCTION_ONLY = 0x04,
  dynamorio::drmemtrace::OFFLINE_FILE_TYPE_ARCH_AARCH64 = 0x08,
  dynamorio::drmemtrace::OFFLINE_FILE_TYPE_ARCH_ARM32 = 0x10,
  dynamorio::drmemtrace::OFFLINE_FILE_TYPE_ARCH_X86_32 = 0x20,
  dynamorio::drmemtrace::OFFLINE_FILE_TYPE_ARCH_X86_64 = 0x40,
  dynamorio::drmemtrace::OFFLINE_FILE_TYPE_ARCH_ALL,
  dynamorio::drmemtrace::OFFLINE_FILE_TYPE_IFILTERED = 0x80,
  dynamorio::drmemtrace::OFFLINE_FILE_TYPE_DFILTERED = 0x100,
  dynamorio::drmemtrace::OFFLINE_FILE_TYPE_ENCODINGS = 0x200,
  dynamorio::drmemtrace::OFFLINE_FILE_TYPE_SYSCALL_NUMBERS = 0x400,
  dynamorio::drmemtrace::OFFLINE_FILE_TYPE_BLOCKING_SYSCALLS = 0x800,
  dynamorio::drmemtrace::OFFLINE_FILE_TYPE_KERNEL_SYSCALLS = 0x1000,
  dynamorio::drmemtrace::OFFLINE_FILE_TYPE_BIMODAL_FILTERED_WARMUP = 0x2000,
  dynamorio::drmemtrace::OFFLINE_FILE_TYPE_KERNEL_SYSCALL_TRACE_TEMPLATES = 0x4000,
  dynamorio::drmemtrace::OFFLINE_FILE_TYPE_KERNEL_SYSCALL_INSTR_ONLY = 0x8000,
  dynamorio::drmemtrace::OFFLINE_FILE_TYPE_CORE_SHARDED = 0x10000
}
 
enum  dynamorio::drmemtrace::encoding_file_type_t {
  dynamorio::drmemtrace::ENCODING_FILE_TYPE_DEFAULT = 0x0,
  dynamorio::drmemtrace::ENCODING_FILE_TYPE_SEPARATE_NON_MOD_INSTRS = 0x1
}
 

Functions

static bool dynamorio::drmemtrace::type_is_instr (const trace_type_t type)
 
static bool dynamorio::drmemtrace::type_is_instr_branch (const trace_type_t type)
 
static bool dynamorio::drmemtrace::type_is_instr_direct_branch (const trace_type_t type)
 
static bool dynamorio::drmemtrace::type_is_instr_conditional_branch (const trace_type_t type)
 
static bool dynamorio::drmemtrace::type_is_prefetch (const trace_type_t type)
 
static bool dynamorio::drmemtrace::type_has_address (const trace_type_t type)
 
static bool dynamorio::drmemtrace::type_is_data (const trace_type_t type)
 
static bool dynamorio::drmemtrace::type_is_read (const trace_type_t type)
 

Detailed Description

DrMemtrace trace entry enum types and definitions.

Macro Definition Documentation

◆ DRMEMTRACE_CPU_SCHEDULE_FILENAME

#define DRMEMTRACE_CPU_SCHEDULE_FILENAME   "cpu_schedule.bin.zip"

The name of the archive file in -offline mode where the cpu thread schedule is written during post-processing. A separate sub-archive is written for each cpu.

◆ DRMEMTRACE_ENCODING_FILENAME

#define DRMEMTRACE_ENCODING_FILENAME   "encodings.bin"

The name of the file in -offline mode where non-module instruction encodings are written. Use drmemtrace_get_encoding_path() to obtain the full path.

◆ DRMEMTRACE_FUNCTION_LIST_FILENAME

#define DRMEMTRACE_FUNCTION_LIST_FILENAME   "funclist.log"

The name of the file in -offline mode where function tracing names are written. Use drmemtrace_get_funclist_path() to obtain the full path.

◆ DRMEMTRACE_KALLSYMS_FILENAME

#define DRMEMTRACE_KALLSYMS_FILENAME   "kallsyms"

The name of the file in -offline mode where kallsyms is stored. This file is copied from '/proc/kallsyms' during tracing.

◆ DRMEMTRACE_KCORE_FILENAME

#define DRMEMTRACE_KCORE_FILENAME   "kcore"

The name of the file in -offline mode where the kernel code segments are stored. This file is copied from '/proc/kcore' during tracing.

◆ DRMEMTRACE_KERNEL_TRACE_SUBDIR

#define DRMEMTRACE_KERNEL_TRACE_SUBDIR   "kernel.raw"

The name of the folder in -offline mode where the kernel's per thread trace data is stored.

◆ DRMEMTRACE_MODULE_LIST_FILENAME

#define DRMEMTRACE_MODULE_LIST_FILENAME   "modules.log"

The name of the file in -offline mode where module data is written. Its creation can be customized using drmemtrace_custom_module_data() and then modified before passing to raw2trace via drmodtrack_add_custom_data() and drmodtrack_offline_write(). Use drmemtrace_get_modlist_path() to obtain the full path.

◆ DRMEMTRACE_SERIAL_SCHEDULE_FILENAME

#define DRMEMTRACE_SERIAL_SCHEDULE_FILENAME   "serial_schedule.bin"

The base name of the file in -offline mode where the serial thread schedule is written during post-processing. A compression suffix may be appended.