profile_spec Class Reference

#include <profile_spec.h>

Collaboration diagram for profile_spec:
Collaboration graph
[legend]

Public Member Functions

std::list< std::string > generate_file_list (bool exclude_dependent, bool exclude_cg) const
bool match (filename_spec const &file_spec) const
std::string get_archive_path () const

Static Public Member Functions

static profile_spec create (std::list< std::string > const &args, std::vector< std::string > const &image_path, std::string const &root_path)

Data Fields

extra_images extra_found_images
 extra search path for images

Private Types

typedef void(profile_spec::* action_t )(std::string const &)
typedef std::map< std::string,
action_t
parse_table_t

Private Member Functions

 profile_spec ()
void parse (std::string const &tag_value)
void set_image_or_lib_name (std::string const &image)
bool is_valid_tag (std::string const &str)
void parse_archive_path (std::string const &)
void parse_session (std::string const &)
void parse_session_exclude (std::string const &)
void parse_image (std::string const &)
void parse_image_exclude (std::string const &)
void parse_lib_image (std::string const &)
void parse_event (std::string const &)
void parse_count (std::string const &)
void parse_unitmask (std::string const &)
void parse_tid (std::string const &)
void parse_tgid (std::string const &)
void parse_cpu (std::string const &)
action_t get_handler (std::string const &tag_value, std::string &value)

Private Attributes

parse_table_t parse_table
std::string archive_path
std::string binary
std::vector< std::string > session
std::vector< std::string > session_exclude
std::vector< std::string > image
std::vector< std::string > image_exclude
std::vector< std::string > lib_image
comma_list< std::string > event
comma_list< int > count
comma_list< unsigned int > unitmask
comma_list< pid_t > tid
comma_list< pid_t > tgid
comma_list< int > cpu
std::vector< std::string > image_or_lib_image

Detailed Description

Holds a parsed profile spec composed of tag:value pairs, as given in pp_interface documentation.

Definition at line 29 of file profile_spec.h.


Member Typedef Documentation

typedef void(profile_spec::* profile_spec::action_t)(std::string const &) [private]

Definition at line 107 of file profile_spec.h.

typedef std::map<std::string, action_t> profile_spec::parse_table_t [private]

Definition at line 108 of file profile_spec.h.


Constructor & Destructor Documentation

profile_spec::profile_spec (  )  [private]

Member Function Documentation

static profile_spec profile_spec::create ( std::list< std::string > const &  args,
std::vector< std::string > const &  image_path,
std::string const &  root_path 
) [static]
Parameters:
args a vector of non options strings
extra extra image paths to search

Factory returning a profile_spec instance storing all valid tag:value contained in args vector doing also alias substitution, non-valid tag:value options are considered as image:value

Referenced by handle_options().

Here is the caller graph for this function:

list< string > profile_spec::generate_file_list ( bool  exclude_dependent,
bool  exclude_cg 
) const
Parameters:
exclude_dependent whether to exclude dependent sub-images
exclude_cg whether to exclude call graph file

Use the spec to generate the list of candidate sample files.

Definition at line 501 of file profile_spec.cpp.

References archive_path, create_file_list(), op_realpath(), and op_samples_dir.

Referenced by handle_options().

Here is the call graph for this function:

Here is the caller graph for this function:

string profile_spec::get_archive_path (  )  const

return archive name returns an empty string if not using an archive.

Definition at line 108 of file profile_spec.cpp.

References archive_path.

Referenced by handle_options().

Here is the caller graph for this function:

action_t profile_spec::get_handler ( std::string const &  tag_value,
std::string &  value 
) [private]
Parameters:
tag_value input "tag:value" string
value if success return the value part of tag_value helper for set/is_valid_tag public interface

return null if tag is not valid, else return the pointer to member function to apply and the value in value parameter

bool profile_spec::is_valid_tag ( std::string const &  str  )  [private]
Parameters:
str a "tag:value"

return true if tag is a valid tag

bool profile_spec::match ( filename_spec const &  file_spec  )  const
Parameters:
file_spec the filename specification to check

return true if filename match the spec. PP:3.24 internal loop

Definition at line 224 of file profile_spec.cpp.

