diff options
| author | 2014-06-06 12:24:21 +0100 | |
|---|---|---|
| committer | 2014-06-06 12:27:49 +0100 | |
| commit | 19477a8d17d5e9baa2fac235babba5c8f0f2929c (patch) | |
| tree | 89eda8a51a340fac54c6a84bdcedfda0ec2eed4c | |
| parent | 14108093a9f31472ff0f400dd2d34b1d856b7d19 (diff) | |
Fix top K percentage computation when loading profile data.
Don't count boot and null methods when computing top K percentage for
sampled methods.
Bug: 15462067
Bug: 12877748
Change-Id: I11c2ea541066a15bc8a5ad323e21ccbfdf81c2c5
| -rw-r--r-- | runtime/profiler.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/runtime/profiler.cc b/runtime/profiler.cc index 80ce205df1..bad79b3a3b 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. |