Only get stats for relevant maps.
Scudo creates a large map on 64 bit which can cause a slow down trying
to get the usage stats for all maps. Since the test only really cares
about a small subset of maps, only get the usage stats for those maps.
Test: Ran unit tests on scudo and jemalloc based systems.
Change-Id: Iba3cff1487ca304083aac323a3971b9f939f5c11
diff --git a/tests/dlext_test.cpp b/tests/dlext_test.cpp
index e7274f7..e98d66f 100644
--- a/tests/dlext_test.cpp
+++ b/tests/dlext_test.cpp
@@ -600,7 +600,7 @@
void GetPss(bool shared_relro, const char* lib, const char* relro_file, pid_t pid,
size_t* total_pss) {
android::meminfo::ProcMemInfo proc_mem(pid);
- const std::vector<android::meminfo::Vma>& maps = proc_mem.Maps();
+ const std::vector<android::meminfo::Vma>& maps = proc_mem.MapsWithoutUsageStats();
ASSERT_GT(maps.size(), 0UL);
// Calculate total PSS of the library.
@@ -612,7 +612,9 @@
saw_relro_file = true;
}
- *total_pss += vma.usage.pss;
+ android::meminfo::Vma update_vma(vma);
+ ASSERT_TRUE(proc_mem.FillInVmaStats(update_vma));
+ *total_pss += update_vma.usage.pss;
}
}