From 32501800e2e72902ddcf6f93bf7f71a843dc8fac Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Wed, 2 Dec 2015 22:45:39 +0000 Subject: [PATCH] Revert "Fix the order in which profiled methods are dumped." MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Test has flakes: +art F 30865 30865 art/runtime/java_vm_ext.cc:466] JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal start byte 0x80 +art F 30865 30865 art/runtime/java_vm_ext.cc:466] string: '��gy�' +art F 30865 30865 art/runtime/java_vm_ext.cc:466] input: '<0x80> 0xd8 0x67 0x79 0x8e 0x7f' +art F 30865 30865 art/runtime/java_vm_ext.cc:466] in call to NewStringUTF +art F 30865 30865 art/runtime/java_vm_ext.cc:466] from java.lang.String Main.getProfileInfoDump(java.lang.String, java.lang.Class, java.lang.Class) This reverts commit 1d2760bb6128f1bd623824ebcef5784d81b2ab85. Change-Id: I84e478d715c1496892fa800778fc454d15e5d2c5 --- runtime/jit/offline_profiling_info.cc | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/runtime/jit/offline_profiling_info.cc b/runtime/jit/offline_profiling_info.cc index fcdbd1269..583085f08 100644 --- a/runtime/jit/offline_profiling_info.cc +++ b/runtime/jit/offline_profiling_info.cc @@ -355,31 +355,19 @@ bool ProfileCompilationInfo::ContainsMethod(const MethodReference& method_ref) c std::string ProfileCompilationInfo::DumpInfo(bool print_full_dex_location) const { std::ostringstream os; - if (info_.empty()) { - return "ProfileInfo: empty"; - } - - os << "ProfileInfo:"; - - // Use an additional map to achieve a predefined ordered based on the dex locations. - SafeMap dex_locations_map; - for (auto info_it : info_) { - dex_locations_map.Put(info_it.first->GetLocation(), info_it.first); - } - + os << "ProfileInfo:" << (info_.empty() ? "empty" : ""); const std::string kFirstDexFileKeySubstitute = ":classes.dex"; - for (auto dex_file_it : dex_locations_map) { + for (auto info_it : info_) { os << "\n"; - const std::string& location = dex_file_it.first; - const DexFile* dex_file = dex_file_it.second; + const DexFile* dex_file = info_it.first; if (print_full_dex_location) { - os << location; + os << dex_file->GetLocation(); } else { // Replace the (empty) multidex suffix of the first key with a substitute for easier reading. - std::string multidex_suffix = DexFile::GetMultiDexSuffix(location); + std::string multidex_suffix = DexFile::GetMultiDexSuffix(dex_file->GetLocation()); os << (multidex_suffix.empty() ? kFirstDexFileKeySubstitute : multidex_suffix); } - for (auto class_it : info_.find(dex_file)->second) { + for (auto class_it : info_it.second) { for (auto method_it : class_it.second) { os << "\n " << PrettyMethod(method_it, *dex_file, true); } -- 2.11.0