OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef COMPONENTS_METRICS_CALL_STACK_PROFILE_PARAMS_H_ | 5 #ifndef COMPONENTS_METRICS_CALL_STACK_PROFILE_PARAMS_H_ |
6 #define COMPONENTS_METRICS_CALL_STACK_PROFILE_PARAMS_H_ | 6 #define COMPONENTS_METRICS_CALL_STACK_PROFILE_PARAMS_H_ |
7 | 7 |
8 namespace metrics { | 8 namespace metrics { |
9 | 9 |
10 // Parameters to pass back to the metrics provider. | 10 // Parameters to pass back to the metrics provider. |
11 struct CallStackProfileParams { | 11 struct CallStackProfileParams { |
| 12 // The process in which the collection occurred. |
| 13 enum Process { |
| 14 UNKNOWN_PROCESS, |
| 15 BROWSER_PROCESS, |
| 16 RENDERER_PROCESS, |
| 17 GPU_PROCESS, |
| 18 UTILITY_PROCESS, |
| 19 ZYGOTE_PROCESS, |
| 20 SANDBOX_HELPER_PROCESS, |
| 21 PPAPI_PLUGIN_PROCESS, |
| 22 PPAPI_BROKER_PROCESS |
| 23 }; |
| 24 |
| 25 // The thread from which the collection occurred. |
| 26 enum Thread { |
| 27 UNKNOWN_THREAD, |
| 28 |
| 29 // Browser process threads, some of which occur in other processes as well. |
| 30 UI_THREAD, |
| 31 FILE_THREAD, |
| 32 FILE_USER_BLOCKING_THREAD, |
| 33 PROCESS_LAUNCHER_THREAD, |
| 34 CACHE_THREAD, |
| 35 IO_THREAD, |
| 36 DB_THREAD, |
| 37 |
| 38 // GPU process thread. |
| 39 GPU_MAIN_THREAD, |
| 40 |
| 41 // Renderer process threads. |
| 42 RENDER_THREAD, |
| 43 UTILITY_THREAD |
| 44 }; |
| 45 |
12 // The event that triggered the profile collection. | 46 // The event that triggered the profile collection. |
13 enum Trigger { | 47 enum Trigger { |
14 UNKNOWN, | 48 UNKNOWN, |
15 PROCESS_STARTUP, | 49 PROCESS_STARTUP, |
16 JANKY_TASK, | 50 JANKY_TASK, |
17 THREAD_HUNG, | 51 THREAD_HUNG, |
18 TRIGGER_LAST = THREAD_HUNG | 52 TRIGGER_LAST = THREAD_HUNG |
19 }; | 53 }; |
20 | 54 |
21 // Allows the caller to specify whether sample ordering is | 55 // Allows the caller to specify whether sample ordering is |
22 // important. MAY_SHUFFLE should always be used to enable better compression, | 56 // important. MAY_SHUFFLE should always be used to enable better compression, |
23 // unless the use case needs order to be preserved for a specific reason. | 57 // unless the use case needs order to be preserved for a specific reason. |
24 enum SampleOrderingSpec { | 58 enum SampleOrderingSpec { |
25 // The provider may shuffle the sample order to improve compression. | 59 // The provider may shuffle the sample order to improve compression. |
26 MAY_SHUFFLE, | 60 MAY_SHUFFLE, |
27 // The provider will not change the sample order. | 61 // The provider will not change the sample order. |
28 PRESERVE_ORDER | 62 PRESERVE_ORDER |
29 }; | 63 }; |
30 | 64 |
31 // The default constructor is required for mojo and should not be used | 65 // The default constructor is required for mojo and should not be used |
32 // otherwise. A valid trigger should always be specified. | 66 // otherwise. A valid trigger should always be specified. |
33 CallStackProfileParams(); | 67 CallStackProfileParams(); |
34 explicit CallStackProfileParams(Trigger trigger); | 68 CallStackProfileParams(Process process, Thread thread, Trigger trigger); |
35 CallStackProfileParams(Trigger trigger, SampleOrderingSpec ordering_spec); | 69 CallStackProfileParams(Process process, Thread thread, Trigger trigger, |
| 70 SampleOrderingSpec ordering_spec); |
| 71 |
| 72 // The collection process. |
| 73 Process process; |
| 74 |
| 75 // The collection thread. |
| 76 Thread thread; |
36 | 77 |
37 // The triggering event. | 78 // The triggering event. |
38 Trigger trigger; | 79 Trigger trigger; |
39 | 80 |
40 // Whether to preserve sample ordering. | 81 // Whether to preserve sample ordering. |
41 SampleOrderingSpec ordering_spec; | 82 SampleOrderingSpec ordering_spec; |
42 }; | 83 }; |
43 | 84 |
44 } // namespace metrics | 85 } // namespace metrics |
45 | 86 |
46 #endif // COMPONENTS_METRICS_CALL_STACK_PROFILE_PARAMS_H_ | 87 #endif // COMPONENTS_METRICS_CALL_STACK_PROFILE_PARAMS_H_ |
OLD | NEW |