• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1syntax = "proto2";
2
3package android.os.statsd.art;
4
5import "frameworks/proto_logging/stats/atoms.proto";
6import "frameworks/proto_logging/stats/atom_field_options.proto";
7
8option java_package = "com.android.os.art";
9option java_multiple_files = true;
10
11extend Atom {
12    // Pushed atoms
13    optional ArtDatumReported art_datum_reported = 332 [(module) = "art"];
14    // Deprecated in favour of the ArtDeviceStatus pulled atom
15    optional ArtDeviceDatumReported art_device_datum_reported = 550 [(module) = "art", deprecated = true];
16    optional ArtDatumDeltaReported art_datum_delta_reported = 565 [(module) = "art"];
17
18    // Pulled atoms
19    optional ArtDeviceStatus art_device_status = 10205 [(module) = "art"];
20}
21
22// Indicates which compile filter was used for the package being loaded in an ART session.
23enum ArtCompileFilter {
24    ART_COMPILATION_FILTER_UNSPECIFIED = 0;
25    ART_COMPILATION_FILTER_ERROR = 1;
26    ART_COMPILATION_FILTER_UNKNOWN = 2;
27    ART_COMPILATION_FILTER_ASSUMED_VERIFIED = 3;
28    ART_COMPILATION_FILTER_EXTRACT = 4;
29    ART_COMPILATION_FILTER_VERIFY = 5;
30    ART_COMPILATION_FILTER_QUICKEN = 6;
31    ART_COMPILATION_FILTER_SPACE_PROFILE = 7;
32    ART_COMPILATION_FILTER_SPACE = 8;
33    ART_COMPILATION_FILTER_SPEED_PROFILE = 9;
34    ART_COMPILATION_FILTER_SPEED = 10;
35    ART_COMPILATION_FILTER_EVERYTHING_PROFILE = 11;
36    ART_COMPILATION_FILTER_EVERYTHING = 12;
37    ART_COMPILATION_FILTER_FAKE_RUN_FROM_APK = 13;
38    ART_COMPILATION_FILTER_FAKE_RUN_FROM_APK_FALLBACK = 14;
39    ART_COMPILATION_FILTER_FAKE_RUN_FROM_VDEX_FALLBACK = 15;
40}
41
42// Indicates what triggered the compilation of the package.
43enum ArtCompilationReason {
44    ART_COMPILATION_REASON_UNSPECIFIED = 0;
45    ART_COMPILATION_REASON_ERROR = 1;
46    ART_COMPILATION_REASON_UNKNOWN = 2;
47    ART_COMPILATION_REASON_FIRST_BOOT = 3;
48    ART_COMPILATION_REASON_BOOT = 4;
49    ART_COMPILATION_REASON_INSTALL = 5;
50    ART_COMPILATION_REASON_BG_DEXOPT = 6;
51    ART_COMPILATION_REASON_AB_OTA = 7;
52    ART_COMPILATION_REASON_INACTIVE = 8;
53    ART_COMPILATION_REASON_SHARED = 9;
54    ART_COMPILATION_REASON_INSTALL_WITH_DEX_METADATA = 10;
55    ART_COMPILATION_REASON_POST_BOOT = 11;
56    ART_COMPILATION_REASON_INSTALL_FAST = 12;
57    ART_COMPILATION_REASON_INSTALL_BULK = 13;
58    ART_COMPILATION_REASON_INSTALL_BULK_SECONDARY = 14;
59    ART_COMPILATION_REASON_INSTALL_BULK_DOWNGRADED = 15;
60    ART_COMPILATION_REASON_INSTALL_BULK_SECONDARY_DOWNGRADED = 16;
61    ART_COMPILATION_REASON_BOOT_AFTER_OTA = 17;
62    ART_COMPILATION_REASON_PREBUILT = 18;
63    ART_COMPILATION_REASON_CMDLINE = 19;
64    ART_COMPILATION_REASON_VDEX = 20;
65    ART_COMPILATION_REASON_BOOT_AFTER_MAINLINE_UPDATE = 21;
66}
67
68// Indicates which kind of measurement ART is reporting.
69//
70// Where it makes sense, the datum ID ends with the type of datum (counter or histogram) and the
71// units.
72// Note: Histograms are not yet reported by statsd.
73enum ArtDatumId {
74    ART_DATUM_INVALID = 0;
75    ART_DATUM_GC_WORLD_STOP_TIME_AVG_MICROS = 1;
76    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_TIME_HISTO_MILLIS = 2;
77    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_COUNT = 3;
78    ART_DATUM_GC_FULL_HEAP_COLLECTION_TIME_HISTO_MILLIS = 4;
79    ART_DATUM_GC_FULL_HEAP_COLLECTION_COUNT = 5;
80    ART_DATUM_JIT_METHOD_COMPILE_TIME_MICROS = 6;
81    ART_DATUM_AOT_COMPILE_TIME = 7;
82    ART_DATUM_CLASS_VERIFICATION_TIME_COUNTER_MICROS = 8;
83    ART_DATUM_CLASS_LOADING_TIME_COUNTER_MICROS = 9;
84
85    // Metrics IDs for dex2oat.
86    ART_DATUM_DEX2OAT_RESULT_CODE = 10 [deprecated = true];
87    ART_DATUM_DEX2OAT_DEX_CODE_COUNTER_BYTES = 11 [deprecated = true];
88    ART_DATUM_DEX2OAT_TOTAL_TIME_COUNTER_MILLIS = 12 [deprecated = true];
89    ART_DATUM_DEX2OAT_VERIFY_DEX_FILE_TIME_COUNTER_MILLIS = 13 [deprecated = true];
90    ART_DATUM_DEX2OAT_FAST_VERIFY_TIME_COUNTER_MILLIS = 14 [deprecated = true];
91    ART_DATUM_DEX2OAT_RESOLVE_METHODS_AND_FIELDS_TIME_COUNTER_MILLIS = 15 [deprecated = true];
92
93    ART_DATUM_CLASS_VERIFICATION_COUNT = 16;
94    ART_DATUM_GC_TOTAL_BYTES_ALLOCATED = 17;
95    ART_DATUM_GC_TOTAL_METADATA_SIZE_BYTES = 18 [deprecated=true];
96    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_THROUGHPUT_HISTO_MB_PER_SEC = 19;
97    ART_DATUM_GC_FULL_HEAP_COLLECTION_THROUGHPUT_HISTO_MB_PER_SEC = 20;
98    ART_DATUM_JIT_METHOD_COMPILE_COUNT = 21;
99    ART_DATUM_GC_YOUNG_GENERATION_TRACING_THROUGHPUT_HISTO_MB_PER_SEC = 22;
100    ART_DATUM_GC_FULL_HEAP_TRACING_THROUGHPUT_HISTO_MB_PER_SEC = 23;
101    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC = 24;
102    ART_DATUM_GC_FULL_HEAP_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC = 25;
103    ART_DATUM_GC_YOUNG_GENERATION_TRACING_THROUGHPUT_AVG_MB_PER_SEC = 26;
104    ART_DATUM_GC_FULL_HEAP_TRACING_THROUGHPUT_AVG_MB_PER_SEC = 27;
105    ART_DATUM_GC_TOTAL_COLLECTION_TIME_MS = 28;
106
107    // New metrics to support averages reported as sum (numerator) and count (denominator),
108    // in order to make it easier to be reported as Value Metrics.
109
110    // numerator from ART_DATUM_GC_WORLD_STOP_TIME_AVG_MICROS
111    ART_DATUM_GC_WORLD_STOP_TIME_US = 29;
112    // denominator from ART_DATUM_GC_WORLD_STOP_TIME_AVG_MICROS
113    ART_DATUM_GC_WORLD_STOP_COUNT = 30;
114    // numerator from ART_DATUM_GC_YOUNG_GENERATION_TRACING_THROUGHPUT_AVG_MB_PER_SEC
115    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_SCANNED_BYTES = 31;
116    // numerator from ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
117    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_FREED_BYTES = 32;
118    // denominator from ART_DATUM_GC_YOUNG_GENERATION_TRACING_THROUGHPUT_AVG_MB_PER_SEC
119    // and ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
120    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_DURATION_MS = 33;
121    // numerator from ART_DATUM_GC_FULL_HEAP_TRACING_THROUGHPUT_AVG_MB_PER_SEC
122    ART_DATUM_GC_FULL_HEAP_COLLECTION_SCANNED_BYTES = 34;
123    // numerator from ART_DATUM_GC_FULL_HEAP_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
124    ART_DATUM_GC_FULL_HEAP_COLLECTION_FREED_BYTES = 35;
125    // denominator from ART_DATUM_GC_FULL_HEAP_TRACING_THROUGHPUT_AVG_MB_PER_SEC
126    // and ART_DATUM_GC_FULL_HEAP_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
127    ART_DATUM_GC_FULL_HEAP_COLLECTION_DURATION_MS = 36;
128}
129
130// Indicates which kind of measurement ART is reporting as increments / deltas.
131// Next ID: 37
132enum ArtDatumDeltaId {
133    ART_DATUM_DELTA_INVALID = 0;
134
135    // These IDs are the equivalent of the ArtDatumId values,
136    // but for reporting increments / deltas.
137    ART_DATUM_DELTA_CLASS_VERIFICATION_COUNT = 16;
138    ART_DATUM_DELTA_CLASS_VERIFICATION_TIME_MICROS = 8;
139    ART_DATUM_DELTA_CLASS_LOADING_TIME_MICROS = 9;
140    ART_DATUM_DELTA_GC_FULL_HEAP_COLLECTION_COUNT = 5;
141    ART_DATUM_DELTA_GC_TOTAL_BYTES_ALLOCATED = 17;
142    ART_DATUM_DELTA_GC_TOTAL_COLLECTION_TIME_MS = 28;
143    ART_DATUM_DELTA_GC_YOUNG_GENERATION_COLLECTION_COUNT = 3;
144    ART_DATUM_DELTA_JIT_METHOD_COMPILE_COUNT = 21;
145    ART_DATUM_DELTA_JIT_METHOD_COMPILE_TIME_MICROS = 6;
146
147    // numerator from ART_DATUM_GC_WORLD_STOP_TIME_AVG_MICROS
148    ART_DATUM_DELTA_GC_WORLD_STOP_TIME_US = 29;
149    // denominator from ART_DATUM_GC_WORLD_STOP_TIME_AVG_MICROS
150    ART_DATUM_DELTA_GC_WORLD_STOP_COUNT = 30;
151    // numerator from ART_DATUM_GC_YOUNG_GENERATION_TRACING_THROUGHPUT_AVG_MB_PER_SEC
152    ART_DATUM_DELTA_GC_YOUNG_GENERATION_COLLECTION_SCANNED_BYTES = 31;
153    // numerator from ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
154    ART_DATUM_DELTA_GC_YOUNG_GENERATION_COLLECTION_FREED_BYTES = 32;
155    // denominator from ART_DATUM_GC_YOUNG_GENERATION_TRACING_THROUGHPUT_AVG_MB_PER_SEC
156    // and ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
157    ART_DATUM_DELTA_GC_YOUNG_GENERATION_COLLECTION_DURATION_MS = 33;
158    // numerator from ART_DATUM_GC_FULL_HEAP_TRACING_THROUGHPUT_AVG_MB_PER_SEC
159    ART_DATUM_DELTA_GC_FULL_HEAP_COLLECTION_SCANNED_BYTES = 34;
160    // numerator from ART_DATUM_GC_FULL_HEAP_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
161    ART_DATUM_DELTA_GC_FULL_HEAP_COLLECTION_FREED_BYTES = 35;
162    // denominator from ART_DATUM_GC_FULL_HEAP_TRACING_THROUGHPUT_AVG_MB_PER_SEC
163    // and ART_DATUM_GC_FULL_HEAP_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
164    ART_DATUM_DELTA_GC_FULL_HEAP_COLLECTION_DURATION_MS = 36;
165    // The number of milliseconds since the last time metrics were reported.
166    ART_DATUM_DELTA_TIME_ELAPSED_MS = 37;
167
168    reserved 1, 2, 4, 7, 10, 11, 12, 13, 14, 15, 18, 19, 20, 22, 23, 24, 25, 26, 27;
169}
170
171// DEPRECATED - Used to indicate what class of thread the reported values apply to.
172// Deprecated in Jan 2024 as the corresponding filter is no longer needed.
173enum ArtThreadType {
174    ART_THREAD_UNKNOWN = 0;
175    ART_THREAD_MAIN = 1;
176    ART_THREAD_BACKGROUND = 2;
177}
178
179// DEPRECATED - Used to indicate the type of dex metadata.
180// Deprecated in Jan 2024 as the corresponding filter is no longer needed.
181enum ArtDexMetadataType {
182  ART_DEX_METADATA_TYPE_UNKNOWN = 0;
183  ART_DEX_METADATA_TYPE_PROFILE = 1;
184  ART_DEX_METADATA_TYPE_VDEX = 2;
185  ART_DEX_METADATA_TYPE_PROFILE_AND_VDEX = 3;
186  ART_DEX_METADATA_TYPE_NONE = 4;
187  ART_DEX_METADATA_TYPE_ERROR = 5;
188}
189
190// DEPRECATED - Used to indicate the type of the apk.
191// Deprecated in Jan 2024 as the corresponding filter is no longer needed.
192enum ArtApkType {
193    ART_APK_TYPE_UNKNOWN = 0;
194    ART_APK_TYPE_BASE = 1;
195    ART_APK_TYPE_SPLIT = 2;
196}
197
198// Indicates the ISA.
199enum ArtIsa {
200    ART_ISA_UNKNOWN = 0;
201    ART_ISA_ARM = 1;
202    ART_ISA_ARM64 = 2;
203    ART_ISA_X86 = 3;
204    ART_ISA_X86_64 = 4;
205    ART_ISA_MIPS = 5;
206    ART_ISA_MIPS64 = 6;
207    ART_ISA_RISCV64 = 7;
208}
209
210// Indicates the GC collector type.
211enum ArtGcCollectorType {
212    ART_GC_COLLECTOR_TYPE_UNKNOWN = 0;
213    ART_GC_COLLECTOR_TYPE_MARK_SWEEP = 1;
214    ART_GC_COLLECTOR_TYPE_CONCURRENT_MARK_SWEEP = 2;
215    ART_GC_COLLECTOR_TYPE_CONCURRENT_MARK_COMPACT = 3;
216    ART_GC_COLLECTOR_TYPE_SEMI_SPACE = 4;
217    ART_GC_COLLECTOR_TYPE_CONCURRENT_COPYING = 5;
218    ART_GC_COLLECTOR_TYPE_CONCURRENT_COPYING_BACKGROUND = 6;
219    ART_GC_COLLECTOR_TYPE_CONCURRENT_MARK_COMPACT_BACKGROUND = 7;
220}
221
222// Indicates support for userfaultfd and minor fault mode.
223enum ArtUffdSupport {
224    ART_UFFD_SUPPORT_UNKNOWN = 0;
225    ART_UFFD_SUPPORT_UFFD_NOT_SUPPORTED = 1;
226    ART_UFFD_SUPPORT_MINOR_FAULT_MODE_NOT_SUPPORTED = 2;
227    ART_UFFD_SUPPORT_MINOR_FAULT_MODE_SUPPORTED = 3;
228}
229
230message ArtDatumReported {
231    // The session ID is used to correlate this report with others from the same ART instance.
232    optional int64 session_id = 1;
233
234    // The UID of the app that ART is running on behalf of.
235    optional int32 uid = 2 [(is_uid) = true];
236
237    // What compiler filter the APK or DEX file was compiled with.
238    optional ArtCompileFilter compile_filter = 3;
239
240    // Why the package was compiled the way it was.
241    optional ArtCompilationReason compilation_reason = 4;
242
243    // The number of milliseconds since the ART runtime instance was started.
244    optional int64 timestamp_millis = 5;
245
246    // What kind of thread (UI or background) this metric corresponds to.
247    optional ArtThreadType thread_type = 6 [deprecated = true];
248
249    // Which counter this is that is being reported.
250    optional ArtDatumId kind = 7;
251
252    // The value of the counter.
253    optional int64 value = 8;
254
255    // The type of dex metadata
256    optional ArtDexMetadataType dex_metadata_type = 9 [deprecated = true];
257
258    // The type of the APK file.
259    optional ArtApkType apk_type = 10 [deprecated = true];
260
261    // The ISA of the device.
262    optional ArtIsa isa = 11;
263
264    // The Garbage Collector used in the Android Runtime.
265    optional ArtGcCollectorType gc = 12;
266
267    // The support for userfaultfd and minor fault mode.
268    optional ArtUffdSupport uffd_support = 13;
269}
270
271// ArtDatumDeltaReported is the same as ArtDatumReported, except for the kind field
272// (ArtDatumDeltaId here, ArtDatumId for ArtDatumReported)
273message ArtDatumDeltaReported {
274    // The session ID is used to correlate this report with others from the same ART instance.
275    optional int64 session_id = 1;
276
277    // The UID of the app that ART is running on behalf of.
278    optional int32 uid = 2 [(is_uid) = true];
279
280    // What compiler filter the APK or DEX file was compiled with.
281    optional ArtCompileFilter compile_filter = 3;
282
283    // Why the package was compiled the way it was.
284    optional ArtCompilationReason compilation_reason = 4;
285
286    // The number of milliseconds since the ART runtime instance was started.
287    optional int64 timestamp_millis = 5;
288
289    // What kind of thread (UI or background) this metric corresponds to.
290    optional ArtThreadType thread_type = 6 [deprecated = true];
291
292    // Which counter this is that is being reported.
293    optional ArtDatumDeltaId kind = 7;
294
295    // The value of the counter.
296    optional int64 value = 8;
297
298    // The type of dex metadata
299    optional ArtDexMetadataType dex_metadata_type = 9 [deprecated = true];
300
301    // The type of the APK file.
302    optional ArtApkType apk_type = 10 [deprecated = true];
303
304    // The ISA of the device.
305    optional ArtIsa isa = 11;
306
307    // The Garbage Collector used in the Android Runtime.
308    optional ArtGcCollectorType gc = 12;
309
310    // The support for userfaultfd and minor fault mode.
311    optional ArtUffdSupport uffd_support = 13;
312}
313
314/**
315 * Logs ART metrics that are device-specific (as opposed to app-specific ones logged by
316 * ArtDatumReported).
317 *
318 * Logged from:
319 *   art/runtime/metrics/statsd.cc
320 */
321 message ArtDeviceDatumReported {
322    enum BootImageStatus {
323        // Unknown value.
324        STATUS_UNSPECIFIED = 0;
325        // Boot image(s) are fully usable.
326        STATUS_FULL = 1;
327        // Only the minimal boot image is usable.
328        STATUS_MINIMAL = 2;
329        // No boot image is usable.
330        STATUS_NONE = 3;
331    }
332
333    optional BootImageStatus boot_image_status = 1;
334}
335
336/**
337 * Reports ART metrics that are device-specific (as opposed to app-specific ones logged by
338 * ArtDatumReported).
339 */
340message ArtDeviceStatus {
341    enum BootImageStatus {
342        // Unknown value.
343        STATUS_UNSPECIFIED = 0;
344        // Boot image(s) are fully usable.
345        STATUS_FULL = 1;
346        // Only the minimal boot image is usable.
347        STATUS_MINIMAL = 2;
348        // No boot image is usable.
349        STATUS_NONE = 3;
350    }
351    optional BootImageStatus boot_image_status = 1;
352}
353