arrange_profiles.h

Go to the documentation of this file.
00001 
00012 #ifndef ARRANGE_PROFILES_H
00013 #define ARRANGE_PROFILES_H
00014 
00015 #include <string>
00016 #include <list>
00017 #include <vector>
00018 #include <iosfwd>
00019 
00020 #include "image_errors.h"
00021 #include "locate_images.h"
00022 
00026 struct merge_option {
00027     bool cpu;
00028     bool lib;
00029     bool tid;
00030     bool tgid;
00031     bool unitmask;
00032 };
00033 
00034 
00039 struct profile_template {
00040     std::string event;
00041     std::string count;
00042     std::string unitmask;
00043     std::string tgid;
00044     std::string tid;
00045     std::string cpu;
00046 };
00047 
00048 
00052 struct profile_sample_files {
00059     std::string sample_filename;
00064     std::list<std::string> cg_files;
00065 };
00066 
00067 
00073 struct profile_dep_set {
00075     std::string lib_image;
00076 
00078     std::list<profile_sample_files> files;
00079 };
00080 
00090 struct profile_set {
00091     std::string image;
00092 
00095     std::list<profile_sample_files> files;
00096 
00098     std::list<profile_dep_set> deps;
00099 };
00100 
00101 
00106 struct profile_class {
00107     std::list<profile_set> profiles;
00108 
00110     std::string name;
00111 
00113     std::string longname;
00114 
00116     profile_template ptemplate;
00117 };
00118 
00119 
00124 enum axis_types {
00125     AXIS_EVENT,
00126     AXIS_TGID,
00127     AXIS_TID,
00128     AXIS_CPU,
00129     AXIS_MAX
00130 };
00131 
00132 
00133 struct profile_classes {
00142     std::string event;
00143 
00145     std::string cpuinfo;
00146 
00148     std::vector<profile_class> v;
00149 
00151     axis_types axis;
00152 
00154     extra_images extra_found_images;
00155 
00157     bool matches(profile_classes const & classes);
00158 };
00159 
00160 
00161 std::ostream & operator<<(std::ostream &, profile_sample_files const &);
00162 std::ostream & operator<<(std::ostream &, profile_dep_set const &);
00163 std::ostream & operator<<(std::ostream &, profile_set const &);
00164 std::ostream & operator<<(std::ostream &, profile_template const &);
00165 std::ostream & operator<<(std::ostream &, profile_class const &);
00166 std::ostream & operator<<(std::ostream &, profile_classes const &);
00167 
00168 
00177 profile_classes const
00178 arrange_profiles(std::list<std::string> const & files,
00179          merge_option const & merge_by, extra_images const & extra);
00180 
00181 
00186 struct image_set {
00189     std::string app_image;
00190 
00192     std::list<profile_sample_files> files;
00193 };
00194 
00195 typedef std::list<image_set> image_group_set;
00196 
00214 struct inverted_profile {
00215     inverted_profile() : error(image_ok) {}
00217     std::string image;
00218 
00220     mutable image_error error;
00221 
00223     std::vector<image_group_set> groups;
00224 };
00225 
00226 
00243 std::list<inverted_profile> const
00244 invert_profiles(profile_classes const & classes);
00245 
00246 #endif /* !ARRANGE_PROFILES_H */

Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1