All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
S_module Class Reference
Collaboration diagram for S_module:

Public Member Functions

 S_module ()
 
void clear ()
 
void init (const char *name, const char *architecture, const char *event_name, unsigned int c_mask, unsigned int inv_mask, unsigned int smpl_period)
 
void set_total (unsigned int total)
 
unsigned int get_smpl_period ()
 
unsigned int get_inv_mask ()
 
unsigned int get_c_mask ()
 
std::string get_arch ()
 
std::string get_event ()
 
void add_sample (const char *index, unsigned int value)
 
bool get_max (char *index, unsigned int *value)
 
std::string get_module_name ()
 
unsigned int get_total_num_samples ()
 

Private Attributes

std::map< std::string,
unsigned int > 
samples
 
unsigned int total_num_samples
 
std::string module_name
 
std::string arch
 
std::string event
 
unsigned int cmask
 
unsigned int inv
 
unsigned int sp
 

Detailed Description

Definition at line 723 of file pfm_gen_analysis.cpp.

Constructor & Destructor Documentation

S_module::S_module ( )
inline

Definition at line 736 of file pfm_gen_analysis.cpp.

737  {
738  clear();
739  }

Member Function Documentation

void S_module::add_sample ( const char *  index,
unsigned int  value 
)
inline

Definition at line 784 of file pfm_gen_analysis.cpp.

785  {
786  samples[index] += value;
787  return;
788  }
std::map< std::string, unsigned int > samples
void S_module::clear ( )
inline

Definition at line 740 of file pfm_gen_analysis.cpp.

741  {
742  samples.clear();
743  total_num_samples = 0;
744  sp = 0;
745  module_name = "";
746  cmask = 0;
747  inv = 0;
748  sp = 0;
749  }
std::string module_name
std::map< std::string, unsigned int > samples
unsigned int sp
unsigned int cmask
unsigned int total_num_samples
unsigned int inv
std::string S_module::get_arch ( )
inline

Definition at line 776 of file pfm_gen_analysis.cpp.

777  {
778  return arch;
779  }
std::string arch
unsigned int S_module::get_c_mask ( )
inline

Definition at line 772 of file pfm_gen_analysis.cpp.

773  {
774  return cmask;
775  }
unsigned int cmask
std::string S_module::get_event ( )
inline

Definition at line 780 of file pfm_gen_analysis.cpp.

781  {
782  return event;
783  }
std::string event
unsigned int S_module::get_inv_mask ( )
inline

Definition at line 768 of file pfm_gen_analysis.cpp.

769  {
770  return inv;
771  }
unsigned int inv
bool S_module::get_max ( char *  index,
unsigned int *  value 
)
inline

Definition at line 789 of file pfm_gen_analysis.cpp.

790  {
791  if(samples.empty()) return false;
792  unsigned int cur_max = 0;
793  std::map<std::string, unsigned int>::iterator max_pos;
794  for(std::map<std::string, unsigned int>::iterator it = samples.begin(); it != samples.end(); ++it)
795  {
796  if(it->second > cur_max)
797  {
798  cur_max = it->second;
799  max_pos = it;
800  }
801  }
802  strcpy(index, (max_pos->first).c_str());
803  *value = max_pos->second;
804  samples.erase(max_pos);
805  return true;
806  }
std::map< std::string, unsigned int > samples
std::string S_module::get_module_name ( )
inline

Definition at line 807 of file pfm_gen_analysis.cpp.

808  {
809  return module_name;
810  }
std::string module_name
unsigned int S_module::get_smpl_period ( )
inline

Definition at line 764 of file pfm_gen_analysis.cpp.

765  {
766  return sp;
767  }
unsigned int sp
unsigned int S_module::get_total_num_samples ( )
inline

Definition at line 811 of file pfm_gen_analysis.cpp.

812  {
813  return total_num_samples;
814  }
unsigned int total_num_samples
void S_module::init ( const char *  name,
const char *  architecture,
const char *  event_name,
unsigned int  c_mask,
unsigned int  inv_mask,
unsigned int  smpl_period 
)
inline

Definition at line 750 of file pfm_gen_analysis.cpp.

751  {
752  module_name = name;
753  arch = architecture;
754  event = event_name;
755  cmask = c_mask;
756  inv = inv_mask;
757  sp = smpl_period;
758  }
std::string module_name
unsigned int sp
unsigned int cmask
std::string arch
unsigned int inv
void S_module::set_total ( unsigned int  total)
inline

Definition at line 759 of file pfm_gen_analysis.cpp.

760  {
761  total_num_samples = total;
762  return;
763  }
unsigned int total_num_samples

Member Data Documentation

std::string S_module::arch
private

Definition at line 729 of file pfm_gen_analysis.cpp.

unsigned int S_module::cmask
private

Definition at line 731 of file pfm_gen_analysis.cpp.

std::string S_module::event
private

Definition at line 730 of file pfm_gen_analysis.cpp.

unsigned int S_module::inv
private

Definition at line 732 of file pfm_gen_analysis.cpp.

std::string S_module::module_name
private

Definition at line 728 of file pfm_gen_analysis.cpp.

std::map<std::string, unsigned int> S_module::samples
private

Definition at line 726 of file pfm_gen_analysis.cpp.

unsigned int S_module::sp
private

Definition at line 733 of file pfm_gen_analysis.cpp.

unsigned int S_module::total_num_samples
private

Definition at line 727 of file pfm_gen_analysis.cpp.


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