DynamoRIO
dynamorio::drmemtrace::memtrace_stream_t Class Referenceabstract

#include <memtrace_stream.h>

Inheritance diagram for dynamorio::drmemtrace::memtrace_stream_t:
dynamorio::drmemtrace::default_memtrace_stream_t dynamorio::drmemtrace::reader_t dynamorio::drmemtrace::record_reader_t dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t dynamorio::drmemtrace::record_file_reader_t< T >

Public Types

enum  schedule_statistic_t {
  SCHED_STAT_SWITCH_INPUT_TO_INPUT,
  SCHED_STAT_SWITCH_INPUT_TO_IDLE,
  SCHED_STAT_SWITCH_IDLE_TO_INPUT,
  SCHED_STAT_SWITCH_NOP,
  SCHED_STAT_QUANTUM_PREEMPTS,
  SCHED_STAT_DIRECT_SWITCH_ATTEMPTS,
  SCHED_STAT_DIRECT_SWITCH_SUCCESSES,
  SCHED_STAT_MIGRATIONS,
  SCHED_STAT_RUNQUEUE_STEALS,
  SCHED_STAT_RUNQUEUE_REBALANCES,
  SCHED_STAT_HIT_OUTPUT_LIMIT,
  SCHED_STAT_TYPE_COUNT
}
 

Public Member Functions

virtual ~memtrace_stream_t ()
 
virtual uint64_t get_record_ordinal () const =0
 
virtual uint64_t get_instruction_ordinal () const =0
 
virtual std::string get_stream_name () const =0
 
virtual uint64_t get_last_timestamp () const =0
 
virtual uint64_t get_first_timestamp () const =0
 
virtual uint64_t get_version () const =0
 
virtual uint64_t get_filetype () const =0
 
virtual uint64_t get_cache_line_size () const =0
 
virtual uint64_t get_chunk_instr_count () const =0
 
virtual uint64_t get_page_size () const =0
 
virtual bool is_record_synthetic () const
 
virtual int get_shard_index () const
 
virtual int64_t get_output_cpuid () const
 
virtual int64_t get_workload_id () const
 
virtual int64_t get_input_id () const
 
virtual int64_t get_tid () const
 
virtual memtrace_stream_tget_input_interface () const
 
virtual bool is_record_kernel () const
 
virtual double get_schedule_statistic (schedule_statistic_t stat) const
 

Detailed Description

< DrMemtrace tracing + simulation infrastructure namespace. This is an interface for obtaining information from analysis tools on the full stream of memory reference records.

Member Enumeration Documentation

◆ schedule_statistic_t

Statistics on the resulting schedule from interleaving and switching between the inputs in core-sharded modes.

Enumerator
SCHED_STAT_SWITCH_INPUT_TO_INPUT 

Count of context switches away from an input to a different input.

SCHED_STAT_SWITCH_INPUT_TO_IDLE 

Count of context switches away from an input to an idle state.

SCHED_STAT_SWITCH_IDLE_TO_INPUT 

Count of context switches away from idle to an input. This does not include the initial assignment of an input to a core.

SCHED_STAT_SWITCH_NOP 

Count of quantum preempt points where the same input remains in place as nothing else of equal or greater priority is available.

SCHED_STAT_QUANTUM_PREEMPTS 

Count of preempts due to quantum expiration. Includes instances of the quantum expiring but no switch happening (but SCHED_STAT_SWITCH_NOP can be used to separate those).

SCHED_STAT_DIRECT_SWITCH_ATTEMPTS 

Count of TRACE_MARKER_TYPE_DIRECT_THREAD_SWITCH markers.

SCHED_STAT_DIRECT_SWITCH_SUCCESSES 

Count of TRACE_MARKER_TYPE_DIRECT_THREAD_SWITCH attempts that succeeded.

SCHED_STAT_MIGRATIONS 

Counts the number of times an input switches from another core to this core: i.e., the number of input migrations to this core.

SCHED_STAT_RUNQUEUE_STEALS 

Counts the number of times this output's runqueue became empty and it took work from another output's runqueue.

SCHED_STAT_RUNQUEUE_REBALANCES 

Counts the number of output runqueue rebalances triggered by this output.

SCHED_STAT_HIT_OUTPUT_LIMIT 

Counts the instances where a workload's output limit prevented one of its inputs from being scheduled onto an output.

SCHED_STAT_TYPE_COUNT 

Count of statistic types.

Constructor & Destructor Documentation

◆ ~memtrace_stream_t()

virtual dynamorio::drmemtrace::memtrace_stream_t::~memtrace_stream_t ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ get_cache_line_size()

virtual uint64_t dynamorio::drmemtrace::memtrace_stream_t::get_cache_line_size ( ) const
pure virtual

◆ get_chunk_instr_count()

virtual uint64_t dynamorio::drmemtrace::memtrace_stream_t::get_chunk_instr_count ( ) const
pure virtual

◆ get_filetype()

virtual uint64_t dynamorio::drmemtrace::memtrace_stream_t::get_filetype ( ) const
pure virtual

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.

Implemented in dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t, dynamorio::drmemtrace::default_memtrace_stream_t, dynamorio::drmemtrace::record_reader_t, and dynamorio::drmemtrace::reader_t.

◆ get_first_timestamp()

virtual uint64_t dynamorio::drmemtrace::memtrace_stream_t::get_first_timestamp ( ) const
pure virtual

◆ get_input_id()

virtual int64_t dynamorio::drmemtrace::memtrace_stream_t::get_input_id ( ) const
inlinevirtual

