Loading libmeminfo/libmeminfo_test.cpp +7 −2 Original line number Original line Diff line number Diff line Loading @@ -31,6 +31,7 @@ #include <android-base/file.h> #include <android-base/file.h> #include <android-base/logging.h> #include <android-base/logging.h> #include <android-base/stringprintf.h> #include <android-base/stringprintf.h> #include <android-base/strings.h> using namespace std; using namespace std; using namespace android::meminfo; using namespace android::meminfo; Loading Loading @@ -334,7 +335,9 @@ TEST(ProcMemInfo, ForEachVmaFromFileTest) { // Check for names // Check for names EXPECT_EQ(vmas[0].name, "[anon:dalvik-zygote-jit-code-cache]"); EXPECT_EQ(vmas[0].name, "[anon:dalvik-zygote-jit-code-cache]"); EXPECT_EQ(vmas[1].name, "/system/framework/x86_64/boot-framework.art"); EXPECT_EQ(vmas[1].name, "/system/framework/x86_64/boot-framework.art"); EXPECT_EQ(vmas[2].name, "[anon:libc_malloc]"); EXPECT_TRUE(vmas[2].name == "[anon:libc_malloc]" || android::base::StartsWith(vmas[2].name, "[anon:scudo:")) << "Unknown map name " << vmas[2].name; EXPECT_EQ(vmas[3].name, "/system/priv-app/SettingsProvider/oat/x86_64/SettingsProvider.odex"); EXPECT_EQ(vmas[3].name, "/system/priv-app/SettingsProvider/oat/x86_64/SettingsProvider.odex"); EXPECT_EQ(vmas[4].name, "/system/lib64/libhwui.so"); EXPECT_EQ(vmas[4].name, "/system/lib64/libhwui.so"); EXPECT_EQ(vmas[5].name, "[vsyscall]"); EXPECT_EQ(vmas[5].name, "[vsyscall]"); Loading Loading @@ -432,7 +435,9 @@ TEST(ProcMemInfo, SmapsTest) { // Check for names // Check for names EXPECT_EQ(vmas[0].name, "[anon:dalvik-zygote-jit-code-cache]"); EXPECT_EQ(vmas[0].name, "[anon:dalvik-zygote-jit-code-cache]"); EXPECT_EQ(vmas[1].name, "/system/framework/x86_64/boot-framework.art"); EXPECT_EQ(vmas[1].name, "/system/framework/x86_64/boot-framework.art"); EXPECT_EQ(vmas[2].name, "[anon:libc_malloc]"); EXPECT_TRUE(vmas[2].name == "[anon:libc_malloc]" || android::base::StartsWith(vmas[2].name, "[anon:scudo:")) << "Unknown map name " << vmas[2].name; EXPECT_EQ(vmas[3].name, "/system/priv-app/SettingsProvider/oat/x86_64/SettingsProvider.odex"); EXPECT_EQ(vmas[3].name, "/system/priv-app/SettingsProvider/oat/x86_64/SettingsProvider.odex"); EXPECT_EQ(vmas[4].name, "/system/lib64/libhwui.so"); EXPECT_EQ(vmas[4].name, "/system/lib64/libhwui.so"); EXPECT_EQ(vmas[5].name, "[vsyscall]"); EXPECT_EQ(vmas[5].name, "[vsyscall]"); Loading libmemunreachable/MemUnreachable.cpp +3 −1 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <unordered_map> #include <unordered_map> #include <android-base/macros.h> #include <android-base/macros.h> #include <android-base/strings.h> #include <backtrace.h> #include <backtrace.h> #include "Allocator.h" #include "Allocator.h" Loading Loading @@ -250,7 +251,8 @@ bool MemUnreachable::ClassifyMappings(const allocator::vector<Mapping>& mappings } else if (mapping_name == current_lib) { } else if (mapping_name == current_lib) { // .rodata or .data section // .rodata or .data section globals_mappings.emplace_back(*it); globals_mappings.emplace_back(*it); } else if (mapping_name == "[anon:libc_malloc]") { } else if (mapping_name == "[anon:libc_malloc]" || android::base::StartsWith(mapping_name, "[anon:scudo:")) { // named malloc mapping // named malloc mapping heap_mappings.emplace_back(*it); heap_mappings.emplace_back(*it); } else if (has_prefix(mapping_name, "[anon:dalvik-")) { } else if (has_prefix(mapping_name, "[anon:dalvik-")) { Loading Loading
libmeminfo/libmeminfo_test.cpp +7 −2 Original line number Original line Diff line number Diff line Loading @@ -31,6 +31,7 @@ #include <android-base/file.h> #include <android-base/file.h> #include <android-base/logging.h> #include <android-base/logging.h> #include <android-base/stringprintf.h> #include <android-base/stringprintf.h> #include <android-base/strings.h> using namespace std; using namespace std; using namespace android::meminfo; using namespace android::meminfo; Loading Loading @@ -334,7 +335,9 @@ TEST(ProcMemInfo, ForEachVmaFromFileTest) { // Check for names // Check for names EXPECT_EQ(vmas[0].name, "[anon:dalvik-zygote-jit-code-cache]"); EXPECT_EQ(vmas[0].name, "[anon:dalvik-zygote-jit-code-cache]"); EXPECT_EQ(vmas[1].name, "/system/framework/x86_64/boot-framework.art"); EXPECT_EQ(vmas[1].name, "/system/framework/x86_64/boot-framework.art"); EXPECT_EQ(vmas[2].name, "[anon:libc_malloc]"); EXPECT_TRUE(vmas[2].name == "[anon:libc_malloc]" || android::base::StartsWith(vmas[2].name, "[anon:scudo:")) << "Unknown map name " << vmas[2].name; EXPECT_EQ(vmas[3].name, "/system/priv-app/SettingsProvider/oat/x86_64/SettingsProvider.odex"); EXPECT_EQ(vmas[3].name, "/system/priv-app/SettingsProvider/oat/x86_64/SettingsProvider.odex"); EXPECT_EQ(vmas[4].name, "/system/lib64/libhwui.so"); EXPECT_EQ(vmas[4].name, "/system/lib64/libhwui.so"); EXPECT_EQ(vmas[5].name, "[vsyscall]"); EXPECT_EQ(vmas[5].name, "[vsyscall]"); Loading Loading @@ -432,7 +435,9 @@ TEST(ProcMemInfo, SmapsTest) { // Check for names // Check for names EXPECT_EQ(vmas[0].name, "[anon:dalvik-zygote-jit-code-cache]"); EXPECT_EQ(vmas[0].name, "[anon:dalvik-zygote-jit-code-cache]"); EXPECT_EQ(vmas[1].name, "/system/framework/x86_64/boot-framework.art"); EXPECT_EQ(vmas[1].name, "/system/framework/x86_64/boot-framework.art"); EXPECT_EQ(vmas[2].name, "[anon:libc_malloc]"); EXPECT_TRUE(vmas[2].name == "[anon:libc_malloc]" || android::base::StartsWith(vmas[2].name, "[anon:scudo:")) << "Unknown map name " << vmas[2].name; EXPECT_EQ(vmas[3].name, "/system/priv-app/SettingsProvider/oat/x86_64/SettingsProvider.odex"); EXPECT_EQ(vmas[3].name, "/system/priv-app/SettingsProvider/oat/x86_64/SettingsProvider.odex"); EXPECT_EQ(vmas[4].name, "/system/lib64/libhwui.so"); EXPECT_EQ(vmas[4].name, "/system/lib64/libhwui.so"); EXPECT_EQ(vmas[5].name, "[vsyscall]"); EXPECT_EQ(vmas[5].name, "[vsyscall]"); Loading
libmemunreachable/MemUnreachable.cpp +3 −1 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <unordered_map> #include <unordered_map> #include <android-base/macros.h> #include <android-base/macros.h> #include <android-base/strings.h> #include <backtrace.h> #include <backtrace.h> #include "Allocator.h" #include "Allocator.h" Loading Loading @@ -250,7 +251,8 @@ bool MemUnreachable::ClassifyMappings(const allocator::vector<Mapping>& mappings } else if (mapping_name == current_lib) { } else if (mapping_name == current_lib) { // .rodata or .data section // .rodata or .data section globals_mappings.emplace_back(*it); globals_mappings.emplace_back(*it); } else if (mapping_name == "[anon:libc_malloc]") { } else if (mapping_name == "[anon:libc_malloc]" || android::base::StartsWith(mapping_name, "[anon:scudo:")) { // named malloc mapping // named malloc mapping heap_mappings.emplace_back(*it); heap_mappings.emplace_back(*it); } else if (has_prefix(mapping_name, "[anon:dalvik-")) { } else if (has_prefix(mapping_name, "[anon:dalvik-")) { Loading