DynamoRIO
 
Loading...
Searching...
No Matches
dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t Class Reference

#include <scheduler.h>

Inheritance diagram for dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t:
dynamorio::drmemtrace::memtrace_stream_t

Public Member Functions

virtual stream_status_t next_record (RecordType &record)
 
virtual stream_status_t next_record (RecordType &record, uint64_t cur_time)
 
virtual stream_status_t start_speculation (addr_t start_address, bool queue_current_record)
 
virtual stream_status_t stop_speculation ()
 
virtual stream_status_t set_active (bool active)
 
uint64_t get_record_ordinal () const override
 
uint64_t get_instruction_ordinal () const override
 
std::string get_stream_name () const override
 
virtual input_ordinal_t get_input_stream_ordinal ()
 
virtual int get_input_workload_ordinal ()
 
uint64_t get_last_timestamp () const override
 
uint64_t get_first_timestamp () const override
 
uint64_t get_version () const override
 
uint64_t get_filetype () const override
 
uint64_t get_cache_line_size () const override
 
uint64_t get_chunk_instr_count () const override
 
uint64_t get_page_size () const override
 
bool is_record_synthetic () const override
 
- Public Member Functions inherited from dynamorio::drmemtrace::memtrace_stream_t
virtual ~memtrace_stream_t ()
 

Detailed Description

template<typename RecordType, typename ReaderType>
class dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t

Represents a stream of RecordType trace records derived from a subset of a set of input recorded traces. Provides more information about the record stream using the dynamorio::drmemtrace::memtrace_stream_t API.

Member Function Documentation

◆ get_cache_line_size()

template<typename RecordType , typename ReaderType >
uint64_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t::get_cache_line_size ( ) const
inlineoverridevirtual

Returns the cache line size from the TRACE_MARKER_TYPE_CACHE_LINE_SIZE record in the trace header.

Implements dynamorio::drmemtrace::memtrace_stream_t.

◆ get_chunk_instr_count()

template<typename RecordType , typename ReaderType >
uint64_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t::get_chunk_instr_count ( ) const
inlineoverridevirtual

Returns the chunk instruction count from the TRACE_MARKER_TYPE_CHUNK_INSTR_COUNT record in the trace header.

Implements dynamorio::drmemtrace::memtrace_stream_t.

◆ get_filetype()

template<typename RecordType , typename ReaderType >
uint64_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t::get_filetype ( ) const
inlineoverridevirtual

Returns the OFFLINE_FILE_TYPE_* bitfields of type offline_file_type_t identifying the architecture and other key high-level attributes of the trace from the TRACE_MARKER_TYPE_FILETYPE record in the trace header.

Implements dynamorio::drmemtrace::memtrace_stream_t.

◆ get_first_timestamp()

template<typename RecordType , typename ReaderType >
uint64_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t::get_first_timestamp ( ) const
inlineoverridevirtual

Returns the value of the first seen TRACE_MARKER_TYPE_TIMESTAMP marker.

Implements dynamorio::drmemtrace::memtrace_stream_t.

◆ get_input_stream_ordinal()

template<typename RecordType , typename ReaderType >
virtual input_ordinal_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t::get_input_stream_ordinal ( )
inlinevirtual

Returns the ordinal for the current input stream feeding this output stream.

◆ get_input_workload_ordinal()

template<typename RecordType , typename ReaderType >
virtual int dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t::get_input_workload_ordinal ( )
inlinevirtual

Returns the ordinal for the workload which is the source of the current input stream feeding this output stream. This workload ordinal is the index into the vector of type dynamorio::drmemtrace::scheduler_tmpl_t::input_workload_t passed to init(). Returns -1 if there is no current input for this output stream.

◆ get_instruction_ordinal()

template<typename RecordType , typename ReaderType >
uint64_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t::get_instruction_ordinal ( ) const
inlineoverridevirtual

Returns the count of instructions from the start of the trace to this point. If SCHEDULER_USE_INPUT_ORDINALS is set, then this value matches the instruction ordinal for the current input stream (and thus might decrease or not change across records if the input changed). Otherwise, if multiple input streams fed into this output stream, this includes the records from all those streams that were presented here: thus, this may be larger than what the current input stream reports (see get_input_stream_interface() and get_input_stream_ordinal()). This does not advance across skipped records in an input stream from a region of interest (see dynamorio::drmemtrace::scheduler_tmpl_t::range_t), but it does advance if the output stream skipped ahead.

Implements dynamorio::drmemtrace::memtrace_stream_t.

◆ get_last_timestamp()

template<typename RecordType , typename ReaderType >
uint64_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t::get_last_timestamp ( ) const
inlineoverridevirtual

Returns the value of the most recently seen TRACE_MARKER_TYPE_TIMESTAMP marker.

