DynamoRIO
dynamorio::drmemtrace::analyzer_tmpl_t< RecordType, ReaderType > Class Template Reference

#include <analyzer.h>

Inherited by dynamorio::drmemtrace::analyzer_multi_tmpl_t< RecordType, ReaderType >.

Public Member Functions

 analyzer_tmpl_t ()
 
virtual ~analyzer_tmpl_t ()
 
virtual bool operator! ()
 
virtual std::string get_error_string ()
 
 analyzer_tmpl_t (const std::string &trace_path, analysis_tool_tmpl_t< RecordType > **tools, int num_tools, int worker_count=0, uint64_t skip_instrs=0, uint64_t interval_microseconds=0, uint64_t interval_instr_count=0, int verbosity=0)
 
virtual bool run ()
 
virtual bool print_stats ()
 
 analyzer_tmpl_t ()
 
virtual ~analyzer_tmpl_t ()
 
virtual bool operator! ()
 
virtual std::string get_error_string ()
 
 analyzer_tmpl_t (const std::string &trace_path, analysis_tool_tmpl_t< RecordType > **tools, int num_tools, int worker_count=0, uint64_t skip_instrs=0, uint64_t interval_microseconds=0, uint64_t interval_instr_count=0, int verbosity=0)
 
virtual bool run ()
 
virtual bool print_stats ()
 

Detailed Description

template<typename RecordType, typename ReaderType>
class dynamorio::drmemtrace::analyzer_tmpl_t< RecordType, ReaderType >

An analyzer is the top-level driver of a set of trace analysis tools. It supports two different modes of operation: either it iterates over the trace and calls the process_memref() routine of each tool, or it exposes an iteration interface to external control code.

RecordType is the type of entry to be analyzed: dynamorio::drmemtrace::memref_t or dynamorio::drmemtrace::trace_entry_t. ReaderType is the reader that allows reading entries of type T: dynamorio::drmemtrace::reader_t or dynamorio::drmemtrace::record_reader_t respectively.

dynamorio::drmemtrace::analyzer_tmpl_t<dynamorio::drmemtrace::memref_t, dynamorio::drmemtrace::reader_t> is the primary type of analyzer, which is used for most purposes. It uses tools of type dynamorio::drmemtrace::analysis_tool_tmpl_t<dynamorio::drmemtrace::memref_t>. This analyzer provides various features to support trace analysis, e.g. processing the instruction encoding entries and making it available to the tool inside dynamorio::drmemtrace::memref_t.

dynamorio::drmemtrace::analyzer_tmpl_t<dynamorio::drmemtrace::trace_entry_t, dynamorio::drmemtrace::record_reader_t> is used in special cases where an offline trace needs to be observed exactly as stored on disk, without hiding any internal entries. It uses tools of type dynamorio::drmemtrace::analysis_tool_tmpl_t<dynamorio::drmemtrace::trace_entry_t>.

TODO i#5727: When we convert dynamorio::drmemtrace::reader_t into a template on RecordType, we can remove the second template parameter to dynamorio::drmemtrace::analyzer_tmpl_t, and simply use reader_tmpl_t<RecordType> instead.

Constructor & Destructor Documentation

◆ analyzer_tmpl_t() [1/4]

template<typename RecordType , typename ReaderType >
dynamorio::drmemtrace::analyzer_tmpl_t< RecordType, ReaderType >::analyzer_tmpl_t ( )

Usage: errors encountered during a constructor will set a flag that should be queried via operator!(). If operator!() returns true, get_error_string() can be used to try to obtain more information.

◆ ~analyzer_tmpl_t() [1/2]

template<typename RecordType , typename ReaderType >
virtual dynamorio::drmemtrace::analyzer_tmpl_t< RecordType, ReaderType >::~analyzer_tmpl_t ( )
virtual

Destructor.

◆ analyzer_tmpl_t() [2/4]

