| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 module memory_instrumentation.mojom; | 5 module memory_instrumentation.mojom; |
| 6 | 6 |
| 7 import "mojo/common/process_id.mojom"; | |
| 8 | |
| 9 enum DumpType { | 7 enum DumpType { |
| 10 PERIODIC_INTERVAL, | 8 PERIODIC_INTERVAL, |
| 11 EXPLICITLY_TRIGGERED, | 9 EXPLICITLY_TRIGGERED, |
| 12 PEAK_MEMORY_USAGE | 10 PEAK_MEMORY_USAGE |
| 13 }; | 11 }; |
| 14 | 12 |
| 15 enum LevelOfDetail { | 13 enum LevelOfDetail { |
| 16 BACKGROUND, | 14 BACKGROUND, |
| 17 LIGHT, | 15 LIGHT, |
| 18 DETAILED | 16 DETAILED |
| (...skipping 12 matching lines...) Expand all Loading... |
| 31 struct ChromeMemDump { | 29 struct ChromeMemDump { |
| 32 uint32 malloc_total_kb = 0; | 30 uint32 malloc_total_kb = 0; |
| 33 uint32 partition_alloc_total_kb = 0; | 31 uint32 partition_alloc_total_kb = 0; |
| 34 uint32 blink_gc_total_kb = 0; | 32 uint32 blink_gc_total_kb = 0; |
| 35 uint32 v8_total_kb = 0; | 33 uint32 v8_total_kb = 0; |
| 36 }; | 34 }; |
| 37 | 35 |
| 38 struct MemoryDumpCallbackResult { | 36 struct MemoryDumpCallbackResult { |
| 39 OSMemDump os_dump; | 37 OSMemDump os_dump; |
| 40 ChromeMemDump chrome_dump; | 38 ChromeMemDump chrome_dump; |
| 41 map<mojo.common.mojom.ProcessId, OSMemDump> extra_processes_dump; | 39 }; |
| 42 }; | |
| 43 | 40 |
| 44 // There should be at most one implementation of this interface per process. | 41 // There should be at most one implementation of this interface per process. |
| 45 interface ProcessLocalDumpManager { | 42 interface ProcessLocalDumpManager { |
| 46 // When successful, the dump is appended in the process-local trace buffer of | 43 // When successful, the dump is appended in the process-local trace buffer of |
| 47 // the target process and an ACK. A summary of the dump is also returned in | 44 // the target process and an ACK. A summary of the dump is also returned in |
| 48 // case of success. | 45 // case of success. |
| 49 RequestProcessMemoryDump(RequestArgs args) => | 46 RequestProcessMemoryDump(RequestArgs args) => |
| 50 (uint64 dump_guid, bool success, MemoryDumpCallbackResult? result); | 47 (uint64 dump_guid, bool success, MemoryDumpCallbackResult? result); |
| 51 }; | 48 }; |
| 52 | 49 |
| 53 // Memory Infra service implements this interface. ProcessLocalDumpManagers | 50 // Memory Infra service implements this interface. ProcessLocalDumpManagers |
| 54 // register themselves using the RegisterProcessLocalDumpManager method and | 51 // register themselves using the RegisterProcessLocalDumpManager method and |
| 55 // suggest a global memory dump using the RequestGlobalMemoryDump method. | 52 // suggest a global memory dump using the RequestGlobalMemoryDump method. |
| 56 interface Coordinator { | 53 interface Coordinator { |
| 57 RegisterProcessLocalDumpManager(ProcessLocalDumpManager local_manager); | 54 RegisterProcessLocalDumpManager(ProcessLocalDumpManager local_manager); |
| 58 RequestGlobalMemoryDump(RequestArgs args) => (uint64 dump_guid, bool success); | 55 RequestGlobalMemoryDump(RequestArgs args) => (uint64 dump_guid, bool success); |
| 59 }; | 56 }; |
| OLD | NEW |