summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalin Juravle <calin@google.com>2014-06-06 15:02:08 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-06-06 15:02:08 +0000
commit9529d6273777ee297a8aa7513e8172775f0496df (patch)
tree89eda8a51a340fac54c6a84bdcedfda0ec2eed4c
parent14108093a9f31472ff0f400dd2d34b1d856b7d19 (diff)
parent19477a8d17d5e9baa2fac235babba5c8f0f2929c (diff)
downloadart-9529d6273777ee297a8aa7513e8172775f0496df.zip
art-9529d6273777ee297a8aa7513e8172775f0496df.tar.gz
art-9529d6273777ee297a8aa7513e8172775f0496df.tar.bz2
Merge "Fix top K percentage computation when loading profile data."
-rw-r--r--runtime/profiler.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/runtime/profiler.cc b/runtime/profiler.cc
index 80ce205..bad79b3 100644
--- a/runtime/profiler.cc
+++ b/runtime/profiler.cc
@@ -589,14 +589,11 @@ bool ProfileFile::LoadFile(const std::string& fileName) {
std::vector<std::string> summary_info;
Split(line, '/', summary_info);
if (summary_info.size() != 3) {
- // Bad summary info. It should be count/total/bootpath.
+ // Bad summary info. It should be total/null/boot.
return false;
}
- // This is the number of hits in all methods.
- uint32_t total_count = 0;
- for (int i = 0 ; i < 3; ++i) {
- total_count += atoi(summary_info[i].c_str());
- }
+ // This is the number of hits in all profiled methods (without nullptr or boot methods)
+ uint32_t total_count = atoi(summary_info[0].c_str());
// Now read each line until the end of file. Each line consists of 3 fields separated by '/'.
// Store the info in descending order given by the most used methods.