DynamoRIO
|
#include <scheduler.h>
Public Member Functions | |
scheduler_options_t () | |
scheduler_options_t (mapping_t mapping, inter_input_dependency_t deps, scheduler_flags_t flags=SCHEDULER_DEFAULTS, int verbosity=0) | |
Data Fields | |
size_t | struct_size = sizeof(scheduler_options_t) |
mapping_t | mapping = MAP_TO_ANY_OUTPUT |
inter_input_dependency_t | deps = DEPENDENCY_IGNORE |
scheduler_flags_t | flags = SCHEDULER_DEFAULTS |
quantum_unit_t | quantum_unit = QUANTUM_INSTRUCTIONS |
uint64_t | quantum_duration = 10 * 1000 * 1000 |
int | verbosity = 0 |
archive_ostream_t * | schedule_record_ostream = nullptr |
archive_istream_t * | schedule_replay_istream = nullptr |
archive_istream_t * | replay_as_traced_istream = nullptr |
uint64_t | syscall_switch_threshold = 500 |
uint64_t | blocking_switch_threshold = 100 |
double | block_time_scale = 1000. |
uint64_t | block_time_max = 25000000 |
std::string | kernel_switch_trace_path |
std::unique_ptr< ReaderType > | kernel_switch_reader |
std::unique_ptr< ReaderType > | kernel_switch_reader_end |
bool | single_lockstep_output = false |
bool | randomize_next_input = false |
bool | read_inputs_in_init = true |
bool | honor_direct_switches = true |
Detailed Description
template<typename RecordType, typename ReaderType>
struct dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::scheduler_options_t
Collects the parameters specifying how the scheduler should behave, outside of the workload inputs and the output count.
Constructor & Destructor Documentation
◆ scheduler_options_t() [1/2]
|
inline |
Constructs a default set of options.
◆ scheduler_options_t() [2/2]
|
inline |
Constructs a set of options with the given type and strategy.
Field Documentation
◆ block_time_max
uint64_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::scheduler_options_t::block_time_max = 25000000 |
The maximum time, in the units explained by block_time_scale (either QUANTUM_TIME simulator time or wall-clock microseconds for QUANTUM_INSTRUCTIONS), for an input to be considered blocked for any one system call. This is applied after multiplying by block_time_scale.
◆ block_time_scale
double dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::scheduler_options_t::block_time_scale = 1000. |
Controls the amount of time inputs are considered blocked at a syscall whose latency exceeds syscall_switch_threshold or blocking_switch_threshold. The syscall latency (in microseconds) is multiplied by this field to produce the blocked time. For QUANTUM_TIME, that blocked time in the units reported by the time parameter to next_record() must pass before the input is no longer considered blocked. Since the system call latencies are in microseconds, this block_time_scale should be set to the number of next_record() time units in one simulated microsecond. For QUANTUM_INSTRUCTIONS, the blocked time in wall-clock microseconds must pass before the input is actually selected (wall-clock time is used as there is no reasonable alternative with no other uniform notion of time); thus, the block_time_scale value here should equal the slowdown of the instruction record processing versus the original (untraced) application execution. The blocked time is clamped to a maximum value controlled by block_time_max.
◆ blocking_switch_threshold
uint64_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::scheduler_options_t::blocking_switch_threshold = 100 |
Determines the minimum latency in the unit of the trace's timestamps (microseconds) for which a maybe-blocking system call (one with a TRACE_MARKER_TYPE_MAYBE_BLOCKING_SYSCALL marker) will be treated as blocking and trigger a context switch.
◆ deps
inter_input_dependency_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::scheduler_options_t::deps = DEPENDENCY_IGNORE |
How inter-input dependencies are handled.
◆ flags
scheduler_flags_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::scheduler_options_t::flags = SCHEDULER_DEFAULTS |
Optional flags affecting scheduler behavior.
◆ honor_direct_switches
bool dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::scheduler_options_t::honor_direct_switches = true |
If true, the scheduler will attempt to switch to the recorded targets of TRACE_MARKER_TYPE_DIRECT_THREAD_SWITCH system call metadata markers regardless of system call latency. If the target is not available, the current implementation will select the next available input in the regular scheduling queue, but in the future a forced migration may be applied for an input currently on another output. If false, the direct switch markers are ignored and only system call latency thresholds are used to determine switches (the TRACE_MARKER_TYPE_DIRECT_THREAD_SWITCH markers remain: they are not removed from the trace).
◆ kernel_switch_reader
std::unique_ptr<ReaderType> dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::scheduler_options_t::kernel_switch_reader |
An alternative to kernel_switch_trace_path is to pass a reader and kernel_switch_reader_end. See the description of kernel_switch_trace_path. This field is only examined if kernel_switch_trace_path is empty. The scheduler will call the init() function for the reader.
◆ kernel_switch_reader_end
std::unique_ptr<ReaderType> dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::scheduler_options_t::kernel_switch_reader_end |
The end reader for kernel_switch_reader.
◆ kernel_switch_trace_path
std::string dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::scheduler_options_t::kernel_switch_trace_path |
Input file containing template sequences of kernel context switch code. Each sequence must start with a TRACE_MARKER_TYPE_CONTEXT_SWITCH_START marker and end with TRACE_MARKER_TYPE_CONTEXT_SWITCH_END. The values of each marker must hold a switch_type_t enum value indicating which type of switch it corresponds to. Each sequence can be stored as a separate subfile of an archive file, or concatenated into a single file. Each sequence should be in the regular offline drmemtrace format. The sequence is inserted into the output stream on each context switch of the indicated type. The same file (or reader) must be passed when replaying as this kernel code is not stored when recording. An alternative to passing the file path is to pass kernel_switch_reader and kernel_switch_reader_end.
◆ mapping
mapping_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::scheduler_options_t::mapping = MAP_TO_ANY_OUTPUT |
The mapping of inputs to outputs.
◆ quantum_duration
uint64_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::scheduler_options_t::quantum_duration = 10 * 1000 * 1000 |
The scheduling quantum duration for preemption. The units are specified by dynamorio::drmemtrace::scheduler_tmpl_t::scheduler_options_t::quantum_unit.
◆ quantum_unit
quantum_unit_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::scheduler_options_t::quantum_unit = QUANTUM_INSTRUCTIONS |
The unit of the schedule time quantum.
◆ randomize_next_input
bool dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::scheduler_options_t::randomize_next_input = false |
If true, enables a mode where the normal methods of choosing the next input based on priority, timestamps (if -sched_order_time is set), and FIFO order are disabled. Instead, the scheduler selects the next input randomly. Output bindings are still honored. This is intended for experimental use in sensitivity studies.
◆ read_inputs_in_init
bool dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::scheduler_options_t::read_inputs_in_init = true |
If true, the scheduler will read from each input to determine its filetype during initialization. If false, the filetype will not be available prior to explicit record retrieval by the user, but this may be required for inputs whose sources are not yet set up at scheduler init time (e.g., inputs over blocking pipes with data only becoming available after initializing the scheduler, as happens with online trace analyzers). This must be true for DEPENDENCY_TIMESTAMPS as it also requires reading ahead.
◆ replay_as_traced_istream
archive_istream_t* dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::scheduler_options_t::replay_as_traced_istream = nullptr |
Input stream for replaying the traced schedule when MAP_TO_RECORDED_OUTPUT is specified for more than one output stream (whose count must match the number of traced cores).
◆ schedule_record_ostream
archive_ostream_t* dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::scheduler_options_t::schedule_record_ostream = nullptr |
Output stream for recording the schedule for later replay. write_recorded_schedule() must be called when finished to write the in-memory data out to this stream.
◆ schedule_replay_istream
archive_istream_t* dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::scheduler_options_t::schedule_replay_istream = nullptr |
Input stream for replaying a previously recorded schedule when MAP_AS_PREVIOUSLY is specified. If this is non-nullptr and MAP_AS_PREVIOUSLY is specified, schedule_record_ostream must be nullptr, and most other fields in this struct controlling scheduling are ignored.
◆ single_lockstep_output
bool dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::scheduler_options_t::single_lockstep_output = false |
If true, enables a mode where all outputs are serialized into one global outer layer output. The single global output stream alternates in round-robin lockstep among each core output. The core outputs operate just like they would with no serialization, other than timing differences relative to other core outputs.
◆ struct_size
size_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::scheduler_options_t::struct_size = sizeof(scheduler_options_t) |
Size of the struct for binary-compatible additions.
◆ syscall_switch_threshold
uint64_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::scheduler_options_t::syscall_switch_threshold = 500 |
Determines the minimum latency in the unit of the trace's timestamps (microseconds) for which a non-maybe-blocking system call (one without a TRACE_MARKER_TYPE_MAYBE_BLOCKING_SYSCALL marker) will be treated as blocking and trigger a context switch.
◆ verbosity
int dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::scheduler_options_t::verbosity = 0 |
If > 0, diagnostic messages are printed to stderr. Higher values produce more frequent diagnostics.
The documentation for this struct was generated from the following file:
- /home/runner/work/dynamorio/dynamorio/build_release-64/clients/include/drmemtrace/scheduler.h