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; |
fmeawad
2017/05/10 17:09:38
Can we send it as we register instead of sending i
Primiano Tucci (use gerrit)
2017/05/10 17:17:19
the thing is that we want to expose it publicly to
fmeawad
2017/05/10 18:00:16
Makes sense.
|
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 |
+// 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); |
}; |
-// 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); |
}; |