summaryrefslogtreecommitdiff
path: root/simpleperf/cmd_stat.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2017-05-09 17:31:05 -0700
committerYabin Cui <yabinc@google.com>2017-05-23 16:53:39 -0700
commit43301382dadbb57fb48036df44e0d5d2ec370338 (patch)
tree1de3194312259ca2823b065de0f07140f61c952f /simpleperf/cmd_stat.cpp
parentadbce4d3b7eb6f4c7c78084feefc208fc8a768fe (diff)
downloadextras-43301382dadbb57fb48036df44e0d5d2ec370338.tar.gz
simpleperf: support raw event types.
Provide interface to access event numbers provided by ARMv8 PMU v3. Make event types case insensitive to make typing easier. Bug: http://b/38043209 Test: run simpleperf_unit_test. Change-Id: I49073acbc4d8c9abeafff93e25133664c84a0e9c
Diffstat (limited to 'simpleperf/cmd_stat.cpp')
-rw-r--r--simpleperf/cmd_stat.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/simpleperf/cmd_stat.cpp b/simpleperf/cmd_stat.cpp
index cdd5593a..a0929bcf 100644
--- a/simpleperf/cmd_stat.cpp
+++ b/simpleperf/cmd_stat.cpp
@@ -238,6 +238,14 @@ class CounterSummaries {
sap_mid);
}
}
+ if (android::base::EndsWith(s.type_name, "-refill")) {
+ std::string other_name = s.type_name.substr(0, s.type_name.size() - strlen("-refill"));
+ const CounterSummary* other = FindSummary(other_name, s.modifier);
+ if (other != nullptr && other->IsMonitoredAtTheSameTime(s) && other->count != 0) {
+ double miss_rate = static_cast<double>(s.count) / other->count;
+ return android::base::StringPrintf("%f%%%cmiss rate", miss_rate * 100, sap_mid);
+ }
+ }
double rate = s.count / (duration_in_sec / s.scale);
if (rate > 1e9) {
return android::base::StringPrintf("%.3lf%cG/sec", rate / 1e9, sap_mid);