template<typename RecordType , typename ReaderType >
dynamorio::drmemtrace::analyzer_tmpl_t< RecordType, ReaderType >::analyzer_tmpl_t ( const std::string &  trace_path,
analysis_tool_tmpl_t< RecordType > **  tools,
int  num_tools,
int  worker_count = 0,
uint64_t  skip_instrs = 0,
uint64_t  interval_microseconds = 0,
uint64_t  interval_instr_count = 0,
int  verbosity = 0 
)

The analyzer usage model supports multiple tools, with the trace iteration performed by analyzer_t. It supports parallel trace analysis. The analyzer will reference the tools array passed in during its lifetime: it does not make a copy. The user must free them afterward. The analyzer calls the initialize_stream() function on each tool before use.

◆ analyzer_tmpl_t() [3/4]

template<typename RecordType , typename ReaderType >
dynamorio::drmemtrace::analyzer_tmpl_t< RecordType, ReaderType >::analyzer_tmpl_t ( )

Usage: errors encountered during a constructor will set a flag that should be queried via operator!(). If operator!() returns true, get_error_string() can be used to try to obtain more information.

◆ ~analyzer_tmpl_t() [2/2]

template<typename RecordType , typename ReaderType >
virtual dynamorio::drmemtrace::analyzer_tmpl_t< RecordType, ReaderType >::~analyzer_tmpl_t ( )
virtual

Destructor.

◆ analyzer_tmpl_t() [4/4]

template<typename RecordType , typename ReaderType >
dynamorio::drmemtrace::analyzer_tmpl_t< RecordType, ReaderType >::analyzer_tmpl_t ( const std::string &  trace_path,
analysis_tool_tmpl_t< RecordType > **  tools,
int  num_tools,
int  worker_count = 0,
uint64_t  skip_instrs = 0,
uint64_t  interval_microseconds = 0,
uint64_t  interval_instr_count = 0,
int  verbosity = 0 
)

The analyzer usage model supports multiple tools, with the trace iteration performed by analyzer_t. It supports parallel trace analysis. The analyzer will reference the tools array passed in during its lifetime: it does not make a copy. The user must free them afterward. The analyzer calls the initialize_stream() function on each tool before use.

Member Function Documentation

◆ get_error_string() [1/2]

template<typename RecordType , typename ReaderType >
virtual std::string dynamorio::drmemtrace::analyzer_tmpl_t< RecordType, ReaderType >::get_error_string ( )
virtual

Returns further information on an error in initializing the analyzer.

◆ get_error_string() [2/2]

template<typename RecordType , typename ReaderType >
virtual std::string dynamorio::drmemtrace::analyzer_tmpl_t< RecordType, ReaderType >::get_error_string ( )
virtual

Returns further information on an error in initializing the analyzer.

◆ operator!() [1/2]

template<typename RecordType , typename ReaderType >
virtual bool dynamorio::drmemtrace::analyzer_tmpl_t< RecordType, ReaderType >::operator! ( )
virtual

Returns whether the analyzer was created successfully.

◆ operator!() [2/2]

template<typename RecordType , typename ReaderType >
virtual bool dynamorio::drmemtrace::analyzer_tmpl_t< RecordType, ReaderType >::operator! ( )
virtual

Returns whether the analyzer was created successfully.

◆ print_stats() [1/2]

template<typename RecordType , typename ReaderType >
virtual bool dynamorio::drmemtrace::analyzer_tmpl_t< RecordType, ReaderType >::print_stats ( )
virtual

Presents the results of the analysis.

◆ print_stats() [2/2]

template<typename RecordType , typename ReaderType >
virtual bool dynamorio::drmemtrace::analyzer_tmpl_t< RecordType, ReaderType >::print_stats ( )
virtual

Presents the results of the analysis.

◆ run() [1/2]

template<typename RecordType , typename ReaderType >
virtual bool dynamorio::drmemtrace::analyzer_tmpl_t< RecordType, ReaderType >::run ( )
virtual

Launches the analysis process.

◆ run() [2/2]

template<typename RecordType , typename ReaderType >
virtual bool dynamorio::drmemtrace::analyzer_tmpl_t< RecordType, ReaderType >::run ( )
virtual

Launches the analysis process.


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