blob: 44f88597736321277d0a68bb06965e464dc12c31 [file] [log] [blame]
Nan Zhang17f27672018-12-12 16:01:49 -08001// Copyright 2018 Google Inc. All Rights Reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto2";
16
Patrice Arruda0cc5b212019-06-14 15:27:46 -070017package soong_build_metrics;
18option go_package = "soong_metrics_proto";
Nan Zhang17f27672018-12-12 16:01:49 -080019
20message MetricsBase {
21 // Timestamp generated when the build starts.
22 optional int64 build_date_timestamp = 1;
23
24 // It is usually used to specify the branch name [and release candidate].
25 optional string build_id = 2;
26
27 // The platform version codename, eg. P, Q, REL.
28 optional string platform_version_codename = 3;
29
30 // The target product information, eg. aosp_arm.
31 optional string target_product = 4;
32
Patrice Arruda0cc5b212019-06-14 15:27:46 -070033 enum BuildVariant {
Nan Zhang17f27672018-12-12 16:01:49 -080034 USER = 0;
35 USERDEBUG = 1;
36 ENG = 2;
37 }
38 // The target build variant information, eg. eng.
Patrice Arruda0cc5b212019-06-14 15:27:46 -070039 optional BuildVariant target_build_variant = 5 [default = ENG];
Nan Zhang17f27672018-12-12 16:01:49 -080040
Patrice Arruda0cc5b212019-06-14 15:27:46 -070041 enum Arch {
Nan Zhang17f27672018-12-12 16:01:49 -080042 UNKNOWN = 0;
43 ARM = 1;
44 ARM64 = 2;
45 X86 = 3;
46 X86_64 = 4;
47 }
48 // The target arch information, eg. arm.
Patrice Arruda0cc5b212019-06-14 15:27:46 -070049 optional Arch target_arch = 6 [default = UNKNOWN];
Nan Zhang17f27672018-12-12 16:01:49 -080050
51 // The target arch variant information, eg. armv7-a-neon.
52 optional string target_arch_variant = 7;
53
54 // The target cpu variant information, eg. generic.
55 optional string target_cpu_variant = 8;
56
57 // The host arch information, eg. x86_64.
Patrice Arruda0cc5b212019-06-14 15:27:46 -070058 optional Arch host_arch = 9 [default = UNKNOWN];
Nan Zhang17f27672018-12-12 16:01:49 -080059
60 // The host 2nd arch information, eg. x86.
Patrice Arruda0cc5b212019-06-14 15:27:46 -070061 optional Arch host_2nd_arch = 10 [default = UNKNOWN];
Nan Zhang17f27672018-12-12 16:01:49 -080062
63 // The host os information, eg. linux.
64 optional string host_os = 11;
65
66 // The host os extra information, eg. Linux-4.17.0-3rodete2-amd64-x86_64-Debian-GNU.
67 optional string host_os_extra = 12;
68
69 // The host cross os information, eg. windows.
70 optional string host_cross_os = 13;
71
72 // The host cross arch information, eg. x86.
73 optional string host_cross_arch = 14;
74
75 // The host cross 2nd arch information, eg. x86_64.
76 optional string host_cross_2nd_arch = 15;
77
78 // The directory for generated built artifacts installation, eg. out.
79 optional string out_dir = 16;
80
81 // The metrics for calling various tools (microfactory) before Soong_UI starts.
82 repeated PerfInfo setup_tools = 17;
83
84 // The metrics for calling Kati by multiple times.
85 repeated PerfInfo kati_runs = 18;
86
87 // The metrics for calling Soong.
88 repeated PerfInfo soong_runs = 19;
89
90 // The metrics for calling Ninja.
91 repeated PerfInfo ninja_runs = 20;
Colin Cross74cda722020-01-16 15:25:50 -080092
93 // The metrics for the whole build
94 optional PerfInfo total = 21;
Colin Crossb72c9092020-02-10 11:23:49 -080095
96 optional SoongBuildMetrics soong_build_metrics = 22;
Patrice Arruda96850362020-08-11 20:41:11 +000097
98 optional BuildConfig build_config = 23;
Patrice Arruda4fb8adc2020-10-12 22:38:06 +000099
100 // The hostname of the machine.
101 optional string hostname = 24;
Patrice Arruda3edfd482020-10-13 23:58:41 +0000102
103 // The system resource information such as total physical memory.
104 optional SystemResourceInfo system_resource_info = 25;
Patrice Arruda96850362020-08-11 20:41:11 +0000105}
106
107message BuildConfig {
108 optional bool use_goma = 1;
109
110 optional bool use_rbe = 2;
Patrice Arrudac97d6dc2020-09-28 18:22:07 +0000111
112 optional bool force_use_goma = 3;
Nan Zhang17f27672018-12-12 16:01:49 -0800113}
114
Patrice Arruda3edfd482020-10-13 23:58:41 +0000115message SystemResourceInfo {
116 // The total physical memory in bytes.
117 optional uint64 total_physical_memory = 1;
118
119 // The total of available cores for building
120 optional int32 available_cpus = 2;
121}
122
Nan Zhang17f27672018-12-12 16:01:49 -0800123message PerfInfo {
124 // The description for the phase/action/part while the tool running.
125 optional string desc = 1;
126
127 // The name for the running phase/action/part.
128 optional string name = 2;
129
130 // The absolute start time.
131 // The number of nanoseconds elapsed since January 1, 1970 UTC.
132 optional uint64 start_time = 3;
133
134 // The real running time.
135 // The number of nanoseconds elapsed since start_time.
136 optional uint64 real_time = 4;
137
Patrice Arrudafec3bf22020-10-19 10:55:34 -0700138 // The number of MB for memory use (deprecated as it is too generic).
139 optional uint64 memory_use = 5 [deprecated=true];
140
141 // The resource information of each executed process.
142 repeated ProcessResourceInfo processes_resource_info = 6;
143}
144
145message ProcessResourceInfo {
146 // The name of the process for identification.
147 optional string name = 1;
148
149 // The amount of time spent executing in user space in microseconds.
150 optional uint64 user_time_micros = 2;
151
152 // The amount of time spent executing in kernel mode in microseconds.
153 optional uint64 system_time_micros = 3;
154
155 // The maximum resident set size memory used in kilobytes.
156 optional uint64 max_rss_kb = 4;
157
158 // The number of minor page faults serviced without any I/O activity.
159 optional uint64 minor_page_faults = 5;
160
161 // The number of major page faults serviced that required I/O activity.
162 optional uint64 major_page_faults = 6;
163
164 // Total IO input in kilobytes.
165 optional uint64 io_input_kb= 7;
166
167 // Total IO output in kilobytes.
168 optional uint64 io_output_kb = 8;
169
170 // The number of voluntary context switches
171 optional uint64 voluntary_context_switches = 9;
172
173 // The number of involuntary context switches
174 optional uint64 involuntary_context_switches = 10;
Nan Zhang17f27672018-12-12 16:01:49 -0800175}
176
177message ModuleTypeInfo {
Patrice Arruda0cc5b212019-06-14 15:27:46 -0700178 enum BuildSystem {
Nan Zhang17f27672018-12-12 16:01:49 -0800179 UNKNOWN = 0;
180 SOONG = 1;
181 MAKE = 2;
182 }
183 // The build system, eg. Soong or Make.
Patrice Arruda0cc5b212019-06-14 15:27:46 -0700184 optional BuildSystem build_system = 1 [default = UNKNOWN];
Nan Zhang17f27672018-12-12 16:01:49 -0800185
186 // The module type, eg. java_library, cc_binary, and etc.
187 optional string module_type = 2;
188
189 // The number of logical modules.
190 optional uint32 num_of_modules = 3;
191}
Colin Crossd0be2102019-11-26 16:16:57 -0800192
193message CriticalUserJourneyMetrics {
194 // The name of a critical user journey test.
195 optional string name = 1;
196
197 // The metrics produced when running the critical user journey test.
198 optional MetricsBase metrics = 2;
199}
200
201message CriticalUserJourneysMetrics {
202 // A set of metrics from a run of the critical user journey tests.
203 repeated CriticalUserJourneyMetrics cujs = 1;
Colin Crossb72c9092020-02-10 11:23:49 -0800204}
205
206message SoongBuildMetrics {
207 // The number of modules handled by soong_build.
208 optional uint32 modules = 1;
209
210 // The total number of variants handled by soong_build.
211 optional uint32 variants = 2;
212
213 // The total number of allocations in soong_build.
214 optional uint64 total_alloc_count = 3;
215
216 // The total size of allocations in soong_build in bytes.
217 optional uint64 total_alloc_size = 4;
218
219 // The approximate maximum size of the heap in soong_build in bytes.
220 optional uint64 max_heap_size = 5;
Patrice Arruda96850362020-08-11 20:41:11 +0000221}