ROSE
0.9.6a
|
Statistics computed over a region of an address space. More...
#include <Partitioner.h>
Classes | |
struct | AnalysisResult |
struct | DictionaryEntry |
Public Types | |
enum | AnalysisEnum { RA_NBYTES =0, RA_NINSNS, RA_NCOVERAGE, RA_RCOVERAGE, RA_NSTARTS, RA_NFAILS, RA_RFAILS, RA_NOVERLAPS, RA_ROVERLAPS, RA_NINCOMPLETE, RA_RINCOMPLETE, RA_NBRANCHES, RA_RBRANCHES, RA_NCALLS, RA_RCALLS, RA_NNONCALLS, RA_RNONCALLS, RA_NINTERNAL, RA_RINTERNAL, RA_NICFGEDGES, RA_RICFGEDGES, RA_NCOMPS, RA_RCOMPS, RA_NIUNIQUE, RA_RIUNIQUE, RA_NREGREFS, RA_RREGREFS, RA_REGSZ, RA_REGVAR, RA_NPRIV, RA_RPRIV, RA_NFLOAT, RA_RFLOAT } |
IDs for predefined analyses. More... | |
Public Member Functions | |
RegionStats () | |
virtual | ~RegionStats () |
virtual RegionStats * | create () const |
Return a new, allocated copy of this object. More... | |
virtual void | add_sample (size_t id, double val, size_t nsamples=1) |
Add another sample point to this container. More... | |
virtual size_t | get_nsamples (size_t id) const |
Returns the number of samples accumulated for an analysis. More... | |
virtual double | get_sum (size_t id) const |
Returns the sum stored for the analysis. More... | |
virtual double | get_value (size_t id) const |
Returns the value (sum/nsamples) of an analysis. More... | |
virtual void | compute_ratios () |
Called to compute ratios, etc. More... | |
virtual void | set_value (size_t id, double val) |
Set value to indicated single sample unless value is NaN. More... | |
double | divnan (size_t num_id, size_t den_id) const |
Safely computes the ratio of two values. More... | |
void | add_samples (const RegionStats *) |
Add samples from other statistics object to this one. More... | |
void | square_diff (const RegionStats *) |
Compute square of differences. More... | |
virtual void | print (std::ostream &) const |
Static Public Member Functions | |
static size_t | define_analysis (const std::string &name, const std::string &desc, double weight, size_t id=(size_t)(-1)) |
Add a new analysis to this RegionStats container. More... | |
static size_t | find_analysis (const std::string &name) |
Return the ID for an analysis based on name. More... | |
static size_t | get_nanalyses () |
Number of anlyses defined by this class and super classes. More... | |
static const std::string & | get_name (size_t id) |
Returns name of analysis. More... | |
static const std::string & | get_desc (size_t id) |
Returns one-line description of analysis. More... | |
static double | get_weight (size_t id) |
Returns the default weight in the analysis definition. More... | |
Static Protected Member Functions | |
static void | init_class () |
Private Attributes | |
std::vector< AnalysisResult > | results |
Static Private Attributes | |
static std::vector < DictionaryEntry > | dictionary |
Friends | |
std::ostream & | operator<< (std::ostream &, const RegionStats &) |
Statistics computed over a region of an address space.
Most of the members are floating point because they are also used to compute averages. For instance, aggregate_statistics() can compute the average number of instructions per function.
This is a virtual class so that users can easily augment it with additional analyses. The Partitioner never instantiates RegionStats objects directly, but rather always by calling Partitioner::new_region_stats(). The statistics are computed by methods like Partitioner::region_statistics() and Partitioner::aggregate_statistics(), which the user can also agument or replace.
See also, Partitioner::CodeCriteria.
Definition at line 717 of file Partitioner.h.
IDs for predefined analyses.
Derived classes should start their numbering at the value returned by get_nanalyses() after allowing this base class to initialize itself.
Definition at line 741 of file Partitioner.h.
|
inline |
Definition at line 748 of file Partitioner.h.
References init_class().
|
inlinevirtual |
Definition at line 749 of file Partitioner.h.
|
virtual |
Return a new, allocated copy of this object.
|
static |
Add a new analysis to this RegionStats container.
|
static |
Return the ID for an analysis based on name.
|
static |
Number of anlyses defined by this class and super classes.
|
static |
Returns name of analysis.
|
static |
Returns one-line description of analysis.
|
static |
Returns the default weight in the analysis definition.
|
virtual |
Add another sample point to this container.
|
virtual |
Returns the number of samples accumulated for an analysis.
|
virtual |
Returns the sum stored for the analysis.
|
virtual |
Returns the value (sum/nsamples) of an analysis.
|
virtual |
Called to compute ratios, etc.
from other stats.
|
virtual |
Set value to indicated single sample unless value is NaN.
double Partitioner::RegionStats::divnan | ( | size_t | num_id, |
size_t | den_id | ||
) | const |
Safely computes the ratio of two values.
void Partitioner::RegionStats::add_samples | ( | const RegionStats * | ) |
Add samples from other statistics object to this one.
void Partitioner::RegionStats::square_diff | ( | const RegionStats * | ) |
Compute square of differences.
|
virtual |
|
staticprotected |
Referenced by RegionStats().
|
friend |
|
staticprivate |
Definition at line 735 of file Partitioner.h.
|
private |
Definition at line 736 of file Partitioner.h.