1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
ash / components / arc / mojom / metrics.mojom [blame]
// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Next MinVersion: 37
module arc.mojom;
import "mojo/public/mojom/base/time.mojom";
import "ash/components/arc/mojom/anr.mojom";
[Extensible]
enum BootType {
// This is used only for backward compatibility reasons and the value has to
// be 0.
UNKNOWN = 0,
// This is for the very first (opt-in) boot.
FIRST_BOOT = 1,
// This is for the first boot after Chrome OS update which also updates the
// ARC image.
FIRST_BOOT_AFTER_UPDATE = 2,
// This is for a regular boot.
REGULAR_BOOT = 3,
};
// Describes a boot progress event.
struct BootProgressEvent {
// Name of the boot progress event in Android. Currently there are
// 11 boot progress events found in Android source repository:
// system/core/logcat/event.logtags
// frameworks/base/services/core/java/com/android/server/am/
// EventLogTags.logtags
// frameworks/base/services/core/java/com/android/server/
// EventLogTags.logtags
string event;
// Timestamp of the event in uptime obtained in ARC. The uptime
// is from clock source MONOTONIC_CLOCK since Chrome OS boots up.
// Therefore, we need to calibrate the correct elapsed time of the
// event by comparing the uptime with the ARC start time from
// the same clock source MONOTONIC_CLOCK in session manager.
int64 uptimeMillis;
};
// Describes a GFX metrics.
struct GfxMetrics {
// Total frames rendered, it includes janky frames below.
uint64 framesTotal;
// Janky frames.
uint64 framesJanky;
// Maximum frame time in milliseconds of 95% of frames sorted from the
// shortest to longest.
uint32 frameTimePercentile95;
};
[Extensible]
enum NativeBridgeType {
// Native bridge is not used.
NONE = 0,
// Using houdini translator.
HOUDINI = 1,
// Using ndk-translation translator.
NDK_TRANSLATION = 2,
};
// ChromeOS companion library provide window management functionality to the
// application running on ARC++. This enum list all functionality of it, for
// collect statistics information of it by UMA stat.
[Extensible]
enum CompanionLibApiId {
// If the companion library version doesn't support an API call,
// the API call will be recorded as UNSUPPORTED.
UNSUPPORTED = 0,
// com.google.android.chromeos.ChromeOsDeviceInformation
GET_DEVICE_MODE = 1,
GET_DISPLAY_TOPOLOGY = 2,
GET_PRIMARY_DISPLAY_ID = 3,
GET_WORKSPACE_INSETS = 4,
REGISTER_CALLBACK = 5,
UNREGISTER_CALLBACK = 6,
// com.google.android.chromeos.activity.ChromeOsTaskManagement
ACTIVATE_TASK = 7,
GET_CAPTION_HEIGHT = 8,
GET_HIDDEN_CAPTION_BUTTON = 9,
HIDE_CAPTION_BUTTON = 10,
GET_TASK_WINDOW_BOUNDS = 11,
GET_TASK_WINDOW_STATE = 12,
IS_SHADOW_HIDDEN = 13,
HIDE_SHADOW = 14,
ON_CLOSE_REQUEST_RESPONSE = 15,
SET_ON_CLOSE_REQUEST_HANDLER = 16,
REMOVE_ON_CLOSE_REQUEST_HANDLER = 17,
SET_TASK_WINDOW_BOUNDS = 18,
SET_TASK_WINDOW_STATE = 19,
// com.google.android.chromeos.activity.TaskWindowState
GET_WINDOW_STATE = 20,
// com.google.android.chromeos.view.WindowInteractionController
WINDOW_INTERACTION_CONTROLLER = 21,
// com.google.android.chromeos.widget.PopupWindow
SET_CLIPPING_TO_TASK_DISABLE = 22,
IS_CLIPPING_TO_TASK_DISABLED = 23,
};
[Extensible]
enum ArcDnsQuery {
// All other hostnames.
OTHER_HOST_NAME = 0,
// android.googleapis.com used by Android checkin.
ANDROID_API_HOST_NAME = 1,
};
// These enum values are persisted to metrics thus must be treated as
// append-only.
[Extensible]
enum ArcNetworkEvent {
kUnknown = 0,
kAndroidLegacyVpnConnection = 1,
kAndroidThirdPartyVpnConnection = 2,
kMojoConfigureAndroidVpn = 3,
kMojoDisconnectAndroidVpn = 4,
kMojoDnsTest = 5,
kMojoHttpTest = 6,
kMojoPingTest = 7,
kWifiScannerClientConnection = 8,
kWifiScannerGetScanResults = 9,
kWifiScannerGetSingleScanResults = 10,
kWifiScannerEnable = 11,
kWifiScannerDisable = 12,
kWifiScannerStartSingleScan = 13,
kWifiScannerStartBackgroundScan = 14,
kWifiScannerStartPnoScan = 15,
kWifiScannerRegisterListener = 16,
kWifiManagerStartScan = 17,
kWifiManagerEnable = 18,
kWifiManagerDisable = 19,
kWifiManagerDisconnect = 20,
kWifiManagerReconnect = 21,
kWifiManagerGetNetworks = 22,
kWifiManagerGetNetworksPrivileged = 23,
kWifiManagerAddNetwork = 24,
kWifiManagerRemoveNetwork = 25,
kWifiManagerEnableNetwork = 26,
kWifiManagerDisableNetwork = 27,
kWifiManagerConnect = 28,
kWifiManagerSave = 29,
kWifiManagerForget = 30,
kWifiManagerRegisterScanListener = 31,
kWifiManagerAddNetworkSuggestions = 32,
[MinVersion=17] kWifiManagerEnableTdls = 33,
[MinVersion=17] kWifiManagerStartLocalHotspot = 34,
[MinVersion=17] kWifiManagerAddPasspointConfiguration = 35,
[MinVersion=19] kAndroidIpsecIke2VpnConnection = 36,
[MinVersion=22] kAndroidVpnIpv6Provisioned = 37,
[MinVersion=22] kAndroidVpnIpv4Provisioned = 38,
[MinVersion=24] kAndroidDisconnectHostVpn = 39,
[MinVersion=27] kArcHostVpnStarting = 40,
[MinVersion=27] kArcHostVpnRouteReplaced = 41,
[MinVersion=27] kArcHostVpnDisconnected = 42,
};
// These enum values are persisted to metrics thus must be treated as
// append-only.
[Extensible]
enum ArcNetworkError {
kUnknown = 0,
kMojoGetNetworksError = 1,
kMojoWifiAddNetworkFailed = 2,
kMojoWifiForgetNetworkFailed = 3,
kMojoWifiConnectFailed = 4,
kMojoWifiDisconnectFailed = 5,
kMojoWifiScanTimeout = 6,
kMojoWifiGetScanResultsFailed = 7,
kNetdGetIpv4Error = 8,
kNetdSetIpv4Error = 9,
kNetdIfaceListError = 10,
kNetdIfaceUpError = 11,
kNetdIfaceMtuError = 12,
kNetdIfaceClearError = 13,
kNetdIfconfigGetError = 14,
kNetdRestartIpv6Error = 15,
kNetdIpForwardingStartError = 16,
kNetdIpForwardingStopError = 17,
kNetdIfaceForwardingStartError = 18,
kNetdIfaceForwardingStopError = 19,
kNetdTetheringStartError = 20,
kNetdTetheringStopError = 21,
kNetdSnatStartError = 22,
kNetdSnatStopError = 23,
[MinVersion=19] kPasspointInvalidConfigurationError = 24,
[MinVersion=27] kArcHostVpnConnectionError = 25,
[MinVersion=27] kArcHostVpnCrashedError = 26,
[MinVersion=27] kArcHostVpnInternalError = 27,
[MinVersion=28] kMojoWifiUpdateNetworkFailed = 28,
};
// Describes the type of app kill being reported.
[Extensible]
enum AppKillType {
LMKD_KILL = 0,
OOM_KILL = 1,
[MinVersion=31] GMS_UPDATE_KILL = 2,
[MinVersion=31] GMS_START_KILL = 3,
};
// Describes an app kill from ARC instance.
struct AppKill {
// Type of kill being reported.
AppKillType type;
// Number of kills. For LMKD kills, this is always 1. For OOM kills, this is
// the total oom_kill count from /proc/vm_stat.
uint32 count;
};
// Describes the primary ABI for an app
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum AppPrimaryAbi {
kNone = 0,
kArm = 1,
kArm64 = 2,
kX86 = 3,
kX86_64 = 4,
};
// Outlines the various states that can arise while performing Primary ABI
// Migration on a ChromeOS device.
[Extensible]
enum ArcCorePriAbiMigEvent {
// If an unknown event is reported, it will be recorded as UNSUPPORTED.
kUnsupported = 0,
kMigrationCompleted = 1,
kGmsNoDowngrade = 2,
kGmsDowngradeSuccess = 3,
kGmsDowngradeFailure = 4,
kWebviewNoDowngrade = 5,
kWebviewDowngradeSuccess = 6,
kWebviewDowngradeFailure = 7,
};
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
[Extensible]
enum DataRestoreStatus {
// Data restore was not needed.
kNotNeeded = 0,
// Data restore success.
kSuccess = 1,
// Data restore failed.
kFailed = 2,
};
// Enumerates variations of Low Latency Stylus Library.
[Extensible]
enum LowLatencyStylusLibraryType {
[Default] kUnsupported = 0,
kCPU = 1,
kGPU = 2,
};
// The prediction target set in Low Latency Stylus Library.
struct LowLatencyStylusLibPredictionTarget {
// Variations of Low Latency Stylus Library.
LowLatencyStylusLibraryType type;
// Prediction target set in Low Latency Stylus Library.
uint32 target;
};
// Enumerates the API call from ChromeOS Low-latency stylus library, which
// provides mechanisms to reduce the draw latency for ARC++ app running on
// ChromeOS.
[Extensible]
enum LowLatencyStylusLibApiId {
// If the library version doesn't support an API call, the API
// call will be recorded as UNSUPPORTED.
[Default] kUnsupported = 0,
// com.google.android.chromeos.lowlatencystylus.InkOverlay
kInkOverlayLowLatencyLibInUse = 1,
// com.google.android.chromeos.lowlatencystylus.gpu.GLInkOverlay
kGLInkOverlayLowLatencyLibInUse = 2,
// com.google.android.chromeos.lowlatencystylus.gpu.GLInkRenderer
kGLInkOverlaySetProjectionMatrix = 3,
kGLInkOverlaySetViewMatrix = 4,
};
// Enumerates the API call from ChromeOS VPN service builder compat
// that provides functionality for Vpn exclude and add route
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused
[Extensible]
enum VpnServiceBuilderCompatApiId {
// If the library version doesn't support an API call, the API
// call will be recorded as UNSUPPORTED.
[Default] kUnsupported = 0,
// com.google.android.chromeos.vpn.VpnServiceBuilderCompat
kVpnExcludeRoute = 1,
// com.google.android.chromeos.vpn.VpnServiceBuilderCompat
kVpnAddRoute = 2,
};
// Status for migration of the main account hash code from v2 to v3.
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
[Extensible]
enum MainAccountHashMigrationStatus {
// Hash code migration not required.
kHashCodeMigrationNotRequired = 0,
// Hash code migration successful.
kHashCodeMigrationSuccessful = 1,
// Hash code migration failed.
kHashCodeMigrationFailed = 2,
// Hash code migration failed due to multiple acc hash matching.
kHashCodeMigrationFailedDueToMultipleAccounts = 3,
// Hash code migration failed due to multiple acc hash matching.
kHashCodeMigrationFailedDueToNoMatchingAccount = 4,
// NOTE: If you add any entries to this enum, you must also update the
// corresponding UMA ArcMainAccountHashMigrationStatus at
// tools/metrics/histograms/enums.xml.
};
// Enumerates the types of Wayland timing events where the message processing
// completed late and could cause UI jank in ARC apps. This enum is persisted to
// logs. Existing values should not be changed and new values should only be
// appended to the end.
[Extensible]
enum WaylandTimingEvent {
[Default] kOther = 0,
kBinderReleaseClipboardData = 1,
kWlBufferRelease = 2,
kWlKeyboardLeave = 3,
kWlPointerMotion = 4,
kWlPointerLeave = 5,
kZauraShellActivated = 6,
kZauraSurfaceOcclusionChanged = 7,
kZcrRemoteSurfaceWindowGeometryChanged = 8,
kZcrRemoteSurfaceBoundsChangedInOutput = 9,
kZcrVsyncTimingUpdate = 10,
};
// Enumerates the types of select ARC KeyMint error codes.
// This enum is persisted to logs. Existing values should not be changed and new
// values should only be appended to the end.
[Extensible]
enum ArcKeyMintError {
[Default] kOther = 0,
kOk = 1,
kUnknownError = 2,
kInvalidKeyBlob = 3,
kInvalidArgument = 4,
kUnsupportedAlgorithm = 5,
kUnimplemented = 6,
kUnexpectedNullPointer = 7,
};
// Enumerates the types of select ARC KeyMint operations.
// This enum is persisted to logs. Existing values should not be changed and new
// values should only be appended to the end.
[Extensible]
enum ArcKeyMintLoggedOperation {
[Default] kOther = 0,
kGenerateCertificateRequest = 1,
};
// Enumerates the types of Anr and Crash dialogs, based on the resource id the
// dialog uses.
[Extensible]
enum AppErrorDialogType {
[Default] kUnsupported = 0,
kAerrApplication = 1,
kAerrProcess = 2,
kAerrApplicationRepeated = 3,
kAerrProcessRepeated = 4,
kAnrActivityApplication = 5,
kAnrActivityProcess = 6,
kAnrApplicationProcess = 7,
kAnrProcess = 8,
};
// Maps to AndroidAppCategories in
// tools/metrics/histograms/metadata/arc/histograms.xml
[Extensible]
enum AndroidAppCategory {
[Default] kOther = 0,
kAudio = 1,
kGame = 2,
kImage = 3,
kProductivity = 4,
kSocial = 5,
kVideo = 6,
};
// Describes combined application data size for the specified app category.
struct AppCategoryDataSize {
AndroidAppCategory category;
uint32 data_size_in_mb;
};
// Maps to AndroidDataDirectories in
// tools/metrics/histograms/metadata/arc/histograms.xml
[Extensible]
enum AndroidDataDirectory {
[Default] kData = 0,
kDataApp = 1,
kDataData = 2,
kDataMedia = 3,
kDataMediaAndroid = 4,
kDataUserDE = 5,
};
// Describes size for the specified Android data directory.
struct DataDirectorySize {
AndroidDataDirectory directory;
uint32 size_in_mb;
};
// This interface is implemented in ash by ArcMetricsService. It is called by
// ARC side.
// Deprecated method IDs: 8, 14, 15, 18, 25, 26, 27, 28, 29
// Next method ID: 42
interface MetricsHost {
// Reports boot progress events from ARC instance.
ReportBootProgress@0(array<BootProgressEvent> events,
[MinVersion=1] BootType boot_type);
// Reports native bridge used by ARC instance.
[MinVersion=3] ReportNativeBridge@1(NativeBridgeType native_bridge_type);
// Reports api usage by ChromeOS Companion Library.
[MinVersion=4] ReportCompanionLibApiUsage@2(CompanionLibApiId api_id);
// Reports LMKD and OOM kills from ARC.
[MinVersion=6] ReportAppKill@3(AppKill app_kill);
// Reports migration event by ARC Metrics Service.
[MinVersion=7] ReportArcCorePriAbiMigEvent@4(ArcCorePriAbiMigEvent event);
// Reports number of failed ABI Migration attempts by ARC Metrics Service.
[MinVersion=7] ReportArcCorePriAbiMigFailedTries@5(uint32 failed_attempts);
// Reports ABI Migration system packages downgrade delay by ArcMetricsService.
[MinVersion=7] ReportArcCorePriAbiMigDowngradeDelay@6(mojo_base.mojom.TimeDelta delay);
// Reports boot time during ABI Migration by ARC Metrics Service.
[MinVersion=7] ReportArcCorePriAbiMigBootTime@7(mojo_base.mojom.TimeDelta duration);
// Reports ANR event.
[MinVersion=9] ReportAnr@10(Anr anr);
// Reports System Health upgrade processing time and if any packages were
// deleted during the upgrade.
[MinVersion=10] ReportArcSystemHealthUpgrade@11(
mojo_base.mojom.TimeDelta duration,
bool packages_deleted);
// Reports api usage of Low-latency Stylus Library.
[MinVersion=11] ReportLowLatencyStylusLibApiUsage@12
(LowLatencyStylusLibApiId api_id);
// Reports prediction target used in Low-latency Stylus Library.
[MinVersion=11] ReportLowLatencyStylusLibPredictionTarget@13(
LowLatencyStylusLibPredictionTarget prediction_target);
// Reports the result of DNS query inside ARC.
[MinVersion=13] ReportDnsQueryResult@16(
ArcDnsQuery query,
bool success);
// Reports main account hash migration status.
[MinVersion=14] ReportMainAccountHashMigrationMetrics@17(
MainAccountHashMigrationStatus status);
// Reports occurrence of one event in the ARC networking stack.
[MinVersion=16] ReportArcNetworkEvent@19(ArcNetworkEvent event);
// Reports occurrence of one error in the ARC networking stack.
[MinVersion=16] ReportArcNetworkError@20(ArcNetworkError error);
// Reports primary ABI of an app during app launch.
[MinVersion=18] ReportAppPrimaryAbi@21(AppPrimaryAbi abi);
// Reports data restore status and duration in milliseconds. This applies only
// for ARC++ P container.
[MinVersion=20] ReportDataRestore@22(DataRestoreStatus status,
int64 duration_ms);
// Reports raw memory pressure data, as the contents of /proc/pressure/memory.
// This is invoked solely by ARCVM.
[MinVersion=21] ReportMemoryPressure@23(array<uint8> psi_file_contents);
// Reports that ArcAppLauncher is about to start GMS sign-in / CloudDPC
// provisioning. This only happens during ARC provisioning.
[MinVersion=22] ReportProvisioningPreSignIn@24();
// Reports the duration of late timing events for Wayland.
[MinVersion=26] ReportWaylandLateTimingEvent@30(
WaylandTimingEvent event, mojo_base.mojom.TimeDelta duration);
// Reports first WebView started event to collect WebView usage in ARC.
[MinVersion=27] ReportWebViewProcessStarted@31();
// Reports api usage of vpn exclude route.
[MinVersion=29] ReportVpnServiceBuilderCompatApiUsage@32
(VpnServiceBuilderCompatApiId api_id);
// Reports count of newly opened QoS socket connections during a poll for all
// socket connections in ARC. Use int for uint value for the same reason as
// ReportQosSocketPercentage.
[MinVersion=30] ReportNewQosSocketCount@33(int32 count);
// Reports percentage of QoS socket connections during a poll for all socket
// connections in ARC. The reason for using int for uint percentage field is:
// Mojo uint values are byte cast when deserialized in Java, the practical
// and safe solution is to pick the next signed type that includes the whole
// unsigned range of possible values. Otherwise it forces writing error-prone
// conversion code at the entry or exit of mojo data.
// Range of perc arg will be [0, 100].
[MinVersion=30] ReportQosSocketPercentage@34(int32 perc);
// Reports select error codes on select KeyMint calls (on ARC T+ only).
[MinVersion=31] ReportArcKeyMintError@35(ArcKeyMintError error);
// Reports window drag resize latency.
[MinVersion=32] ReportDragResizeLatency@36(
array<mojo_base.mojom.TimeDelta> durations);
// Reports the dialog type when Android throws an app error dialog.
[MinVersion=33] ReportAppErrorDialogType@37(AppErrorDialogType type);
// Reports the result of apk cache lookup for an app install.
[MinVersion=34] ReportApkCacheHit@38(bool hit);
// Reports combined application data sizes for Android app categories.
// Maps to Arc.Data.AppCategory.{Target}.DataSize in
// tools/metrics/histograms/metadata/arc/histograms.xml
[MinVersion=35] ReportAppCategoryDataSizeList@39(
array<AppCategoryDataSize> list);
// Reports sizes for Android data directories.
// Maps to Arc.Data.Dir.{Target}.Size in
// tools/metrics/histograms/metadata/arc/histograms.xml
[MinVersion=35] ReportDataDirectorySizeList@40(array<DataDirectorySize> list);
// Reports error codes for select KeyMint calls (on ARC T+ only).
[MinVersion=36] ReportArcKeyMintErrorForOperation@41(
ArcKeyMintError error, ArcKeyMintLoggedOperation operation);
};
// Deprecated method IDs: 0
// Next method ID: 3
interface MetricsInstance {
// Establishes full-duplex communication with the host.
[MinVersion=2] Init@1(pending_remote<MetricsHost> host_remote) => ();
// Requests GFX metrics for the specified package. In case of error, null is
// returned.
[MinVersion=5] GetGfxMetrics@2(string packageName) => (GfxMetrics? metrics);
};