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

Unified Diff: base/trace_event/memory_dump_manager.h

Issue 1417003003: [tracing] Dump child processes' memory metrics in browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web_cache2_base
Patch Set: Nits. Created 5 years, 1 month 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
Index: base/trace_event/memory_dump_manager.h
diff --git a/base/trace_event/memory_dump_manager.h b/base/trace_event/memory_dump_manager.h
index 662e0cf59120927ec272552cf265fba8cdac6a4e..d1af9f3509741088a9970ea345e8baa1e88f3e93 100644
--- a/base/trace_event/memory_dump_manager.h
+++ b/base/trace_event/memory_dump_manager.h
@@ -16,6 +16,8 @@
#include "base/timer/timer.h"
#include "base/trace_event/memory_dump_request_args.h"
#include "base/trace_event/process_memory_dump.h"
+#include "base/trace_event/process_memory_maps_dump_provider.h"
+#include "base/trace_event/process_memory_totals_dump_provider.h"
#include "base/trace_event/trace_event.h"
namespace base {
@@ -97,6 +99,13 @@ class BASE_EXPORT MemoryDumpManager : public TraceLog::EnabledStateObserver {
void OnTraceLogEnabled() override;
void OnTraceLogDisabled() override;
+ // Registers and unregisters the process metrics dump providers for the
+ // |process|. Some processes cannot access metrics due to sandbox. To
+ // workaround the issue the coordinator process dumps statistics about the
Primiano Tucci (use gerrit) 2015/11/03 15:14:08 the manager should not need to know about all this
+ // associated processes.
+ void RegisterProcessMetricsProvidersFor(ProcessHandle process);
+ void UnregisterProcessMetricsProvidersFor(ProcessHandle process);
+
// Returns the MemoryDumpSessionState object, which is shared by all the
// ProcessMemoryDump and MemoryAllocatorDump instances through all the tracing
// session lifetime.
@@ -129,6 +138,11 @@ class BASE_EXPORT MemoryDumpManager : public TraceLog::EnabledStateObserver {
friend class MemoryDumpManagerDelegate;
friend class MemoryDumpManagerTest;
+ using ProcessTotalsDumpProvidersMap =
+ ScopedPtrMap<ProcessHandle, scoped_ptr<ProcessMemoryTotalsDumpProvider>>;
+ using ProcessMapsDumpProvidersMap =
+ ScopedPtrMap<ProcessHandle, scoped_ptr<ProcessMemoryMapsDumpProvider>>;
+
// Descriptor struct used to hold information about registered MDPs. It is
// deliberately copyable, in order to allow it to be used as std::set value.
struct MemoryDumpProviderInfo {
@@ -240,6 +254,11 @@ class BASE_EXPORT MemoryDumpManager : public TraceLog::EnabledStateObserver {
// affinity (MDPs belonging to the same thread are adjacent).
MemoryDumpProviderInfoSet dump_providers_;
+ // MemoryDumpManager owns the memory maps and totals providers for all the
+ // associated processes.
+ ProcessTotalsDumpProvidersMap process_totals_providers_map_;
+ ProcessMapsDumpProvidersMap process_mmaps_providers_map_;
+
// Shared among all the PMDs to keep state scoped to the tracing session.
scoped_refptr<MemoryDumpSessionState> session_state_;
« no previous file with comments | « no previous file | base/trace_event/memory_dump_manager.cc » ('j') | base/trace_event/process_memory_maps_dump_provider.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698