profile_container.h

Go to the documentation of this file.
00001 
00012 #ifndef PROFILE_CONTAINER_H
00013 #define PROFILE_CONTAINER_H
00014 
00015 #include <string>
00016 #include <vector>
00017 
00018 #include "profile.h"
00019 #include "utility.h"
00020 #include "op_bfd.h"
00021 #include "sample_container.h"
00022 #include "symbol_container.h"
00023 #include "format_flags.h"
00024 #include "locate_images.h"
00025 
00026 class string_filter;
00027 class symbol_entry;
00028 class sample_entry;
00029 
00035 class profile_container : noncopyable {
00036 public:
00048     profile_container(bool debug_info, bool need_details,
00049               extra_images const & extra);
00050 
00051     ~profile_container();
00052  
00066     void add(profile_t const & profile, op_bfd const & abfd,
00067          std::string const & app_name, size_t pclass);
00068 
00071     symbol_entry const * find_symbol(std::string const & image_name,
00072                      bfd_vma vma) const;
00073 
00076     symbol_collection const find_symbol(debug_name_id filename,
00077                     size_t linenr) const;
00078 
00081     sample_entry const * find_sample(symbol_entry const * symbol,
00082                      bfd_vma vma) const;
00083 
00085     symbol_entry const * find(symbol_entry const & symbol) const;
00086 
00088     struct symbol_choice {
00089         symbol_choice()
00090             : hints(cf_none), threshold(0.0), match_image(false) {}
00091 
00093         column_flags hints;
00095         double threshold;
00097         bool match_image;
00099         std::string image_name;
00100     };
00101 
00106     symbol_collection const select_symbols(symbol_choice & choice) const;
00107 
00112     symbol_collection const select_symbols(debug_name_id filename) const;
00113 
00115     std::vector<debug_name_id> const select_filename(double threshold) const;
00116 
00118     count_array_t samples_count() const;
00119 
00122     count_array_t samples_count(debug_name_id filename_id) const;
00125     count_array_t samples_count(debug_name_id filename,
00126                size_t linenr) const;
00127 
00129     symbol_container::symbols_t::iterator begin_symbol() const;
00131     symbol_container::symbols_t::iterator end_symbol() const;
00132 
00134     sample_container::samples_iterator begin() const;
00136     sample_container::samples_iterator end() const;
00137 
00139     sample_container::samples_iterator begin(symbol_entry const *) const;
00141     sample_container::samples_iterator end(symbol_entry const *) const;
00142 
00143 private:
00145     void add_samples(op_bfd const & abfd, symbol_index_t sym_index,
00146                      profile_t::iterator_pair const &,
00147                      symbol_entry const * symbol, size_t pclass,
00148              unsigned long start);
00149 
00162     std::string create_artificial_symbol(op_bfd const & abfd, u32 start,
00163                                          u32 & end, size_t & order);
00164 
00167     scoped_ptr<symbol_container> symbols;
00170     scoped_ptr<sample_container> samples;
00173     count_array_t total_count;
00174 
00180     bool debug_info;
00181     bool need_details;
00183 
00184 public: // FIXME
00185     extra_images extra_found_images;
00186 };
00187 
00188 #endif /* !PROFILE_CONTAINER_H */

Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1