• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// 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
17package soong_build_metrics;
18option go_package = "android/soong/ui/metrics/metrics_proto";
19
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
33  enum BuildVariant {
34    USER = 0;
35    USERDEBUG = 1;
36    ENG = 2;
37  }
38  // The target build variant information, eg. eng.
39  optional BuildVariant target_build_variant = 5 [default = ENG];
40
41  enum Arch {
42    UNKNOWN = 0;
43    ARM = 1;
44    ARM64 = 2;
45    X86 = 3;
46    X86_64 = 4;
47  }
48  // The target arch information, eg. arm.
49  optional Arch target_arch = 6 [default = UNKNOWN];
50
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.
58  optional Arch host_arch = 9 [default = UNKNOWN];
59
60  // The host 2nd arch information, eg. x86.
61  optional Arch host_2nd_arch = 10 [default = UNKNOWN];
62
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;
92
93  // The metrics for the whole build
94  optional PerfInfo total = 21;
95
96  optional SoongBuildMetrics soong_build_metrics = 22;
97
98  optional BuildConfig build_config = 23;
99
100  // The hostname of the machine.
101  optional string hostname = 24;
102
103  // The system resource information such as total physical memory.
104  optional SystemResourceInfo system_resource_info = 25;
105
106  // The build command that the user entered to the build system.
107  optional string build_command = 26;
108
109  // The metrics for calling Bazel.
110  repeated PerfInfo bazel_runs = 27;
111
112  // The metrics of the experiment config fetcher
113  optional ExpConfigFetcher exp_config_fetcher = 28;
114}
115
116message BuildConfig {
117  optional bool use_goma = 1;
118
119  optional bool use_rbe = 2;
120
121  optional bool force_use_goma = 3;
122
123  // Whether the Bazel is acting as the Ninja executor for this build.
124  optional bool bazel_as_ninja = 4;
125
126  // Whether build is occurring in a mixed build mode, where Bazel maintains the
127  // definition and build of some modules in cooperation with Soong.
128  optional bool bazel_mixed_build = 5;
129
130  // These are the targets soong passes to ninja, these targets include special
131  // targets such as droid as well as the regular build targets.
132  repeated string targets = 6;
133}
134
135message SystemResourceInfo {
136  // The total physical memory in bytes.
137  optional uint64 total_physical_memory = 1;
138
139  // The total of available cores for building
140  optional int32 available_cpus = 2;
141}
142
143message PerfInfo {
144  // The description for the phase/action/part while the tool running.
145  optional string description = 1;
146
147  // The name for the running phase/action/part.
148  optional string name = 2;
149
150  // The absolute start time.
151  // The number of nanoseconds elapsed since January 1, 1970 UTC.
152  optional uint64 start_time = 3;
153
154  // The real running time.
155  // The number of nanoseconds elapsed since start_time.
156  optional uint64 real_time = 4;
157
158  // The number of MB for memory use (deprecated as it is too generic).
159  optional uint64 memory_use = 5 [deprecated=true];
160
161  // The resource information of each executed process.
162  repeated ProcessResourceInfo processes_resource_info = 6;
163}
164
165message ProcessResourceInfo {
166  // The name of the process for identification.
167  optional string name = 1;
168
169  // The amount of time spent executing in user space in microseconds.
170  optional uint64 user_time_micros = 2;
171
172  // The amount of time spent executing in kernel mode in microseconds.
173  optional uint64 system_time_micros = 3;
174
175  // The maximum resident set size memory used in kilobytes.
176  optional uint64 max_rss_kb = 4;
177
178  // The number of minor page faults serviced without any I/O activity.
179  optional uint64 minor_page_faults = 5;
180
181  // The number of major page faults serviced that required I/O activity.
182  optional uint64 major_page_faults = 6;
183
184  // Total IO input in kilobytes.
185  optional uint64 io_input_kb= 7;
186
187  // Total IO output in kilobytes.
188  optional uint64 io_output_kb = 8;
189
190  // The number of voluntary context switches
191  optional uint64 voluntary_context_switches = 9;
192
193  // The number of involuntary context switches
194  optional uint64 involuntary_context_switches = 10;
195}
196
197message ModuleTypeInfo {
198  enum BuildSystem {
199    UNKNOWN = 0;
200    SOONG = 1;
201    MAKE = 2;
202  }
203  // The build system, eg. Soong or Make.
204  optional BuildSystem build_system = 1 [default = UNKNOWN];
205
206  // The module type, eg. java_library, cc_binary, and etc.
207  optional string module_type = 2;
208
209  // The number of logical modules.
210  optional uint32 num_of_modules = 3;
211}
212
213message CriticalUserJourneyMetrics {
214  // The name of a critical user journey test.
215  optional string name = 1;
216
217  // The metrics produced when running the critical user journey test.
218  optional MetricsBase metrics = 2;
219}
220
221message CriticalUserJourneysMetrics {
222  // A set of metrics from a run of the critical user journey tests.
223  repeated CriticalUserJourneyMetrics cujs = 1;
224}
225
226message SoongBuildMetrics {
227  // The number of modules handled by soong_build.
228  optional uint32 modules = 1;
229
230  // The total number of variants handled by soong_build.
231  optional uint32 variants = 2;
232
233  // The total number of allocations in soong_build.
234  optional uint64 total_alloc_count = 3;
235
236  // The total size of allocations in soong_build in bytes.
237  optional uint64 total_alloc_size = 4;
238
239  // The approximate maximum size of the heap in soong_build in bytes.
240  optional uint64 max_heap_size = 5;
241
242  // Runtime metrics for soong_build execution.
243  repeated PerfInfo events = 6;
244}
245
246message ExpConfigFetcher {
247  enum ConfigStatus {
248    NO_CONFIG = 0;
249    CONFIG = 1;
250    ERROR = 2;
251  }
252  // The result of the call to expconfigfetcher
253  // NO_CONFIG - Not part of experiment
254  // CONFIG - Part of experiment, config copied successfully
255  // ERROR - expconfigfetcher failed
256  optional ConfigStatus status = 1;
257
258  // The output config filename
259  optional string filename = 2;
260
261  // Time, in microseconds, taken by the expconfigfetcher
262  optional uint64 micros = 3;
263}
264