Implements dynamorio::drmemtrace::memtrace_stream_t.

◆ get_page_size()

template<typename RecordType , typename ReaderType >
uint64_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t::get_page_size ( ) const
inlineoverridevirtual

Returns the page size from the TRACE_MARKER_TYPE_PAGE_SIZE record in the trace header.

Implements dynamorio::drmemtrace::memtrace_stream_t.

◆ get_record_ordinal()

template<typename RecordType , typename ReaderType >
uint64_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t::get_record_ordinal ( ) const
inlineoverridevirtual

Returns the count of memref_t records from the start of the trace to this point. It does not include synthetic records (see is_record_synthetic()).

If SCHEDULER_USE_INPUT_ORDINALS is set, then this value matches the record ordinal for the current input stream (and thus might decrease or not change across records if the input changed). Otherwise, if multiple input streams fed into this output stream, this includes the records from all those streams that were presented here: thus, this may be larger than what the current input stream reports (see get_input_stream_interface() and get_input_stream_ordinal()). This does not advance across skipped records in an input stream from a region of interest (see dynamorio::drmemtrace::scheduler_tmpl_t::range_t), but it does advance if the output stream skipped ahead.

Implements dynamorio::drmemtrace::memtrace_stream_t.

◆ get_stream_name()

template<typename RecordType , typename ReaderType >
std::string dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t::get_stream_name ( ) const
inlineoverridevirtual

Returns a name for the current input stream feeding this output stream. For stored offline traces, this is the base name of the trace on disk. For online traces, this is the name of the pipe.

Implements dynamorio::drmemtrace::memtrace_stream_t.

◆ get_version()

template<typename RecordType , typename ReaderType >
uint64_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t::get_version ( ) const
inlineoverridevirtual

Returns the trace_version_t value from the TRACE_MARKER_TYPE_VERSION record in the trace header.

Implements dynamorio::drmemtrace::memtrace_stream_t.

◆ is_record_synthetic()

template<typename RecordType , typename ReaderType >
bool dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t::is_record_synthetic ( ) const
inlineoverridevirtual

Returns whether the current record was synthesized and inserted into the record stream and was not present in the original stream. This is true for timestamp and cpuid headers duplicated after skipping ahead, as well as cpuid markers inserted for synthetic schedules. Such records do not cound toward the record count and get_record_ordinal() will return the value of the prior record.

Reimplemented from dynamorio::drmemtrace::memtrace_stream_t.

◆ next_record() [1/2]

template<typename RecordType , typename ReaderType >
virtual stream_status_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t::next_record ( RecordType & record)
virtual

Advances to the next record in the stream. Returns a status code on whether and how to continue.

◆ next_record() [2/2]

template<typename RecordType , typename ReaderType >
virtual stream_status_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t::next_record ( RecordType & record,
uint64_t cur_time )
virtual

Advances to the next record in the stream. Returns a status code on whether and how to continue. Supplies the current time for QUANTUM_TIME. The time should be considered to be the time prior to processing the returned record. The time is unitless but needs to be a globally consistent increasing value across all output streams. A 0 value for "cur_time" is not allowed. STATUS_INVALID is returned if 0 or a value smaller than the start time of the current input's quantum is passed in.

◆ set_active()

template<typename RecordType , typename ReaderType >
virtual stream_status_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t::set_active ( bool active)
virtual

Disables or re-enables this output stream. If "active" is false, this stream becomes inactive and its currently assigned input is moved to the ready queue to be scheduled on other outputs. The STATUS_WAIT code is returned to next_record() for inactive streams. If "active" is true, this stream becomes active again. This is only supported for MAP_TO_ANY_OUTPUT.

◆ start_speculation()

template<typename RecordType , typename ReaderType >
virtual stream_status_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t::start_speculation ( addr_t start_address,
bool queue_current_record )
virtual

Begins a diversion from the regular inputs to a side stream of records representing speculative execution starting at 'start_address'.

Because the instruction record after a branch typically needs to be read before knowing whether a simulator is on the wrong path or not, this routine supports putting back the current record so that it will be re-provided as the first record after (the outermost) stop_speculation(), if "queue_current_record" is true.

This call can be nested; each call needs to be paired with a corresponding stop_speculation() call.

◆ stop_speculation()

template<typename RecordType , typename ReaderType >
virtual stream_status_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t::stop_speculation ( )
virtual

Stops speculative execution, resuming execution at the stream of records from the point at which the prior matching start_speculation() call was made, either repeating the current record at that time (if "true" was passed for "queue_current_record" to start_speculation()) or continuing on the subsequent record (if "false" was passed). Returns STATUS_INVALID if there was no prior start_speculation() call.


The documentation for this class was generated from the following file: