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

Unified Diff: services/resource_coordinator/public/interfaces/memory/memory_instrumentation.mojom

Issue 2871223002: memory-infra: add ProcessType and expose data in RequestGlobalDump() (Closed)
Patch Set: fix data structures Created 3 years, 7 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
Index: services/resource_coordinator/public/interfaces/memory/memory_instrumentation.mojom
diff --git a/services/resource_coordinator/public/interfaces/memory/memory_instrumentation.mojom b/services/resource_coordinator/public/interfaces/memory/memory_instrumentation.mojom
index 160ec1241eeac319982f97580c5506eaee780fd4..64ecc12862e1d6069c611039555c8e67a9c1d3d9 100644
--- a/services/resource_coordinator/public/interfaces/memory/memory_instrumentation.mojom
+++ b/services/resource_coordinator/public/interfaces/memory/memory_instrumentation.mojom
@@ -10,7 +10,7 @@ enum DumpType {
PERIODIC_INTERVAL,
EXPLICITLY_TRIGGERED,
PEAK_MEMORY_USAGE,
- SUMMARY_ONLY
+ SUMMARY_ONLY
};
enum LevelOfDetail {
@@ -45,25 +45,58 @@ struct ChromeMemDump {
uint32 v8_total_kb = 0;
};
-struct MemoryDumpCallbackResult {
+enum ProcessType {
+ OTHER,
+ BROWSER,
+ RENDERER,
+ GPU,
+ UTILITY,
+ PLUGIN
+};
+
+// This struct is used both for:
+// 1) The internal communication between the memory service (Coordinator) and
+// the client library (ProcessLocalDumpManager).
+// 2) The public-facing API Coordinator::RequestGlobalMemoryDump().
+struct ProcessMemoryDump {
+ ProcessType process_type;
OSMemDump os_dump;
ChromeMemDump chrome_dump;
+
+ // TODO(hjd): add the computed Consistent Memory Metrics footprints here.
+
+ // This is used only in the use-case (1) and only on Linux/CrOS to get
+ // around sandboxing. See crbug.com/461788 .
map<mojo.common.mojom.ProcessId, OSMemDump> extra_processes_dump;
};
-// There should be at most one implementation of this interface per process.
+
+// This struct is returned by the public-facing API
+// Coordinator::RequestGlobalMemoryDump().
+struct GlobalMemoryDump {
+ array<ProcessMemoryDump> process_dumps;
+};
+
+// This is the interface implemented by the client library. This allows a
+// remote process to contribute of the memory-infra dumps. There should be at
dcheng 2017/05/11 05:55:26 "to contribute of the": this is a bit hard to read
Primiano Tucci (use gerrit) 2017/05/11 12:50:02 typo. done
+// most one instance of this per hosting process.
interface ProcessLocalDumpManager {
- // When successful, the dump is appended in the process-local trace buffer of
- // the target process and an ACK. A summary of the dump is also returned in
- // case of success.
+ // When |success| == true the dump is appended in the process-local trace
+ // buffer of the target process and an ACK. A summary of the dump is also
+ // returned in case of success.
RequestProcessMemoryDump(RequestArgs args) =>
- (uint64 dump_guid, bool success, MemoryDumpCallbackResult? result);
+ (uint64 dump_guid, bool success, ProcessMemoryDump? process_memory_dump);
dcheng 2017/05/11 05:55:26 this isn't a guid? at least not in the traditional
Primiano Tucci (use gerrit) 2017/05/11 12:50:03 not in the base::guid. it's guid as in "globally u
};
-// Memory Infra service implements this interface. ProcessLocalDumpManagers
-// register themselves using the RegisterProcessLocalDumpManager method and
-// suggest a global memory dump using the RequestGlobalMemoryDump method.
+// The memory-infra service implements this interface.
interface Coordinator {
+ // Used to register a client library to obtain a process-local dump from it
+ // when RequestGlobalMemoryDump() is called.
RegisterProcessLocalDumpManager(ProcessLocalDumpManager local_manager);
- RequestGlobalMemoryDump(RequestArgs args) => (uint64 dump_guid, bool success);
+
+ // Broadcasts a dump request to all registered client libraries, injects the
+ // dump in the trace buffer (if tracing is enabled) and returns a summarized
+ // dump back if args.dump_type == SUMMARY_ONLY.
+ RequestGlobalMemoryDump(RequestArgs args) =>
+ (uint64 dump_guid, bool success, GlobalMemoryDump? global_memory_dump);
};

Powered by Google App Engine
This is Rietveld 408576698