Chromium Code Reviews| Index: components/tracing/common/process_metrics_memory_dump_provider.cc |
| diff --git a/components/tracing/common/process_metrics_memory_dump_provider.cc b/components/tracing/common/process_metrics_memory_dump_provider.cc |
| index f5a9471be463bd3f8429cc719cd8368f25ad46d5..e573ca1a72bc8c4fd56b9d1471ae5fd4b856ba17 100644 |
| --- a/components/tracing/common/process_metrics_memory_dump_provider.cc |
| +++ b/components/tracing/common/process_metrics_memory_dump_provider.cc |
| @@ -28,6 +28,7 @@ |
| #include <libproc.h> |
| #include <mach/mach.h> |
| #include <mach/mach_vm.h> |
| +#include <mach/shared_region.h> |
| #include <sys/param.h> |
| #include "base/numerics/safe_math.h" |
| @@ -257,6 +258,13 @@ bool ProcessMetricsMemoryDumpProvider::DumpProcessMemoryMaps( |
| if (info.share_mode == SM_COW && info.ref_count == 1) |
| info.share_mode = SM_PRIVATE; |
| + // Ignore regions in the dyld shared cache. |
|
Mark Mentovai
2017/02/03 23:17:13
Anyone can come along and map something else in th
|
| + if (address >= SHARED_REGION_BASE_X86_64 && |
| + address < (SHARED_REGION_BASE_X86_64 + SHARED_REGION_SIZE_X86_64) && |
| + info.share_mode != SM_PRIVATE) { |
| + continue; |
| + } |
| + |
| VMRegion region; |
| uint64_t dirty_bytes = info.pages_dirtied * PAGE_SIZE; |
| uint64_t clean_bytes = |