GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
profiler Class Reference

#include "profiler.h"

Collaboration diagram for profiler:

Classes

class  enter
 
struct  stats
 
class  tree_node
 

Public Member Functions

 profiler (const profiler &)=delete
 
 profiler (void)
 
virtual ~profiler (void)
 
bool enabled (void) const
 
octave_value get_flat (void) const
 
octave_value get_hierarchical (void) const
 
profileroperator= (const profiler &)=delete
 
void reset (void)
 
void set_active (bool)
 

Private Types

typedef std::map< std::string, octave_idx_typefcn_index_map
 
typedef std::vector< statsflat_profile
 
typedef std::vector< std::string > function_set
 

Private Member Functions

void add_current_time (void)
 
void enter_function (const std::string &)
 
void exit_function (const std::string &)
 
double query_time (void) const
 

Private Attributes

tree_nodem_active_fcn
 
tree_nodem_call_tree
 
bool m_enabled
 
fcn_index_map m_fcn_index
 
function_set m_known_functions
 
double m_last_time
 

Detailed Description

Definition at line 41 of file profiler.h.

Member Typedef Documentation

◆ fcn_index_map

typedef std::map<std::string, octave_idx_type> profiler::fcn_index_map
private

Definition at line 192 of file profiler.h.

◆ flat_profile

typedef std::vector<stats> profiler::flat_profile
private

Definition at line 136 of file profiler.h.

◆ function_set

typedef std::vector<std::string> profiler::function_set
private

Definition at line 191 of file profiler.h.

Constructor & Destructor Documentation

◆ profiler() [1/2]

profiler::profiler ( void  )

Definition at line 175 of file profiler.cc.

◆ profiler() [2/2]

profiler::profiler ( const profiler )
delete

◆ ~profiler()

profiler::~profiler ( void  )
virtual

Definition at line 181 of file profiler.cc.

References m_call_tree.

Member Function Documentation

◆ add_current_time()

void profiler::add_current_time ( void  )
private

Definition at line 375 of file profiler.cc.

References profiler::tree_node::add_time(), m_active_fcn, m_last_time, and query_time().

Referenced by enter_function(), and exit_function().

◆ enabled()

bool profiler::enabled ( void  ) const
inline

◆ enter_function()

void profiler::enter_function ( const std::string &  fcn)
private

◆ exit_function()

void profiler::exit_function ( const std::string &  fcn)
private

◆ get_flat()

octave_value profiler::get_flat ( void  ) const

◆ get_hierarchical()

octave_value profiler::get_hierarchical ( void  ) const

Definition at line 337 of file profiler.cc.

References profiler::tree_node::get_hierarchical(), m, and m_call_tree.

Referenced by F__profiler_data__().

◆ operator=()

profiler& profiler::operator= ( const profiler )
delete

◆ query_time()

double profiler::query_time ( void  ) const
private

Definition at line 363 of file profiler.cc.

Referenced by add_current_time(), enter_function(), and exit_function().

◆ reset()

void profiler::reset ( void  )

Definition at line 256 of file profiler.cc.

References enabled(), error(), m_active_fcn, m_call_tree, m_fcn_index, m_known_functions, and m_last_time.

Referenced by F__profiler_reset__().

◆ set_active()

void profiler::set_active ( bool  value)

Definition at line 187 of file profiler.cc.

References m_enabled.

Referenced by F__profiler_enable__().

Member Data Documentation

◆ m_active_fcn

tree_node* profiler::m_active_fcn
private

Definition at line 200 of file profiler.h.

Referenced by add_current_time(), enter_function(), exit_function(), and reset().

◆ m_call_tree

tree_node* profiler::m_call_tree
private

Definition at line 199 of file profiler.h.

Referenced by ~profiler(), enter_function(), exit_function(), get_flat(), get_hierarchical(), and reset().

◆ m_enabled

bool profiler::m_enabled
private

Definition at line 197 of file profiler.h.

Referenced by set_active().

◆ m_fcn_index

fcn_index_map profiler::m_fcn_index
private

Definition at line 195 of file profiler.h.

Referenced by enter_function(), exit_function(), and reset().

◆ m_known_functions

function_set profiler::m_known_functions
private

Definition at line 194 of file profiler.h.

Referenced by enter_function(), get_flat(), and reset().

◆ m_last_time

double profiler::m_last_time
private

Definition at line 204 of file profiler.h.

Referenced by add_current_time(), enter_function(), exit_function(), and reset().


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