summaryrefslogtreecommitdiffstats
path: root/compiler/driver/compiler_driver.h
diff options
context:
space:
mode:
authorCalin Juravle <calin@google.com>2014-04-02 17:03:08 +0100
committerCalin Juravle <calin@google.com>2014-04-02 17:03:08 +0100
commitf6a4cee66a173ee7ef48af5503d9899aa93b3aeb (patch)
treed059a9af44dc9405ee353b22d89be1099a5be1c6 /compiler/driver/compiler_driver.h
parentea1e520e5a4b52b668ea2f9d3abdd9ae3a192186 (diff)
downloadart-f6a4cee66a173ee7ef48af5503d9899aa93b3aeb.zip
art-f6a4cee66a173ee7ef48af5503d9899aa93b3aeb.tar.gz
art-f6a4cee66a173ee7ef48af5503d9899aa93b3aeb.tar.bz2
Profile: repurposed kTresholdPercent
Previously kTresholdPercent was the percentage of samples of the total that a method must comprise before compiling. I changed it to mean the threshold for a running total...i.e. compile all the methods that comprise K% of the samples cumulatively. (in the process fixed ProfileData#percent doc and changed its name) Bug: 12877748 Change-Id: Ib0e18e525a16c11b189afc3d840c09183ac629de
Diffstat (limited to 'compiler/driver/compiler_driver.h')
-rw-r--r--compiler/driver/compiler_driver.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h
index 256aa46..4257241 100644
--- a/compiler/driver/compiler_driver.h
+++ b/compiler/driver/compiler_driver.h
@@ -598,22 +598,28 @@ class CompilerDriver {
// in a file. It is used to determine whether to compile a particular method or not.
class ProfileData {
public:
- ProfileData() : count_(0), method_size_(0), percent_(0) {}
- ProfileData(const std::string& method_name, uint32_t count, uint32_t method_size, double percent) :
- method_name_(method_name), count_(count), method_size_(method_size), percent_(percent) {
+ ProfileData() : count_(0), method_size_(0), usedPercent_(0) {}
+ ProfileData(const std::string& method_name, uint32_t count, uint32_t method_size,
+ double usedPercent, double topKUsedPercentage) :
+ method_name_(method_name), count_(count), method_size_(method_size),
+ usedPercent_(usedPercent), topKUsedPercentage_(topKUsedPercentage) {
// TODO: currently method_size_ and count_ are unused.
UNUSED(method_size_);
UNUSED(count_);
}
- bool IsAbove(double v) const { return percent_ >= v; }
- double GetPercent() const { return percent_; }
+ bool IsAbove(double v) const { return usedPercent_ >= v; }
+ double GetUsedPercent() const { return usedPercent_; }
+ uint32_t GetCount() const { return count_; }
+ double GetTopKUsedPercentage() const { return topKUsedPercentage_; }
private:
- std::string method_name_; // Method name.
- uint32_t count_; // Number number of times it has been called.
- uint32_t method_size_; // Size of the method on dex instructions.
- double percent_; // Percentage of time spent in this method.
+ std::string method_name_; // Method name.
+ uint32_t count_; // Number of times it has been called.
+ uint32_t method_size_; // Size of the method on dex instructions.
+ double usedPercent_; // Percentage of how many times this method was called.
+ double topKUsedPercentage_; // The percentage of the group that comprise K% of the total used
+ // methods this methods belongs to.
};
// Profile data is stored in a map, indexed by the full method name.