Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(568)

Unified Diff: components/tracing/common/process_metrics_memory_dump_provider.cc

Issue 2674973004: mac: Emit dyld info from the memory dump provider. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698