operf_process_info Class Reference

#include <operf_process_info.h>

Collaboration diagram for operf_process_info:
Collaboration graph
[legend]

Public Member Functions

 operf_process_info (pid_t tgid, const char *appname, bool app_arg_is_fullname, bool is_valid)
 ~operf_process_info (void)
bool is_valid (void)
bool is_forked (void)
void process_new_mapping (struct operf_mmap *mapping)
void process_hypervisor_mapping (u64 ip)
void process_deferred_mappings (std::string app_shortname)
void connect_forked_process_to_parent (operf_process_info *parent)
void copy_new_parent_mapping (struct operf_mmap *mapping)
void add_forked_pid_association (operf_process_info *forked_pid)
void copy_mappings_to_forked_process (operf_process_info *forked_pid)
void disassociate_from_parent (char *appname)
void remove_forked_process (pid_t forked_pid)
std::string get_app_name (void)
void add_deferred_mapping (struct operf_mmap *mapping)
struct operf_mmapfind_mapping_for_sample (u64 sample_addr)
bool is_appname_valid (void)

Private Types

enum  op_fullname_t { NOT_FULLNAME, MAYBE_FULLNAME, YES_FULLNAME }

Private Member Functions

int get_num_matching_chars (std::string mapped_filename, std::string &basename)
void process_deferred_forked_processes (void)

Private Attributes

pid_t pid
std::string _appname
bool valid
bool forked
op_fullname_t appname_is_fullname
std::string app_basename
int num_app_chars_matched
std::map< u64, struct
operf_mmap * > 
mmappings
std::map< u64, struct
operf_mmap * > 
deferred_mmappings
std::vector< operf_process_info * > forked_processes
operf_process_infoparent_of_fork

Detailed Description

Definition at line 52 of file operf_process_info.h.


Member Enumeration Documentation

Enumerator:
NOT_FULLNAME 
MAYBE_FULLNAME 
YES_FULLNAME 

Definition at line 99 of file operf_process_info.h.


Constructor & Destructor Documentation

operf_process_info::operf_process_info ( pid_t  tgid,
const char *  appname,
bool  app_arg_is_fullname,
bool  is_valid 
)

Definition at line 25 of file operf_process_info.cpp.

References app_basename, appname_is_fullname, forked, MAYBE_FULLNAME, NOT_FULLNAME, num_app_chars_matched, op_basename(), parent_of_fork, and YES_FULLNAME.

Here is the call graph for this function:

operf_process_info::~operf_process_info ( void   ) 

Definition at line 45 of file operf_process_info.cpp.

References deferred_mmappings, mmappings, and valid.


Member Function Documentation

void operf_process_info::add_deferred_mapping ( struct operf_mmap mapping  )  [inline]

Definition at line 70 of file operf_process_info.h.

References deferred_mmappings, and operf_mmap::start_addr.

Referenced by __handle_mmap_event(), and process_hypervisor_mapping().

Here is the caller graph for this function:

void operf_process_info::add_forked_pid_association ( operf_process_info forked_pid  )  [inline]

Definition at line 64 of file operf_process_info.h.

References forked_processes.

Referenced by __handle_fork_event().

Here is the caller graph for this function:

void operf_process_info::connect_forked_process_to_parent ( operf_process_info parent  ) 
void operf_process_info::copy_mappings_to_forked_process ( operf_process_info forked_pid  ) 

Definition at line 230 of file operf_process_info.cpp.

References mmappings, and process_new_mapping().

Referenced by connect_forked_process_to_parent().

Here is the call graph for this function:

Here is the caller graph for this function:

void operf_process_info::copy_new_parent_mapping ( struct operf_mmap mapping  )  [inline]

Definition at line 62 of file operf_process_info.h.

References mmappings, and operf_mmap::start_addr.

Referenced by process_new_mapping().

Here is the caller graph for this function:

void operf_process_info::disassociate_from_parent ( char *  appname  ) 

Definition at line 299 of file operf_process_info.cpp.

