DynamoRIO
|
DrMemtrace trace entry enum types and definitions. More...
#include <stdint.h>
#include "utils.h"
Macros | |
#define | DRMEMTRACE_MODULE_LIST_FILENAME "modules.log" |
#define | DRMEMTRACE_FUNCTION_LIST_FILENAME "funclist.log" |
Typedefs | |
typedef uintptr_t | addr_t |
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
◆ 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_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.
Typedef Documentation
◆ addr_t
typedef uintptr_t addr_t |
The type of a memory address.
Enumeration Type Documentation
◆ offline_file_type_t
enum offline_file_type_t |
Bitfields used to describe the high-level characteristics of both an offline final trace and a raw not-yet-postprocessed trace, as well as (despite the OFFLINE_ prefix) an online trace. In a final trace these are stored in a marker of type TRACE_MARKER_TYPE_FILETYPE.
◆ trace_marker_type_t
enum trace_marker_type_t |
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 of this marker contains the program counter at the kernel interruption point. If the interruption point is just after a branch, this value is the target of that branch. (For trace version TRACE_ENTRY_VERSION_NO_KERNEL_PC or below, the value is the module offset rather than the absolute program counter.) The value is 0 for some types where this information is not available, namely Windows callbacks. A restartable sequence abort handler is further identified by a prior marker of type TRACE_MARKER_TYPE_RSEQ_ABORT. |
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 |
TRACE_MARKER_TYPE_FILETYPE | The marker value contains the OFFLINE_FILE_TYPE_* bitfields of type offline_file_type_t identifying the architecture and other key high-level attributes of the trace. |
TRACE_MARKER_TYPE_CACHE_LINE_SIZE | The marker value contains the traced processor's cache line size in bytes. |
TRACE_MARKER_TYPE_INSTRUCTION_COUNT | The marker value contains the count of dynamic instruction executions in this software thread since the start of the trace. This marker type is only present in online-cache-filtered traces and is placed at thread exit. |
TRACE_MARKER_TYPE_VERSION | The marker value contains the version of the trace format: a value of type trace_version_t. The marker is present in the first few entries of a trace file. |
TRACE_MARKER_TYPE_RSEQ_ABORT | Serves to further identify TRACE_MARKER_TYPE_KERNEL_EVENT as a restartable sequence abort handler. This will always be immediately followed by TRACE_MARKER_TYPE_KERNEL_EVENT. |
TRACE_MARKER_TYPE_WINDOW_ID | Identifies in the marker value the ordinal of a window during a multi-window tracing run (see the options -trace_for_instrs and -retrace_every_instrs). When a marker with an ordinal value different from the last-seen marker appears, a time gap may exist immediately before this new marker. |
◆ trace_type_t
enum trace_type_t |
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. |
TRACE_TYPE_PREFETCHT0 | An x86 prefetch to all levels of the cache. |
TRACE_TYPE_PREFETCH_READ_L1 | Load prefetch to L1 cache. |
TRACE_TYPE_PREFETCHT1 | An x86 prefetch to level 2 cache and higher. |
TRACE_TYPE_PREFETCH_READ_L2 | Load prefetch to L2 cache. |
TRACE_TYPE_PREFETCHT2 | An x86 prefetch to level 3 cache and higher. |
TRACE_TYPE_PREFETCH_READ_L3 | Load prefetch to L3 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. |
TRACE_TYPE_PREFETCH_READ_L1_NT | Non-temporal load prefetch to L1 cache. |
TRACE_TYPE_PREFETCH_READ_L2_NT | Non-temporal load prefetch to L2 cache. |
TRACE_TYPE_PREFETCH_READ_L3_NT | Non-temporal load prefetch to L3 cache. |
TRACE_TYPE_PREFETCH_INSTR_L1 | Instr prefetch to L1 cache. |
TRACE_TYPE_PREFETCH_INSTR_L1_NT | Non-temporal instr prefetch to L1 cache. |
TRACE_TYPE_PREFETCH_INSTR_L2 | Instr prefetch to L2 cache. |
TRACE_TYPE_PREFETCH_INSTR_L2_NT | Non-temporal instr prefetch to L2 cache. |
TRACE_TYPE_PREFETCH_INSTR_L3 | Instr prefetch to L3 cache. |
TRACE_TYPE_PREFETCH_INSTR_L3_NT | Non-temporal instr prefetch to L3 cache. |
TRACE_TYPE_PREFETCH_WRITE_L1 | Store prefetch to L1 cache. |
TRACE_TYPE_PREFETCH_WRITE_L1_NT | Non-temporal store prefetch to L1 cache. |
TRACE_TYPE_PREFETCH_WRITE_L2 | Store prefetch to L2 cache. |
TRACE_TYPE_PREFETCH_WRITE_L2_NT | Non-temporal store prefetch to L2 cache. |
TRACE_TYPE_PREFETCH_WRITE_L3 | Store prefetch to L3 cache. |
TRACE_TYPE_PREFETCH_WRITE_L3_NT | Non-temporal store prefetch to L3 cache. |
◆ trace_version_t
enum trace_version_t |
The version number of the trace format. This is presented to analysis tools as a marker of type TRACE_MARKER_TYPE_VERSION.
Enumerator | |
---|---|
TRACE_ENTRY_VERSION_NO_KERNEL_PC | A prior version where TRACE_MARKER_TYPE_KERNEL_EVENT provided the module offset (and nothing for restartable sequence aborts) rather than the absolute PC of the interruption point provided today. |
TRACE_ENTRY_VERSION | The latest version of the trace format. |
Function Documentation
◆ type_is_instr()
|
inlinestatic |
Returns whether the type represents an instruction fetch. Deliberately excludes TRACE_TYPE_INSTR_NO_FETCH and TRACE_TYPE_INSTR_BUNDLE.
◆ type_is_instr_branch()
|
inlinestatic |
Returns whether the type represents the fetch of a branch instruction.
◆ type_is_prefetch()
|
inlinestatic |
Returns whether the type represents a prefetch request.