OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 module metrics; | |
6 | |
7 struct LeakDetectorParams { | |
8 float sampling_rate; | |
9 uint32 max_stack_depth; | |
10 uint64 analysis_interval_bytes; | |
11 uint32 size_suspicion_threshold; | |
12 uint32 call_stack_suspicion_threshold; | |
13 }; | |
14 | |
15 struct AllocationBreakdown { | |
16 array<uint32> counts_by_size; | |
17 uint32 count_for_call_stack; | |
18 }; | |
19 | |
20 struct MemoryLeakReport { | |
21 uint32 size_bytes; | |
22 array<uint64> call_stack; | |
23 | |
24 enum ProcessType { | |
25 UNKNOWN_PROCESS = 0, | |
26 BROWSER_PROCESS = 1, | |
27 RENDERER_PROCESS = 2, | |
28 }; | |
29 ProcessType process_type; | |
30 | |
31 array<AllocationBreakdown> alloc_breakdown_history; | |
32 }; | |
33 | |
34 // Provides a remote interface for enabling LeakDetector on remote processes. | |
35 interface LeakDetectorRemote { | |
Ben Goodger (Google)
2016/06/17 22:22:03
Can we not use the *Remote suffix for something th
Simon Que
2016/06/18 04:17:53
I can't use "LeakDetector" because that name alrea
dcheng
2016/06/18 06:17:08
The general convention is to define mojo interface
| |
36 // Returns a LeakDetectorParams struct. Used to indicate to the remote process | |
37 // what parameters to use when initializing LeakDetector. Can also return | |
38 // |params.sampling_rate| == 0 to indicate that LeakDetector should not be | |
39 // initialized on a particular process. | |
40 GetParams() => (LeakDetectorParams params); | |
41 | |
42 // When a remote process running LeakDetector gets some leak reports, it | |
43 // should call this function to return the leak reports back to the main | |
44 // process that implements this function. The reports should be sent back as | |
45 // an array of serialized MemoryLeakReportProtos. | |
46 SendLeakReports(array<MemoryLeakReport> reports); | |
47 }; | |
OLD | NEW |