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 724 of file pfm_gen_analysis.cpp.

Constructor & Destructor Documentation

S_module::S_module ( )
inline

Definition at line 737 of file pfm_gen_analysis.cpp.

738  {
739  clear();
740  }

Member Function Documentation

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

Definition at line 785 of file pfm_gen_analysis.cpp.

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

Definition at line 741 of file pfm_gen_analysis.cpp.

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

Definition at line 777 of file pfm_gen_analysis.cpp.

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

Definition at line 773 of file pfm_gen_analysis.cpp.

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

Definition at line 781 of file pfm_gen_analysis.cpp.

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

Definition at line 769 of file pfm_gen_analysis.cpp.

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

Definition at line 790 of file pfm_gen_analysis.cpp.

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

Definition at line 808 of file pfm_gen_analysis.cpp.

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

Definition at line 765 of file pfm_gen_analysis.cpp.

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

Definition at line 812 of file pfm_gen_analysis.cpp.

813  {
814  return total_num_samples;
815  }
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 751 of file pfm_gen_analysis.cpp.

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

Definition at line 760 of file pfm_gen_analysis.cpp.

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

Member Data Documentation

std::string S_module::arch
private

Definition at line 730 of file pfm_gen_analysis.cpp.

unsigned int S_module::cmask
private

Definition at line 732 of file pfm_gen_analysis.cpp.

std::string S_module::event
private

Definition at line 731 of file pfm_gen_analysis.cpp.

unsigned int S_module::inv
private

Definition at line 733 of file pfm_gen_analysis.cpp.

std::string S_module::module_name
private

Definition at line 729 of file pfm_gen_analysis.cpp.

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

Definition at line 727 of file pfm_gen_analysis.cpp.

unsigned int S_module::sp
private

Definition at line 734 of file pfm_gen_analysis.cpp.

unsigned int S_module::total_num_samples
private

Definition at line 728 of file pfm_gen_analysis.cpp.


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