References filename_spec::count, count, filename_spec::cpu, cpu, filename_spec::event, event, extra_found_images, image, filename_spec::image, image_exclude, image_or_lib_image, lib_image, filename_spec::lib_image, comma_list< T >::match(), glob_filter::match(), filename_spec::tgid, tgid, filename_spec::tid, tid, filename_spec::unitmask, and unitmask.

Here is the call graph for this function:

void profile_spec::parse ( std::string const &  tag_value  )  [private]
Parameters:
tag_value a "tag:value" to interpret, all error throw an invalid_argument exception.
void profile_spec::parse_archive_path ( std::string const &   )  [private]

implement tag parsing: PP:3.3 to 3.16

Referenced by profile_spec().

Here is the caller graph for this function:

void profile_spec::parse_count ( std::string const &   )  [private]

Referenced by profile_spec().

Here is the caller graph for this function:

void profile_spec::parse_cpu ( std::string const &   )  [private]

Referenced by profile_spec().

Here is the caller graph for this function:

void profile_spec::parse_event ( std::string const &   )  [private]

Referenced by profile_spec().

Here is the caller graph for this function:

void profile_spec::parse_image ( std::string const &   )  [private]

Referenced by profile_spec().

Here is the caller graph for this function:

void profile_spec::parse_image_exclude ( std::string const &   )  [private]

Referenced by profile_spec().

Here is the caller graph for this function:

void profile_spec::parse_lib_image ( std::string const &   )  [private]

Referenced by profile_spec().

Here is the caller graph for this function:

void profile_spec::parse_session ( std::string const &   )  [private]

Referenced by profile_spec().

Here is the caller graph for this function:

void profile_spec::parse_session_exclude ( std::string const &   )  [private]

Referenced by profile_spec().

Here is the caller graph for this function:

void profile_spec::parse_tgid ( std::string const &   )  [private]

Referenced by profile_spec().

Here is the caller graph for this function:

void profile_spec::parse_tid ( std::string const &   )  [private]

Referenced by profile_spec().

Here is the caller graph for this function:

void profile_spec::parse_unitmask ( std::string const &   )  [private]

Referenced by profile_spec().

Here is the caller graph for this function:

void profile_spec::set_image_or_lib_name ( std::string const &  image  )  [private]
Parameters:
image an image or a libray name given on command line

Used for e.g. "opreport /bin/mybinary". We don't know yet if this is an application or a dependent image.


Field Documentation

std::string profile_spec::archive_path [private]

Definition at line 122 of file profile_spec.h.

Referenced by generate_file_list(), and get_archive_path().

std::string profile_spec::binary [private]

Definition at line 123 of file profile_spec.h.

Definition at line 130 of file profile_spec.h.

Referenced by match().

comma_list<int> profile_spec::cpu [private]

Definition at line 134 of file profile_spec.h.

Referenced by match().

comma_list<std::string> profile_spec::event [private]

Definition at line 129 of file profile_spec.h.

Referenced by match().

extra search path for images

Definition at line 140 of file profile_spec.h.

Referenced by handle_options(), and match().

std::vector<std::string> profile_spec::image [private]

Definition at line 126 of file profile_spec.h.

Referenced by match().

std::vector<std::string> profile_spec::image_exclude [private]

Definition at line 127 of file profile_spec.h.

Referenced by match().

std::vector<std::string> profile_spec::image_or_lib_image [private]

Definition at line 136 of file profile_spec.h.

Referenced by match().

std::vector<std::string> profile_spec::lib_image [private]

Definition at line 128 of file profile_spec.h.

Referenced by match().

Definition at line 109 of file profile_spec.h.

Referenced by profile_spec().

std::vector<std::string> profile_spec::session [private]

Definition at line 124 of file profile_spec.h.

std::vector<std::string> profile_spec::session_exclude [private]

Definition at line 125 of file profile_spec.h.

comma_list<pid_t> profile_spec::tgid [private]

Definition at line 133 of file profile_spec.h.

Referenced by match().

comma_list<pid_t> profile_spec::tid [private]

Definition at line 132 of file profile_spec.h.

Referenced by match().

comma_list<unsigned int> profile_spec::unitmask [private]

Definition at line 131 of file profile_spec.h.

Referenced by match().


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

Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1