References _appname, appname_is_fullname, mmappings, NOT_FULLNAME, num_app_chars_matched, parent_of_fork, pid, process_new_mapping(), remove_forked_process(), and valid.

Here is the call graph for this function:

struct operf_mmap * operf_process_info::find_mapping_for_sample ( u64  sample_addr  )  [read]

Definition at line 144 of file operf_process_info.cpp.

References mmappings.

Referenced by __get_operf_trans().

Here is the caller graph for this function:

std::string operf_process_info::get_app_name ( void   )  [inline]

Definition at line 69 of file operf_process_info.h.

References _appname.

Referenced by __get_operf_trans(), __handle_fork_event(), and connect_forked_process_to_parent().

Here is the caller graph for this function:

int operf_process_info::get_num_matching_chars ( std::string  mapped_filename,
std::string &  basename 
) [private]

Referenced by process_new_mapping().

Here is the caller graph for this function:

bool operf_process_info::is_appname_valid ( void   )  [inline]

Definition at line 83 of file operf_process_info.h.

References appname_is_fullname, MAYBE_FULLNAME, num_app_chars_matched, valid, and YES_FULLNAME.

Referenced by __handle_fork_event(), and connect_forked_process_to_parent().

Here is the caller graph for this function:

bool operf_process_info::is_forked ( void   )  [inline]

Definition at line 57 of file operf_process_info.h.

References forked.

bool operf_process_info::is_valid ( void   )  [inline]

Definition at line 56 of file operf_process_info.h.

References valid.

Referenced by __handle_fork_event(), and connect_forked_process_to_parent().

Here is the caller graph for this function:

void operf_process_info::process_deferred_forked_processes ( void   )  [private]

Definition at line 268 of file operf_process_info.cpp.

References connect_forked_process_to_parent(), cverb, forked_processes, pid, and vmisc.

Here is the call graph for this function:

void operf_process_info::process_deferred_mappings ( std::string  app_shortname  ) 
void operf_process_info::process_hypervisor_mapping ( u64  ip  ) 

Hypervisor samples cannot be attributed to any real binary, so we synthesize an operf_mmap object with the name of "[hypervisor_bucket]". We mark this mmaping as "is_anon" so that hypervisor samples are handled in the same way as anon samples (and vdso, heap, and stack) -- i.e., a sample file is created with the following pieces of information in its name:

  • [hypervisor_bucket]
  • PID
  • address range

The address range part is problematic for hypervisor samples, since we don't know the range of sample addresses until we process all the samples. This is why we need to adjust the hypervisor_mmaping when we detect an ip that's outside of the current address range. This is also why we defer processing hypervisor samples the first time through the processing of sample data. See operf_utils::__handle_sample_event for details relating to how we defer processing of such samples.

Definition at line 173 of file operf_process_info.cpp.

References add_deferred_mapping(), cverb, deferred_mmappings, operf_mmap::end_addr, operf_mmap::filename, operf_mmap::is_anon_mapping, operf_mmap::is_hypervisor, mmappings, operf_mmap::pgoff, process_new_mapping(), operf_mmap::start_addr, valid, and vmisc.

Referenced by __map_hypervisor_sample().

Here is the call graph for this function:

Here is the caller graph for this function:

void operf_process_info::process_new_mapping ( struct operf_mmap mapping  ) 
void operf_process_info::remove_forked_process ( pid_t  forked_pid  ) 

Definition at line 279 of file operf_process_info.cpp.

References forked_processes.

Referenced by disassociate_from_parent().

Here is the caller graph for this function:


Field Documentation

std::string operf_process_info::_appname [private]
std::string operf_process_info::app_basename [private]

Definition at line 109 of file operf_process_info.h.

Referenced by operf_process_info(), and process_new_mapping().

std::map<u64, struct operf_mmap *> operf_process_info::deferred_mmappings [private]
std::map<u64, struct operf_mmap *> operf_process_info::mmappings [private]
pid_t operf_process_info::pid [private]
bool operf_process_info::valid [private]

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

Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1