DynamoRIO API
trace_entry.h File Reference

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

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

Macros

#define TRACE_ENTRY_VERSION   1
 
#define DRMEMTRACE_MODULE_LIST_FILENAME   "modules.log"
 
#define DRMEMTRACE_FUNCTION_LIST_FILENAME   "funclist.log"
 

Typedefs

typedef uintptr_t addr_t
 

Enumerations

Functions

static bool type_is_instr (const trace_type_t type)
 
static bool type_is_instr_branch (const trace_type_t type)
 
static bool type_is_prefetch (const trace_type_t type)
 

Detailed Description

DrMemtrace trace entry enum types and definitions.

Macro Definition Documentation

#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.

#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.

#define TRACE_ENTRY_VERSION   1

The version of the trace format.

Typedef Documentation

typedef uintptr_t addr_t

The type of a memory address.

Enumeration Type Documentation

The sub-type for TRACE_TYPE_MARKER.

Enumerator
TRACE_MARKER_TYPE_KERNEL_EVENT 

The subsequent instruction is the start of a handler for a kernel-initiated event: a signal handler or restartable sequence abort handler on UNIX, or an APC, exception, or callback dispatcher on Windows. The value holds the module offset of the interruption point PC, which is used in post-processing. The value is 0 for some types, namely Windows callbacks and Linux rseq aborts, but these can be assumed to target the start of a block and so there is no loss of accuracy when post-processing.

TRACE_MARKER_TYPE_KERNEL_XFER 

The subsequent instruction is the target of a system call that changes the context: a signal return on UNIX, or a callback return or NtContinue or NtSetContextThread on Windows.

TRACE_MARKER_TYPE_TIMESTAMP 

The marker value contains a timestamp for this point in the trace, in units of microseconds since Jan 1, 1601 (the UTC time). For 32-bit, the value is truncated to 32 bits.

TRACE_MARKER_TYPE_CPU_ID 

The marker value contains the cpu identifier of the cpu this thread was running on at this point in the trace. A value of (uintptr_t)-1 indicates that the cpu could not be determined.

TRACE_MARKER_TYPE_FUNC_ID 

The marker value contains the function id defined by the user in the -record_function (and -record_heap_value if -record_heap is specified) option.

TRACE_MARKER_TYPE_FUNC_RETADDR 

The marker value contains the return address of the just-entered function, whose id is specified by the closest previous TRACE_MARKER_TYPE_FUNC_ID marker entry.

TRACE_MARKER_TYPE_FUNC_ARG 

The marker value contains one argument value of the just-entered function, whose id is specified by the closest previous TRACE_MARKER_TYPE_FUNC_ID marker entry. The number of such entries for one function invocation is equal to the specified argument in -record_function (or pre-defined functions in -record_heap_value if -record_heap is specified).

TRACE_MARKER_TYPE_FUNC_RETVAL 

The marker value contains the return value of the just-entered function, whose id is specified by the closest previous TRACE_MARKER_TYPE_FUNC_ID marker entry

The type of a trace entry in a memref_t structure.

Enumerator
TRACE_TYPE_READ 

A data load.

TRACE_TYPE_WRITE 

A data store.

TRACE_TYPE_PREFETCH 

A general prefetch to the level 1 data cache.

TRACE_TYPE_PREFETCHT0 

An x86 prefetch to all levels of the cache.

TRACE_TYPE_PREFETCHT1 

An x86 prefetch to level 1 of the cache.

TRACE_TYPE_PREFETCHT2 

An x86 prefetch to level 2 of the cache.

TRACE_TYPE_PREFETCHNTA 

An x86 non-temporal prefetch.

TRACE_TYPE_PREFETCH_READ 

An ARM load prefetch.

TRACE_TYPE_PREFETCH_WRITE 

An ARM store prefetch.

TRACE_TYPE_PREFETCH_INSTR 

An ARM insruction prefetch.

TRACE_TYPE_INSTR 

A non-branch instruction.

TRACE_TYPE_INSTR_DIRECT_JUMP 

A direct unconditional jump instruction.

TRACE_TYPE_INSTR_INDIRECT_JUMP 

An indirect jump instruction.

TRACE_TYPE_INSTR_CONDITIONAL_JUMP 

A conditional jump instruction.

TRACE_TYPE_INSTR_DIRECT_CALL 

A direct call instruction.

TRACE_TYPE_INSTR_INDIRECT_CALL 

An indirect call instruction.

TRACE_TYPE_INSTR_RETURN 

A return instruction.

TRACE_TYPE_INSTR_FLUSH 

An instruction cache flush.

TRACE_TYPE_DATA_FLUSH 

A data cache flush.

TRACE_TYPE_THREAD_EXIT 

A thread exit.

TRACE_TYPE_HARDWARE_PREFETCH 

A hardware-issued prefetch (generated after tracing by a cache simulator).

TRACE_TYPE_MARKER 

A marker containing metadata about this point in the trace. It includes a marker sub-type trace_marker_type_t and a value.

TRACE_TYPE_INSTR_NO_FETCH 

For core simulators, a trace includes instructions that do not incur instruction cache fetches, such as on each subsequent iteration of a rep string loop on x86.

TRACE_TYPE_INSTR_SYSENTER 

We separate out the x86 sysenter instruction as it has a hardcoded return point that shows up as a discontinuity in the user mode program counter execution sequence.

Function Documentation

static bool type_is_instr ( const trace_type_t  type)
inlinestatic

Returns whether the type represents an instruction fetch. Deliberately excludes TRACE_TYPE_INSTR_NO_FETCH and TRACE_TYPE_INSTR_BUNDLE.

static bool type_is_instr_branch ( const trace_type_t  type)
inlinestatic

Returns whether the type represents the fetch of a branch instruction.

static bool type_is_prefetch ( const trace_type_t  type)
inlinestatic

Returns whether the type represents a prefetch request.