00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef PROFILE_SPEC_H
00012 #define PROFILE_SPEC_H
00013
00014 #include <map>
00015 #include <vector>
00016 #include <list>
00017
00018 #include "filename_spec.h"
00019 #include "comma_list.h"
00020 #include "locate_images.h"
00021
00022
00023
00024
00025
00026
00027
00028
00029 class profile_spec
00030 {
00031 public:
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 static profile_spec create(std::list<std::string> const & args,
00042 std::vector<std::string> const & image_path,
00043 std::string const & root_path);
00044
00045
00046
00047
00048
00049
00050
00051 std::list<std::string>
00052 generate_file_list(bool exclude_dependent, bool exclude_cg) const;
00053
00054
00055
00056
00057
00058
00059 bool match(filename_spec const & file_spec) const;
00060
00061
00062
00063
00064
00065 std::string get_archive_path() const;
00066
00067 private:
00068 profile_spec();
00069
00070
00071
00072
00073
00074 void parse(std::string const & tag_value);
00075
00076
00077
00078
00079
00080
00081
00082 void set_image_or_lib_name(std::string const & image);
00083
00084
00085
00086
00087
00088
00089 bool is_valid_tag(std::string const & str);
00090
00091
00092
00093
00094 void parse_archive_path(std::string const &);
00095 void parse_session(std::string const &);
00096 void parse_session_exclude(std::string const &);
00097 void parse_image(std::string const &);
00098 void parse_image_exclude(std::string const &);
00099 void parse_lib_image(std::string const &);
00100 void parse_event(std::string const &);
00101 void parse_count(std::string const &);
00102 void parse_unitmask(std::string const &);
00103 void parse_tid(std::string const &);
00104 void parse_tgid(std::string const &);
00105 void parse_cpu(std::string const &);
00106
00107 typedef void (profile_spec::*action_t)(std::string const &);
00108 typedef std::map<std::string, action_t> parse_table_t;
00109 parse_table_t parse_table;
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119 action_t get_handler(std::string const & tag_value,
00120 std::string & value);
00121
00122 std::string archive_path;
00123 std::string binary;
00124 std::vector<std::string> session;
00125 std::vector<std::string> session_exclude;
00126 std::vector<std::string> image;
00127 std::vector<std::string> image_exclude;
00128 std::vector<std::string> lib_image;
00129 comma_list<std::string> event;
00130 comma_list<int> count;
00131 comma_list<unsigned int> unitmask;
00132 comma_list<pid_t> tid;
00133 comma_list<pid_t> tgid;
00134 comma_list<int> cpu;
00135
00136 std::vector<std::string> image_or_lib_image;
00137
00138 public:
00139
00140 extra_images extra_found_images;
00141 };
00142
00143 #endif