sample_container Class Reference

#include <sample_container.h>

Public Types

typedef std::map
< sample_index_t, sample_entry
samples_storage
typedef
samples_storage::const_iterator 
samples_iterator

Public Member Functions

samples_iterator begin (symbol_entry const *) const
 return iterator to the first samples for this symbol
samples_iterator end (symbol_entry const *) const
 return iterator to the last samples for this symbol
samples_iterator begin () const
 return iterator to the first samples
samples_iterator end () const
 return iterator to the last samples
void insert (symbol_entry const *symbol, sample_entry const &)
count_array_t accumulate_samples (debug_name_id filename_id) const
 return nr of samples in the given filename
count_array_t accumulate_samples (debug_name_id, size_t linenr) const
 return nr of samples at the given line nr in the given file
sample_entry const * find_by_vma (symbol_entry const *symbol, bfd_vma vma) const
 return the sample entry for the given image_name and vma if any

Private Types

typedef std::pair
< symbol_entry const
*, bfd_vma > 
sample_index_t
typedef std::multiset
< sample_entry const
*, less_by_file_loc
samples_by_loc_t

Private Member Functions

void build_by_loc () const
 build the symbol by file-location cache

Private Attributes

samples_storage samples
 main sample entry container
samples_by_loc_t samples_by_loc

Detailed Description

Arbitrary container of sample entries. Can return number of samples for a file or line number and return the particular sample information for a VMA.

Definition at line 27 of file sample_container.h.


Member Typedef Documentation

typedef std::pair<symbol_entry const *, bfd_vma> sample_container::sample_index_t [private]

Definition at line 28 of file sample_container.h.

typedef std::multiset<sample_entry const *, less_by_file_loc> sample_container::samples_by_loc_t [private]

Definition at line 65 of file sample_container.h.

typedef samples_storage::const_iterator sample_container::samples_iterator

Definition at line 31 of file sample_container.h.

Definition at line 30 of file sample_container.h.


Member Function Documentation

count_array_t sample_container::accumulate_samples ( debug_name_id  filename,
size_t  linenr 
) const

return nr of samples at the given line nr in the given file

Definition at line 113 of file sample_container.cpp.

References build_by_loc(), sample_entry::file_loc, file_location::filename, file_location::linenr, and samples_by_loc.

Here is the call graph for this function:

count_array_t sample_container::accumulate_samples ( debug_name_id  filename_id  )  const

return nr of samples in the given filename

Definition at line 81 of file sample_container.cpp.

References build_by_loc(), sample_entry::file_loc, file_location::filename, file_location::linenr, and samples_by_loc.

Here is the call graph for this function:

sample_container::samples_iterator sample_container::begin (  )  const

return iterator to the first samples

Definition at line 36 of file sample_container.cpp.

References samples.

sample_container::samples_iterator sample_container::begin ( symbol_entry const *  symbol  )  const

return iterator to the first samples for this symbol

Definition at line 49 of file sample_container.cpp.

References samples.

void sample_container::build_by_loc (  )  const [private]

build the symbol by file-location cache

Definition at line 132 of file sample_container.cpp.

References end(), samples, and samples_by_loc.

Referenced by accumulate_samples().

Here is the call graph for this function:

Here is the caller graph for this function:

sample_container::samples_iterator sample_container::end (  )  const

return iterator to the last samples

Definition at line 42 of file sample_container.cpp.

References samples.

Referenced by build_by_loc().

Here is the caller graph for this function:

sample_container::samples_iterator sample_container::end ( symbol_entry const *  symbol  )  const

return iterator to the last samples for this symbol

Definition at line 58 of file sample_container.cpp.

References samples.

sample_entry const * sample_container::find_by_vma ( symbol_entry const *  symbol,
bfd_vma  vma 
) const

return the sample entry for the given image_name and vma if any

Definition at line 101 of file sample_container.cpp.

References samples.

void sample_container::insert ( symbol_entry const *  symbol,
sample_entry const &  sample 
)

insert a sample entry by creating a new entry or by cumulating samples into an existing one. Can only be done before any lookups

Definition at line 66 of file sample_container.cpp.

References sample_entry::counts, samples, and sample_entry::vma.


Field Documentation

main sample entry container

Definition at line 62 of file sample_container.h.

Referenced by begin(), build_by_loc(), end(), find_by_vma(), and insert().

Sample entries by file location. Lazily built when necessary, so mutable.

Definition at line 74 of file sample_container.h.

Referenced by accumulate_samples(), and build_by_loc().


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

Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1