Returns a unique identifier for the current input trace. This might be an ordinal from the list of active inputs, or some other identifier. This is guaranteed to be unique among all inputs, unlike the process and thread identifiers in memref_t. If not implemented for the current mode, -1 is returned.

Reimplemented in dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t.

◆ get_input_interface()

virtual memtrace_stream_t* dynamorio::drmemtrace::memtrace_stream_t::get_input_interface ( ) const
inlinevirtual

Returns the stream interface for the current input trace. This differs from "this" for SHARD_BY_CORE where multiple inputs are interleaved on one output stream ("this"). If not implemented for the current mode, nullptr is returned.

Reimplemented in dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t.

◆ get_instruction_ordinal()

virtual uint64_t dynamorio::drmemtrace::memtrace_stream_t::get_instruction_ordinal ( ) const
pure virtual

Returns the count of instructions from the start of the trace to this point. This includes instructions skipped over and not presented to any tool.

Implemented in dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t, dynamorio::drmemtrace::default_memtrace_stream_t, dynamorio::drmemtrace::record_reader_t, and dynamorio::drmemtrace::reader_t.

◆ get_last_timestamp()

virtual uint64_t dynamorio::drmemtrace::memtrace_stream_t::get_last_timestamp ( ) const
pure virtual

◆ get_output_cpuid()

virtual int64_t dynamorio::drmemtrace::memtrace_stream_t::get_output_cpuid ( ) const
inlinevirtual

Returns a unique identifier for the current "output cpu". Generally this only applies when using SHARD_BY_CORE. For dynamic schedules, the identifier is typically an output cpu ordinal equal to get_shard_index(). For replaying an as-traced schedule, the identifier is typically the original input cpu which is now mapped directly to this output. If not implemented for the current mode, -1 is returned.

Reimplemented in dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t, and dynamorio::drmemtrace::default_memtrace_stream_t.

◆ get_page_size()

virtual uint64_t dynamorio::drmemtrace::memtrace_stream_t::get_page_size ( ) const
pure virtual

◆ get_record_ordinal()

virtual uint64_t dynamorio::drmemtrace::memtrace_stream_t::get_record_ordinal ( ) const
pure virtual

Returns the count of memref_t records from the start of the trace to this point. This includes records skipped over and not presented to any tool. It does not include synthetic records (see is_record_synthetic()).

Implemented in dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t, dynamorio::drmemtrace::default_memtrace_stream_t, dynamorio::drmemtrace::record_reader_t, and dynamorio::drmemtrace::reader_t.

◆ get_schedule_statistic()

virtual double dynamorio::drmemtrace::memtrace_stream_t::get_schedule_statistic ( schedule_statistic_t  stat) const
inlinevirtual

Returns the value of the specified statistic for this output stream. The values for all output stream must be summed to obtain global counts. Returns -1 if statistics are not supported for this stream.

Reimplemented in dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t.

◆ get_shard_index()

virtual int dynamorio::drmemtrace::memtrace_stream_t::get_shard_index ( ) const
inlinevirtual

Returns the 0-based ordinal for the current shard. For parallel analysis, this equals the shard_index passed to parallel_shard_init_stream(). This is more useful for serial modes where there is no other convenience mechanism to determine such an index; it allows a tool to compute per-shard results even in serial mode. The shard orderings in serial mode may not always mach the ordering in parallel mode. If not implemented, -1 is returned.

Reimplemented in dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t, and dynamorio::drmemtrace::default_memtrace_stream_t.

◆ get_stream_name()

virtual std::string dynamorio::drmemtrace::memtrace_stream_t::get_stream_name ( ) const
pure virtual

Returns a name for the memtrace 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.

Implemented in dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t, dynamorio::drmemtrace::default_memtrace_stream_t, and dynamorio::drmemtrace::record_file_reader_t< T >.

◆ get_tid()

virtual int64_t dynamorio::drmemtrace::memtrace_stream_t::get_tid ( ) const
inlinevirtual

Returns the thread identifier for the current input trace. This is a convenience method for use in parallel_shard_init_stream() prior to access to any memref_t records.

Reimplemented in dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t, and dynamorio::drmemtrace::default_memtrace_stream_t.

◆ get_version()

virtual uint64_t dynamorio::drmemtrace::memtrace_stream_t::get_version ( ) const
pure virtual

◆ get_workload_id()

virtual int64_t dynamorio::drmemtrace::memtrace_stream_t::get_workload_id ( ) const
inlinevirtual

Returns a unique identifier for the current workload. This might be an ordinal from the list of active workloads, or some other identifier. This is guaranteed to be unique among all inputs, unlike the process and thread identifiers in memref_t. If not implemented for the current mode, -1 is returned.

Reimplemented in dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t, and dynamorio::drmemtrace::default_memtrace_stream_t.

◆ is_record_kernel()

virtual bool dynamorio::drmemtrace::memtrace_stream_t::is_record_kernel ( ) const
inlinevirtual

Returns whether the current record is from a part of the trace corresponding to kernel execution.

Reimplemented in dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t, dynamorio::drmemtrace::record_reader_t, and dynamorio::drmemtrace::reader_t.

◆ is_record_synthetic()

virtual bool dynamorio::drmemtrace::memtrace_stream_t::is_record_synthetic ( ) const
inlinevirtual

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 count toward the record count and get_record_ordinal() will return the value of the prior record.

Reimplemented in dynamorio::drmemtrace::scheduler_tmpl_t< RecordType, ReaderType >::stream_t, and dynamorio::drmemtrace::reader_t.


The documentation for this class was generated from the following file:
  • /home/runner/work/dynamorio/dynamorio/build_release-64/clients/include/drmemtrace/memtrace_stream.h