DynamoRIO
analyzer_tmpl_t< RecordType, ReaderType > Class Template Reference

#include <analyzer.h>

Inherited by analyzer_multi_t.

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, 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, int verbosity=0)
 
virtual bool run ()
 
virtual bool print_stats ()
 

Detailed Description

template<typename RecordType, typename ReaderType>
class 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: memref_t or trace_entry_t. ReaderType is the reader that allows reading entries of type T: reader_t or dynamorio::drmemtrace::record_reader_t respectively.

analyzer_tmpl_t<memref_t, reader_t> is the primary type of analyzer, which is used for most purposes. It uses tools of type analysis_tool_tmpl_t<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 memref_t.

analyzer_tmpl_t<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 analysis_tool_tmpl_t<trace_entry_t>.

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

Constructor & Destructor Documentation

◆ analyzer_tmpl_t() [1/4]

template<typename RecordType , typename ReaderType >
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 analyzer_tmpl_t< RecordType, ReaderType >::~analyzer_tmpl_t ( )
virtual

Destructor.

◆ analyzer_tmpl_t() [2/4]

template<typename RecordType , typename ReaderType >
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,
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 >
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 analyzer_tmpl_t< RecordType, ReaderType >::~analyzer_tmpl_t ( )
virtual

Destructor.

◆ analyzer_tmpl_t() [4/4]

template<typename RecordType , typename ReaderType >
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,
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 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 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 analyzer_tmpl_t< RecordType, ReaderType >::operator! ( )
virtual

Returns whether the analyzer was created successfully.

◆ operator!() [2/2]

template<typename RecordType , typename ReaderType >
virtual bool 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 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 analyzer_tmpl_t< RecordType, ReaderType >::print_stats ( )
virtual

Presents the results of the analysis.

◆ run() [1/2]

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

Launches the analysis process.

◆ run() [2/2]

template<typename RecordType , typename ReaderType >
virtual bool 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