Merge "Extract ART-related atoms into atoms/art/*_atoms.proto"
diff --git a/stats/Android.bp b/stats/Android.bp
index 2a776b9..4459085 100644
--- a/stats/Android.bp
+++ b/stats/Android.bp
@@ -80,6 +80,7 @@
 atom_protos = [
     "atoms.proto",
     "attribution_node.proto",
+    "atoms/art/*.proto",
     "atoms/gps/*.proto",
     "atoms/placeholder/*.proto",
 ]
diff --git a/stats/atoms.proto b/stats/atoms.proto
index e53479c..fcd93b3 100644
--- a/stats/atoms.proto
+++ b/stats/atoms.proto
@@ -23,6 +23,9 @@
 option java_outer_classname = "AtomsProto";
 
 import "frameworks/proto_logging/stats/attribution_node.proto";
+import "frameworks/proto_logging/stats/atoms/art/art_atoms.proto";
+import "frameworks/proto_logging/stats/atoms/art/background_dexopt_atoms.proto";
+import "frameworks/proto_logging/stats/atoms/art/odrefresh_atoms.proto";
 import "frameworks/proto_logging/stats/atoms/gps/gps_atoms.proto";
 import "frameworks/proto_logging/stats/atom_field_options.proto";
 import "frameworks/proto_logging/stats/enums/app/enums.proto";
@@ -565,7 +568,7 @@
         PerfettoTrigger perfetto_trigger = 329 [(module) = "perfetto"];
         TranscodingData transcoding_data = 330 [(module) = "mediaprovider"];
         ImsServiceEntitlementUpdated ims_service_entitlement_updated = 331 [(module) = "imsentitlement"];
-        ArtDatumReported art_datum_reported = 332 [(module) = "art"];
+        art.ArtDatumReported art_datum_reported = 332 [(module) = "art"];
         DeviceRotated device_rotated = 333 [(module) = "framework"];
         SimSpecificSettingsRestored sim_specific_settings_restored = 334
             [(module) = "telephony"];
@@ -606,7 +609,7 @@
         FdtrackEventOccurred fdtrack_event_occurred = 364 [(module) = "framework"];
         TimeoutAutoExtendedReported timeout_auto_extended_reported = 365
             [(module) = "framework"];
-        OdrefreshReported odrefresh_reported = 366 [(module) = "art"];
+        art.OdrefreshReported odrefresh_reported = 366 [(module) = "art"];
         AlarmBatchDelivered alarm_batch_delivered = 367 [(module) = "framework"];
         AlarmScheduled alarm_scheduled = 368 [(module) = "framework"];
         CarWatchdogIoOveruseStatsReported car_watchdog_io_overuse_stats_reported = 369 [(module) = "car"];
@@ -727,7 +730,7 @@
         RemoteKeyProvisioningNetworkInfo remote_key_provisioning_network_info = 464 [(module) = "remoteprovisioner"];
         RemoteKeyProvisioningTiming remote_key_provisioning_timing = 465 [(module) = "remoteprovisioner"];
         MediaOutputOpInteractionReported mediaoutput_op_interaction_report = 466 [(module) = "sysui"];
-        BackgroundDexoptJobEnded background_dexopt_job_ended = 467 [(module) = "art"];
+        art.BackgroundDexoptJobEnded background_dexopt_job_ended = 467 [(module) = "art"];
         SyncExemptionOccurred sync_exemption_occurred = 468 [(module) = "framework"];
         AutofillPresentationEventReported autofill_presentation_event_reported = 469 [(module) = "framework"];
         DockStateChanged dock_state_changed = 470 [(module) = "framework"];
@@ -770,14 +773,14 @@
         BluetoothRemoteSupportedFeaturesReported bluetooth_remote_supported_features_reported = 531 [(module) = "bluetooth"];
         BluetoothLocalSupportedFeaturesReported bluetooth_local_supported_features_reported = 532 [(module) = "bluetooth"];
         BluetoothGattAppInfo bluetooth_gatt_app_info = 533 [(module) = "bluetooth"];
-        OdsignReported odsign_reported = 548 [(module) = "art"];
-        ArtDeviceDatumReported art_device_datum_reported = 550 [(module) = "art"];
+        art.OdsignReported odsign_reported = 548 [(module) = "art"];
+        art.ArtDeviceDatumReported art_device_datum_reported = 550 [(module) = "art"];
         NetworkSliceSessionEnded network_slice_session_ended = 558 [(module) = "connectivity"];
         NetworkSliceDailyDataUsageReported network_slice_daily_data_usage_reported = 559 [(module) = "connectivity"];
         NfcTagTypeOccurred nfc_tag_type_occurred = 560 [(module) = "nfc"];
         NfcAIDConflictOccurred nfc_aid_conflict_occurred = 561 [(module) = "nfc"];
         NfcReaderConflictOccurred nfc_reader_conflict_occurred = 562 [(module) = "nfc"];
-        ArtDatumDeltaReported art_datum_delta_reported = 565 [(module) = "art"];
+        art.ArtDatumDeltaReported art_datum_delta_reported = 565 [(module) = "art"];
         // StatsdStats tracks platform atoms with ids upto 750.
         // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
     }
@@ -18043,290 +18046,6 @@
     optional int64 duration_millis = 6;
 }
 
-// Indicates which compile filter was used for the package being loaded in an ART session.
-enum ArtCompileFilter {
-    ART_COMPILATION_FILTER_UNSPECIFIED = 0;
-    ART_COMPILATION_FILTER_ERROR = 1;
-    ART_COMPILATION_FILTER_UNKNOWN = 2;
-    ART_COMPILATION_FILTER_ASSUMED_VERIFIED = 3;
-    ART_COMPILATION_FILTER_EXTRACT = 4;
-    ART_COMPILATION_FILTER_VERIFY = 5;
-    ART_COMPILATION_FILTER_QUICKEN = 6;
-    ART_COMPILATION_FILTER_SPACE_PROFILE = 7;
-    ART_COMPILATION_FILTER_SPACE = 8;
-    ART_COMPILATION_FILTER_SPEED_PROFILE = 9;
-    ART_COMPILATION_FILTER_SPEED = 10;
-    ART_COMPILATION_FILTER_EVERYTHING_PROFILE = 11;
-    ART_COMPILATION_FILTER_EVERYTHING = 12;
-    ART_COMPILATION_FILTER_FAKE_RUN_FROM_APK = 13;
-    ART_COMPILATION_FILTER_FAKE_RUN_FROM_APK_FALLBACK = 14;
-    ART_COMPILATION_FILTER_FAKE_RUN_FROM_VDEX_FALLBACK = 15;
-}
-
-enum ArtCompilationReason {
-    ART_COMPILATION_REASON_UNSPECIFIED = 0;
-    ART_COMPILATION_REASON_ERROR = 1;
-    ART_COMPILATION_REASON_UNKNOWN = 2;
-    ART_COMPILATION_REASON_FIRST_BOOT = 3;
-    ART_COMPILATION_REASON_BOOT = 4;
-    ART_COMPILATION_REASON_INSTALL = 5;
-    ART_COMPILATION_REASON_BG_DEXOPT = 6;
-    ART_COMPILATION_REASON_AB_OTA = 7;
-    ART_COMPILATION_REASON_INACTIVE = 8;
-    ART_COMPILATION_REASON_SHARED = 9;
-    ART_COMPILATION_REASON_INSTALL_WITH_DEX_METADATA = 10;
-    ART_COMPILATION_REASON_POST_BOOT = 11;
-    ART_COMPILATION_REASON_INSTALL_FAST = 12;
-    ART_COMPILATION_REASON_INSTALL_BULK = 13;
-    ART_COMPILATION_REASON_INSTALL_BULK_SECONDARY = 14;
-    ART_COMPILATION_REASON_INSTALL_BULK_DOWNGRADED = 15;
-    ART_COMPILATION_REASON_INSTALL_BULK_SECONDARY_DOWNGRADED = 16;
-    ART_COMPILATION_REASON_BOOT_AFTER_OTA = 17;
-    ART_COMPILATION_REASON_PREBUILT = 18;
-    ART_COMPILATION_REASON_CMDLINE = 19;
-    ART_COMPILATION_REASON_VDEX = 20;
-}
-
-// Indicates which kind of measurement ART is reporting.
-//
-// Where it makes sense, the datum ID ends with the type of datum (counter or histogram) and the
-// units.
-// Note: Histograms are not yet reported by statsd.
-enum ArtDatumId {
-    ART_DATUM_INVALID = 0;
-    ART_DATUM_GC_WORLD_STOP_TIME_AVG_MICROS = 1;
-    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_TIME_HISTO_MILLIS = 2;
-    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_COUNT = 3;
-    ART_DATUM_GC_FULL_HEAP_COLLECTION_TIME_HISTO_MILLIS = 4;
-    ART_DATUM_GC_FULL_HEAP_COLLECTION_COUNT = 5;
-    ART_DATUM_JIT_METHOD_COMPILE_TIME_MICROS = 6;
-    ART_DATUM_AOT_COMPILE_TIME = 7;
-    ART_DATUM_CLASS_VERIFICATION_TIME_COUNTER_MICROS = 8;
-    ART_DATUM_CLASS_LOADING_TIME_COUNTER_MICROS = 9;
-
-    // Metrics IDs for dex2oat.
-    ART_DATUM_DEX2OAT_RESULT_CODE = 10;
-    ART_DATUM_DEX2OAT_DEX_CODE_COUNTER_BYTES = 11;
-    ART_DATUM_DEX2OAT_TOTAL_TIME_COUNTER_MILLIS = 12;
-    ART_DATUM_DEX2OAT_VERIFY_DEX_FILE_TIME_COUNTER_MILLIS = 13;
-    ART_DATUM_DEX2OAT_FAST_VERIFY_TIME_COUNTER_MILLIS = 14;
-    ART_DATUM_DEX2OAT_RESOLVE_METHODS_AND_FIELDS_TIME_COUNTER_MILLIS = 15;
-
-    ART_DATUM_CLASS_VERIFICATION_COUNT = 16;
-    ART_DATUM_GC_TOTAL_BYTES_ALLOCATED = 17;
-    ART_DATUM_GC_TOTAL_METADATA_SIZE_BYTES = 18 [deprecated=true];
-    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_THROUGHPUT_HISTO_MB_PER_SEC = 19;
-    ART_DATUM_GC_FULL_HEAP_COLLECTION_THROUGHPUT_HISTO_MB_PER_SEC = 20;
-    ART_DATUM_JIT_METHOD_COMPILE_COUNT = 21;
-    ART_DATUM_GC_YOUNG_GENERATION_TRACING_THROUGHPUT_HISTO_MB_PER_SEC = 22;
-    ART_DATUM_GC_FULL_HEAP_TRACING_THROUGHPUT_HISTO_MB_PER_SEC = 23;
-    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC = 24;
-    ART_DATUM_GC_FULL_HEAP_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC = 25;
-    ART_DATUM_GC_YOUNG_GENERATION_TRACING_THROUGHPUT_AVG_MB_PER_SEC = 26;
-    ART_DATUM_GC_FULL_HEAP_TRACING_THROUGHPUT_AVG_MB_PER_SEC = 27;
-    ART_DATUM_GC_TOTAL_COLLECTION_TIME_MS = 28;
-
-    // New metrics to support averages reported as sum (numerator) and count (denominator),
-    // in order to make it easier to be reported as Value Metrics.
-
-    // numerator from ART_DATUM_GC_WORLD_STOP_TIME_AVG_MICROS
-    ART_DATUM_GC_WORLD_STOP_TIME_US = 29;
-    // denominator from ART_DATUM_GC_WORLD_STOP_TIME_AVG_MICROS
-    ART_DATUM_GC_WORLD_STOP_COUNT = 30;
-    // numerator from ART_DATUM_GC_YOUNG_GENERATION_TRACING_THROUGHPUT_AVG_MB_PER_SEC
-    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_SCANNED_BYTES = 31;
-    // numerator from ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
-    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_FREED_BYTES = 32;
-    // denominator from ART_DATUM_GC_YOUNG_GENERATION_TRACING_THROUGHPUT_AVG_MB_PER_SEC
-    // and ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
-    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_DURATION_MS = 33;
-    // numerator from ART_DATUM_GC_FULL_HEAP_TRACING_THROUGHPUT_AVG_MB_PER_SEC
-    ART_DATUM_GC_FULL_HEAP_COLLECTION_SCANNED_BYTES = 34;
-    // numerator from ART_DATUM_GC_FULL_HEAP_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
-    ART_DATUM_GC_FULL_HEAP_COLLECTION_FREED_BYTES = 35;
-    // denominator from ART_DATUM_GC_FULL_HEAP_TRACING_THROUGHPUT_AVG_MB_PER_SEC
-    // and ART_DATUM_GC_FULL_HEAP_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
-    ART_DATUM_GC_FULL_HEAP_COLLECTION_DURATION_MS = 36;
-}
-
-// Indicates which kind of measurement ART is reporting as increments / deltas.
-// Next ID: 37
-enum ArtDatumDeltaId {
-    ART_DATUM_DELTA_INVALID = 0;
-
-    // These IDs are the equivalent of the ArtDatumId values,
-    // but for reporting increments / deltas.
-    ART_DATUM_DELTA_CLASS_VERIFICATION_COUNT = 16;
-    ART_DATUM_DELTA_CLASS_VERIFICATION_TIME_MICROS = 8;
-    ART_DATUM_DELTA_CLASS_LOADING_TIME_MICROS = 9;
-    ART_DATUM_DELTA_GC_FULL_HEAP_COLLECTION_COUNT = 5;
-    ART_DATUM_DELTA_GC_TOTAL_BYTES_ALLOCATED = 17;
-    ART_DATUM_DELTA_GC_TOTAL_COLLECTION_TIME_MS = 28;
-    ART_DATUM_DELTA_GC_YOUNG_GENERATION_COLLECTION_COUNT = 3;
-    ART_DATUM_DELTA_JIT_METHOD_COMPILE_COUNT = 21;
-    ART_DATUM_DELTA_JIT_METHOD_COMPILE_TIME_MICROS = 6;
-
-    // numerator from ART_DATUM_GC_WORLD_STOP_TIME_AVG_MICROS
-    ART_DATUM_DELTA_GC_WORLD_STOP_TIME_US = 29;
-    // denominator from ART_DATUM_GC_WORLD_STOP_TIME_AVG_MICROS
-    ART_DATUM_DELTA_GC_WORLD_STOP_COUNT = 30;
-    // numerator from ART_DATUM_GC_YOUNG_GENERATION_TRACING_THROUGHPUT_AVG_MB_PER_SEC
-    ART_DATUM_DELTA_GC_YOUNG_GENERATION_COLLECTION_SCANNED_BYTES = 31;
-    // numerator from ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
-    ART_DATUM_DELTA_GC_YOUNG_GENERATION_COLLECTION_FREED_BYTES = 32;
-    // denominator from ART_DATUM_GC_YOUNG_GENERATION_TRACING_THROUGHPUT_AVG_MB_PER_SEC
-    // and ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
-    ART_DATUM_DELTA_GC_YOUNG_GENERATION_COLLECTION_DURATION_MS = 33;
-    // numerator from ART_DATUM_GC_FULL_HEAP_TRACING_THROUGHPUT_AVG_MB_PER_SEC
-    ART_DATUM_DELTA_GC_FULL_HEAP_COLLECTION_SCANNED_BYTES = 34;
-    // numerator from ART_DATUM_GC_FULL_HEAP_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
-    ART_DATUM_DELTA_GC_FULL_HEAP_COLLECTION_FREED_BYTES = 35;
-    // denominator from ART_DATUM_GC_FULL_HEAP_TRACING_THROUGHPUT_AVG_MB_PER_SEC
-    // and ART_DATUM_GC_FULL_HEAP_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
-    ART_DATUM_DELTA_GC_FULL_HEAP_COLLECTION_DURATION_MS = 36;
-
-    reserved 1, 2, 4, 7, 10, 11, 12, 13, 14, 15, 18, 19, 20, 22, 23, 24, 25, 26, 27;
-}
-
-// Indicates what class of thread the reported values apply to.
-enum ArtThreadType {
-    ART_THREAD_UNKNOWN = 0;
-    ART_THREAD_MAIN = 1;
-    ART_THREAD_BACKGROUND = 2;
-}
-
-// Indicates the type of dex metadata.
-enum ArtDexMetadataType {
-  ART_DEX_METADATA_TYPE_UNKNOWN = 0;
-  ART_DEX_METADATA_TYPE_PROFILE = 1;
-  ART_DEX_METADATA_TYPE_VDEX = 2;
-  ART_DEX_METADATA_TYPE_PROFILE_AND_VDEX = 3;
-  ART_DEX_METADATA_TYPE_NONE = 4;
-  ART_DEX_METADATA_TYPE_ERROR = 5;
-}
-
-// Indicates the type of the apk.
-enum ArtApkType {
-    ART_APK_TYPE_UNKNOWN = 0;
-    ART_APK_TYPE_BASE = 1;
-    ART_APK_TYPE_SPLIT = 2;
-}
-
-// Indicates the ISA.
-enum ArtIsa {
-    ART_ISA_UNKNOWN = 0;
-    ART_ISA_ARM = 1;
-    ART_ISA_ARM64 = 2;
-    ART_ISA_X86 = 3;
-    ART_ISA_X86_64 = 4;
-    ART_ISA_MIPS = 5;
-    ART_ISA_MIPS64 = 6;
-    ART_ISA_RISCV64 = 7;
-}
-
-// Indicates the GC collector type.
-enum ArtGcCollectorType {
-    ART_GC_COLLECTOR_TYPE_UNKNOWN = 0;
-    ART_GC_COLLECTOR_TYPE_MARK_SWEEP = 1;
-    ART_GC_COLLECTOR_TYPE_CONCURRENT_MARK_SWEEP = 2;
-    ART_GC_COLLECTOR_TYPE_CONCURRENT_MARK_COMPACT = 3;
-    ART_GC_COLLECTOR_TYPE_SEMI_SPACE = 4;
-    ART_GC_COLLECTOR_TYPE_CONCURRENT_COPYING = 5;
-    ART_GC_COLLECTOR_TYPE_CONCURRENT_COPYING_BACKGROUND = 6;
-}
-
-// Indicates support for userfaultfd and minor fault mode.
-enum ArtUffdSupport {
-    ART_UFFD_SUPPORT_UNKNOWN = 0;
-    ART_UFFD_SUPPORT_UFFD_NOT_SUPPORTED = 1;
-    ART_UFFD_SUPPORT_MINOR_FAULT_MODE_NOT_SUPPORTED = 2;
-    ART_UFFD_SUPPORT_MINOR_FAULT_MODE_SUPPORTED = 3;
-}
-
-message ArtDatumReported {
-    // The session ID is used to correlate this report with others from the same ART instance.
-    optional int64 session_id = 1;
-
-    // The UID of the app that ART is running on behalf of.
-    optional int32 uid = 2 [(is_uid) = true];
-
-    // What compiler filter the APK or DEX file was compiled with.
-    optional ArtCompileFilter compile_filter = 3;
-
-    // Why the package was compiled the way it was.
-    optional ArtCompilationReason compilation_reason = 4;
-
-    // The number of milliseconds since the ART runtime instance was started.
-    optional int64 timestamp_millis = 5;
-
-    // What kind of thread (UI or background) this metric corresponds to.
-    optional ArtThreadType thread_type = 6;
-
-    // Which counter this is that is being reported.
-    optional ArtDatumId kind = 7;
-
-    // The value of the counter.
-    optional int64 value = 8;
-
-    // The type of dex metadata
-    optional ArtDexMetadataType dex_metadata_type = 9;
-
-    // The type of the APK file.
-    optional ArtApkType apk_type = 10;
-
-    // The ISA of the device.
-    optional ArtIsa isa = 11;
-
-    // The Garbage Collector used in the Android Runtime.
-    optional ArtGcCollectorType gc = 12;
-
-    // The support for userfaultfd and minor fault mode.
-    optional ArtUffdSupport uffd_support = 13;
-}
-
-// ArtDatumDeltaReported is the same as ArtDatumReported, except for the kind field
-// (ArtDatumDeltaId here, ArtDatumId for ArtDatumReported)
-message ArtDatumDeltaReported {
-    // The session ID is used to correlate this report with others from the same ART instance.
-    optional int64 session_id = 1;
-
-    // The UID of the app that ART is running on behalf of.
-    optional int32 uid = 2 [(is_uid) = true];
-
-    // What compiler filter the APK or DEX file was compiled with.
-    optional ArtCompileFilter compile_filter = 3;
-
-    // Why the package was compiled the way it was.
-    optional ArtCompilationReason compilation_reason = 4;
-
-    // The number of milliseconds since the ART runtime instance was started.
-    optional int64 timestamp_millis = 5;
-
-    // What kind of thread (UI or background) this metric corresponds to.
-    optional ArtThreadType thread_type = 6;
-
-    // Which counter this is that is being reported.
-    optional ArtDatumDeltaId kind = 7;
-
-    // The value of the counter.
-    optional int64 value = 8;
-
-    // The type of dex metadata
-    optional ArtDexMetadataType dex_metadata_type = 9;
-
-    // The type of the APK file.
-    optional ArtApkType apk_type = 10;
-
-    // The ISA of the device.
-    optional ArtIsa isa = 11;
-
-    // The Garbage Collector used in the Android Runtime.
-    optional ArtGcCollectorType gc = 12;
-
-    // The support for userfaultfd and minor fault mode.
-    optional ArtUffdSupport uffd_support = 13;
-}
-
 /**
  * Logged when a SIM-specific settings restore was attempted.
  *
@@ -19167,169 +18886,6 @@
 }
 
 /*
- * Logs information about on-device refresh of ART AOT artifacts for boot classpath extensions
- * and system_server.
- *
- * Logged from:
- *   art/odrefresh/odrefresh.cc
- */
-message OdrefreshReported {
-    optional int64 art_apex_version = 1;
-
-    enum Trigger {
-        // A placeholder for unknown values.
-        TRIGGER_UNKNOWN = 0;
-
-        // ART APEX version has changed since time artifacts were generated.
-        TRIGGER_APEX_VERSION_MISMATCH = 1;
-
-        // Dex files on the boot classpath or system_server classpath have changed.
-        TRIGGER_DEX_FILES_CHANGED = 2;
-
-        // Missing artifacts.
-        TRIGGER_MISSING_ARTIFACTS = 3;
-    }
-
-    optional Trigger trigger = 2;
-
-    enum Stage {
-        // A placeholder for unknown values.
-        STAGE_UNKNOWN = 0;
-
-        // Checking stage.
-        STAGE_CHECK = 10;
-
-        // Preparation for compilation.
-        STAGE_PREPARATION = 20;
-
-        // Compilation of the boot classpath for the primary architecture
-        // ("primary boot classpath").
-        STAGE_PRIMARY_BOOT_CLASSPATH = 30;
-
-        // Compilation of the boot classpath for the secondary architecture
-        // ("secondary boot classpath"), if any.
-        STAGE_SECONDARY_BOOT_CLASSPATH = 40;
-
-        // Compilation of system_server classpath.
-        STAGE_SYSTEM_SERVER_CLASSPATH = 50;
-
-        // All stages completed.
-        STAGE_COMPLETE = 60;
-    }
-
-    optional Stage stage_reached = 3;
-
-    enum Status {
-        // A placeholder for unknown values.
-        STATUS_UNKNOWN = 0;
-
-        // OK, no problems encountered.
-        STATUS_OK = 1;
-
-        // Insufficient space.
-        STATUS_NO_SPACE = 2;
-
-        // Storage operation failed.
-        STATUS_IO_ERROR = 3;
-
-        // Dex2oat reported an error.
-        STATUS_DEX2OAT_ERROR = 4;
-
-        reserved 5; // was STATUS_TIME_LIMIT_EXCEEDED
-
-        // Failure creating staging area.
-        STATUS_STAGING_FAILED = 6;
-
-        // Installation of artifacts failed.
-        STATUS_INSTALL_FAILED = 7;
-
-        // Failed to access the dalvik-cache directory due to lack of
-        // permission.
-        STATUS_DALVIK_CACHE_PERMISSION_DENIED = 8;
-    }
-
-    optional Status status = 4;
-
-    // Compilation time of the boot classpath for the primary architecture
-    // ("primary boot classpath"), in seconds.
-    optional int32 primary_bcp_compilation_seconds = 5;
-
-    // Compilation time of the boot classpath for the secondary architecture
-    // ("secondary boot classpath"), if any, in seconds.
-    optional int32 secondary_bcp_compilation_seconds = 6;
-
-    // Compilation time of system_server classpath, in seconds.
-    optional int32 system_server_compilation_seconds = 7;
-
-    // Cache space at start of update.
-    optional int32 cache_space_free_start_mib = 8;
-
-    // Cache space at end of update.
-    optional int32 cache_space_free_end_mib = 9;
-
-    // Compilation time of the boot classpath for the primary architecture
-    // ("primary boot classpath"), in milliseconds.
-    optional int32 primary_bcp_compilation_millis = 10;
-
-    // Compilation time of the boot classpath for the secondary architecture
-    // ("secondary boot classpath"), if any, in milliseconds.
-    optional int32 secondary_bcp_compilation_millis = 11;
-
-    // Compilation time of system_server classpath, in milliseconds.
-    optional int32 system_server_compilation_millis = 12;
-
-    enum ExecResultStatus {
-        // Unable to get the status.
-        EXEC_RESULT_STATUS_UNKNOWN = 0;
-        // Process exited normally with an exit code.
-        EXEC_RESULT_STATUS_EXITED = 1;
-        // Process terminated by a signal.
-        EXEC_RESULT_STATUS_SIGNALED = 2;
-        // Process timed out and killed.
-        EXEC_RESULT_STATUS_TIMED_OUT = 3;
-        // Failed to start the process.
-        EXEC_RESULT_STATUS_START_FAILED = 4;
-        // Process was not run.
-        EXEC_RESULT_STATUS_NOT_RUN = 5;
-    }
-
-    // Status for the compilation of the boot
-    // classpath for the primary architecture.
-    optional ExecResultStatus primary_bcp_dex2oat_result_status = 13;
-
-    // Exit code for the compilation of the boot classpath for the
-    // primary architecture if status is EXEC_RESULT_STATUS_EXITED, else -1.
-    optional int32 primary_bcp_dex2oat_result_exit_code = 14;
-
-    // Signal for the compilation of the boot classpath for the
-    // primary architecture if status is EXEC_RESULT_STATUS_SIGNALED, else 0.
-    optional int32 primary_bcp_dex2oat_result_signal = 15;
-
-    // Status for the compilation of the boot
-    // classpath for the secondary architecture.
-    optional ExecResultStatus secondary_bcp_dex2oat_result_status = 16;
-
-    // Exit code for the compilation of the boot classpath for the
-    // secondary architecture if status is EXEC_RESULT_STATUS_EXITED, else -1.
-    optional int32 secondary_bcp_dex2oat_result_exit_code = 17;
-
-    // Signal for the compilation of the boot classpath for the
-    // secondary architecture if status is EXEC_RESULT_STATUS_SIGNALED, else 0.
-    optional int32 secondary_bcp_dex2oat_result_signal = 18;
-
-    // Status for the compilation of the boot classpath for the system_server.
-    optional ExecResultStatus system_server_dex2oat_result_status = 19;
-
-    // Exit code for the compilation of the boot classpath for the
-    // system_server if status is EXEC_RESULT_STATUS_EXITED, else -1.
-    optional int32 system_server_dex2oat_result_exit_code = 20;
-
-    // Signal for the compilation of the boot classpath for the
-    // system_server if status is EXEC_RESULT_STATUS_SIGNALED, else 0.
-    optional int32 system_server_dex2oat_result_signal = 21;
-};
-
-/*
  * Logged when a package's user-level hibernation state changes.
  * Logged from:
  *   frameworks/base/services/core/java/com/android/server/apphibernation/AppHibernationService.java
@@ -21980,81 +21536,6 @@
 }
 
 /**
- * Logs when a background dexopt job is ended.
- *
- * Logged from:
- *   frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
- */
-message BackgroundDexoptJobEnded {
-    // Corresponds to `BackgroundDexOptService.Status`, except for
-    // `STATUS_JOB_FINISHED`.
-    enum Status {
-        STATUS_UNKNOWN = 0;
-
-        // The job has finished. This value is used even if some packages have
-        // failed compilation during the job. (Corresponds to either
-        // `BackgroundDexOptService.Status.STATUS_OK` or
-        // `BackgroundDexOptService.Status.STATUS_DEX_OPT_FAILED`.)
-        STATUS_JOB_FINISHED = 1;
-
-        // The job is aborted by the job scheduler. The reason is logged in
-        // `cancellation_reason`.
-        STATUS_ABORT_BY_CANCELLATION = 2;
-
-        // The job is aborted by itself because there is no space left. Note
-        // that this does NOT include cases where the job is aborted by the job
-        // scheduler due to no space left, which are logged as
-        // `STATUS_ABORT_BY_CANCELLATION` with `cancellation_reason` being
-        // `STOP_REASON_CONSTRAINT_STORAGE_NOT_LOW`.
-        STATUS_ABORT_NO_SPACE_LEFT = 3;
-
-        // The job is aborted by itself because of thermal issues. Note that
-        // this does NOT include cases where the job is aborted by the job
-        // scheduler due to thermal issues, which are logged as
-        // `STATUS_ABORT_BY_CANCELLATION` with `cancellation_reason` being
-        // `STOP_REASON_DEVICE_STATE`.
-        //
-        // Only applies to the legacy dexopt job.
-        STATUS_ABORT_THERMAL = 4;
-
-        // The job is aborted by itself because of unsatisfied battery level.
-        // Note that this does NOT include cases where the job is aborted by the
-        // job scheduler due to unsatisfied battery level, which are logged as
-        // `STATUS_ABORT_BY_CANCELLATION` with `cancellation_reason` being
-        // `STOP_REASON_CONSTRAINT_BATTERY_NOT_LOW`.
-        //
-        // Only applies to the legacy dexopt job.
-        STATUS_ABORT_BATTERY = 5;
-
-        // The job is aborted by the API
-        // `ArtManagerLocal.cancelBackgroundDexoptJob`.
-        //
-        // Only applies to the background dexopt job in ART Service.
-        STATUS_ABORT_BY_API = 6;
-
-        // The job encountered a fatal error, such as a runtime exception. Note
-        // that this does NOT include cases where the job finishes normally with
-        // some dexopt failures on some apps, which are expected and logged as
-        // `STATUS_JOB_FINISHED`.
-        STATUS_FATAL_ERROR = 7;
-    }
-
-    optional Status status = 1;
-
-    // If `status` is `STATUS_ABORT_BY_CANCELLATION`, the reason of the
-    // cancellation.
-    optional android.app.job.StopReasonEnum cancellation_reason = 2;
-
-    // The duration of the job run, in milliseconds.
-    optional int64 duration_ms = 3;
-
-    // The duration of the job run, in milliseconds, including time spent in
-    // sleep. Deprecated as the job scheduler holds a wake lock, hence this
-    // duration is always going to be the same as above.
-    optional int64 duration_including_sleep_ms = 4 [deprecated = true];
-}
-
-/**
  * Pulls information for a single incoming MMS.
  *
  * Each pull creates multiple atoms, one for each MMS.
@@ -22541,38 +22022,6 @@
 }
 
 /**
- * Logs odsign metrics.
- *
- * Logged from:
- *   frameworks/base/services/core/java/com/android/server/pm/dex/OdsignStatsLogger.java
- */
-message OdsignReported {
-    enum Status {
-        // Unknown value.
-        STATUS_UNSPECIFIED = 0;
-        // All artifacts are generated and signed.
-        STATUS_ALL_OK = 1;
-        // Some artifacts are generated and signed, but odrefresh failed to generate the rest. See
-        // odrefresh metrics for the odrefresh failure.
-        STATUS_PARTIAL_OK = 2;
-        // Odrefresh failed to generate any artifact. See odrefresh metrics for the odrefresh
-        // failure.
-        STATUS_ODREFRESH_FAILED = 3;
-        // Odsign failed when interacting with Keystore.
-        STATUS_KEYSTORE_FAILED = 4;
-        // Odsign failed when initializing certificate.
-        STATUS_CERT_FAILED = 5;
-        // Odsign failed when cleaning up existing artifacts. Note that odrefresh may also clean up
-        // existing artifacts, and failures about that are logged as `STATUS_ODREFRESH_FAILED`.
-        STATUS_CLEANUP_FAILED = 6;
-        // Odsign failed when signing artifacts.
-        STATUS_SIGNING_FAILED = 7;
-    }
-
-    optional Status status = 1;
-}
-
-/**
  * Logs when Iwlan responds the setup data call request.
  *
  * Logged from:
@@ -22656,25 +22105,3 @@
   // Wifi signal level
   optional int32 wifi_signal_level = 4;
 }
-
-/**
- * Logs ART metrics that are device-specific (as opposed to app-specific ones logged by
- * ArtDatumReported).
- *
- * Logged from:
- *   art/runtime/metrics/statsd.cc
- */
-message ArtDeviceDatumReported {
-    enum BootImageStatus {
-        // Unknown value.
-        STATUS_UNSPECIFIED = 0;
-        // Boot image(s) are fully usable.
-        STATUS_FULL = 1;
-        // Only the minimal boot image is usable.
-        STATUS_MINIMAL = 2;
-        // No boot image is usable.
-        STATUS_NONE = 3;
-    }
-
-    optional BootImageStatus boot_image_status = 1;
-}
diff --git a/stats/atoms/art/art_atoms.proto b/stats/atoms/art/art_atoms.proto
new file mode 100644
index 0000000..ba9d9c8
--- /dev/null
+++ b/stats/atoms/art/art_atoms.proto
@@ -0,0 +1,314 @@
+syntax = "proto2";
+
+package android.os.statsd.art;
+
+import "frameworks/proto_logging/stats/atom_field_options.proto";
+
+option java_package = "com.android.os.art";
+
+// Indicates which compile filter was used for the package being loaded in an ART session.
+enum ArtCompileFilter {
+    ART_COMPILATION_FILTER_UNSPECIFIED = 0;
+    ART_COMPILATION_FILTER_ERROR = 1;
+    ART_COMPILATION_FILTER_UNKNOWN = 2;
+    ART_COMPILATION_FILTER_ASSUMED_VERIFIED = 3;
+    ART_COMPILATION_FILTER_EXTRACT = 4;
+    ART_COMPILATION_FILTER_VERIFY = 5;
+    ART_COMPILATION_FILTER_QUICKEN = 6;
+    ART_COMPILATION_FILTER_SPACE_PROFILE = 7;
+    ART_COMPILATION_FILTER_SPACE = 8;
+    ART_COMPILATION_FILTER_SPEED_PROFILE = 9;
+    ART_COMPILATION_FILTER_SPEED = 10;
+    ART_COMPILATION_FILTER_EVERYTHING_PROFILE = 11;
+    ART_COMPILATION_FILTER_EVERYTHING = 12;
+    ART_COMPILATION_FILTER_FAKE_RUN_FROM_APK = 13;
+    ART_COMPILATION_FILTER_FAKE_RUN_FROM_APK_FALLBACK = 14;
+    ART_COMPILATION_FILTER_FAKE_RUN_FROM_VDEX_FALLBACK = 15;
+}
+
+// Indicates what triggered the compilation of the package.
+enum ArtCompilationReason {
+    ART_COMPILATION_REASON_UNSPECIFIED = 0;
+    ART_COMPILATION_REASON_ERROR = 1;
+    ART_COMPILATION_REASON_UNKNOWN = 2;
+    ART_COMPILATION_REASON_FIRST_BOOT = 3;
+    ART_COMPILATION_REASON_BOOT = 4;
+    ART_COMPILATION_REASON_INSTALL = 5;
+    ART_COMPILATION_REASON_BG_DEXOPT = 6;
+    ART_COMPILATION_REASON_AB_OTA = 7;
+    ART_COMPILATION_REASON_INACTIVE = 8;
+    ART_COMPILATION_REASON_SHARED = 9;
+    ART_COMPILATION_REASON_INSTALL_WITH_DEX_METADATA = 10;
+    ART_COMPILATION_REASON_POST_BOOT = 11;
+    ART_COMPILATION_REASON_INSTALL_FAST = 12;
+    ART_COMPILATION_REASON_INSTALL_BULK = 13;
+    ART_COMPILATION_REASON_INSTALL_BULK_SECONDARY = 14;
+    ART_COMPILATION_REASON_INSTALL_BULK_DOWNGRADED = 15;
+    ART_COMPILATION_REASON_INSTALL_BULK_SECONDARY_DOWNGRADED = 16;
+    ART_COMPILATION_REASON_BOOT_AFTER_OTA = 17;
+    ART_COMPILATION_REASON_PREBUILT = 18;
+    ART_COMPILATION_REASON_CMDLINE = 19;
+    ART_COMPILATION_REASON_VDEX = 20;
+}
+
+// Indicates which kind of measurement ART is reporting.
+//
+// Where it makes sense, the datum ID ends with the type of datum (counter or histogram) and the
+// units.
+// Note: Histograms are not yet reported by statsd.
+enum ArtDatumId {
+    ART_DATUM_INVALID = 0;
+    ART_DATUM_GC_WORLD_STOP_TIME_AVG_MICROS = 1;
+    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_TIME_HISTO_MILLIS = 2;
+    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_COUNT = 3;
+    ART_DATUM_GC_FULL_HEAP_COLLECTION_TIME_HISTO_MILLIS = 4;
+    ART_DATUM_GC_FULL_HEAP_COLLECTION_COUNT = 5;
+    ART_DATUM_JIT_METHOD_COMPILE_TIME_MICROS = 6;
+    ART_DATUM_AOT_COMPILE_TIME = 7;
+    ART_DATUM_CLASS_VERIFICATION_TIME_COUNTER_MICROS = 8;
+    ART_DATUM_CLASS_LOADING_TIME_COUNTER_MICROS = 9;
+
+    // Metrics IDs for dex2oat.
+    ART_DATUM_DEX2OAT_RESULT_CODE = 10;
+    ART_DATUM_DEX2OAT_DEX_CODE_COUNTER_BYTES = 11;
+    ART_DATUM_DEX2OAT_TOTAL_TIME_COUNTER_MILLIS = 12;
+    ART_DATUM_DEX2OAT_VERIFY_DEX_FILE_TIME_COUNTER_MILLIS = 13;
+    ART_DATUM_DEX2OAT_FAST_VERIFY_TIME_COUNTER_MILLIS = 14;
+    ART_DATUM_DEX2OAT_RESOLVE_METHODS_AND_FIELDS_TIME_COUNTER_MILLIS = 15;
+
+    ART_DATUM_CLASS_VERIFICATION_COUNT = 16;
+    ART_DATUM_GC_TOTAL_BYTES_ALLOCATED = 17;
+    ART_DATUM_GC_TOTAL_METADATA_SIZE_BYTES = 18 [deprecated=true];
+    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_THROUGHPUT_HISTO_MB_PER_SEC = 19;
+    ART_DATUM_GC_FULL_HEAP_COLLECTION_THROUGHPUT_HISTO_MB_PER_SEC = 20;
+    ART_DATUM_JIT_METHOD_COMPILE_COUNT = 21;
+    ART_DATUM_GC_YOUNG_GENERATION_TRACING_THROUGHPUT_HISTO_MB_PER_SEC = 22;
+    ART_DATUM_GC_FULL_HEAP_TRACING_THROUGHPUT_HISTO_MB_PER_SEC = 23;
+    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC = 24;
+    ART_DATUM_GC_FULL_HEAP_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC = 25;
+    ART_DATUM_GC_YOUNG_GENERATION_TRACING_THROUGHPUT_AVG_MB_PER_SEC = 26;
+    ART_DATUM_GC_FULL_HEAP_TRACING_THROUGHPUT_AVG_MB_PER_SEC = 27;
+    ART_DATUM_GC_TOTAL_COLLECTION_TIME_MS = 28;
+
+    // New metrics to support averages reported as sum (numerator) and count (denominator),
+    // in order to make it easier to be reported as Value Metrics.
+
+    // numerator from ART_DATUM_GC_WORLD_STOP_TIME_AVG_MICROS
+    ART_DATUM_GC_WORLD_STOP_TIME_US = 29;
+    // denominator from ART_DATUM_GC_WORLD_STOP_TIME_AVG_MICROS
+    ART_DATUM_GC_WORLD_STOP_COUNT = 30;
+    // numerator from ART_DATUM_GC_YOUNG_GENERATION_TRACING_THROUGHPUT_AVG_MB_PER_SEC
+    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_SCANNED_BYTES = 31;
+    // numerator from ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
+    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_FREED_BYTES = 32;
+    // denominator from ART_DATUM_GC_YOUNG_GENERATION_TRACING_THROUGHPUT_AVG_MB_PER_SEC
+    // and ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
+    ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_DURATION_MS = 33;
+    // numerator from ART_DATUM_GC_FULL_HEAP_TRACING_THROUGHPUT_AVG_MB_PER_SEC
+    ART_DATUM_GC_FULL_HEAP_COLLECTION_SCANNED_BYTES = 34;
+    // numerator from ART_DATUM_GC_FULL_HEAP_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
+    ART_DATUM_GC_FULL_HEAP_COLLECTION_FREED_BYTES = 35;
+    // denominator from ART_DATUM_GC_FULL_HEAP_TRACING_THROUGHPUT_AVG_MB_PER_SEC
+    // and ART_DATUM_GC_FULL_HEAP_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
+    ART_DATUM_GC_FULL_HEAP_COLLECTION_DURATION_MS = 36;
+}
+
+// Indicates which kind of measurement ART is reporting as increments / deltas.
+// Next ID: 37
+enum ArtDatumDeltaId {
+    ART_DATUM_DELTA_INVALID = 0;
+
+    // These IDs are the equivalent of the ArtDatumId values,
+    // but for reporting increments / deltas.
+    ART_DATUM_DELTA_CLASS_VERIFICATION_COUNT = 16;
+    ART_DATUM_DELTA_CLASS_VERIFICATION_TIME_MICROS = 8;
+    ART_DATUM_DELTA_CLASS_LOADING_TIME_MICROS = 9;
+    ART_DATUM_DELTA_GC_FULL_HEAP_COLLECTION_COUNT = 5;
+    ART_DATUM_DELTA_GC_TOTAL_BYTES_ALLOCATED = 17;
+    ART_DATUM_DELTA_GC_TOTAL_COLLECTION_TIME_MS = 28;
+    ART_DATUM_DELTA_GC_YOUNG_GENERATION_COLLECTION_COUNT = 3;
+    ART_DATUM_DELTA_JIT_METHOD_COMPILE_COUNT = 21;
+    ART_DATUM_DELTA_JIT_METHOD_COMPILE_TIME_MICROS = 6;
+
+    // numerator from ART_DATUM_GC_WORLD_STOP_TIME_AVG_MICROS
+    ART_DATUM_DELTA_GC_WORLD_STOP_TIME_US = 29;
+    // denominator from ART_DATUM_GC_WORLD_STOP_TIME_AVG_MICROS
+    ART_DATUM_DELTA_GC_WORLD_STOP_COUNT = 30;
+    // numerator from ART_DATUM_GC_YOUNG_GENERATION_TRACING_THROUGHPUT_AVG_MB_PER_SEC
+    ART_DATUM_DELTA_GC_YOUNG_GENERATION_COLLECTION_SCANNED_BYTES = 31;
+    // numerator from ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
+    ART_DATUM_DELTA_GC_YOUNG_GENERATION_COLLECTION_FREED_BYTES = 32;
+    // denominator from ART_DATUM_GC_YOUNG_GENERATION_TRACING_THROUGHPUT_AVG_MB_PER_SEC
+    // and ART_DATUM_GC_YOUNG_GENERATION_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
+    ART_DATUM_DELTA_GC_YOUNG_GENERATION_COLLECTION_DURATION_MS = 33;
+    // numerator from ART_DATUM_GC_FULL_HEAP_TRACING_THROUGHPUT_AVG_MB_PER_SEC
+    ART_DATUM_DELTA_GC_FULL_HEAP_COLLECTION_SCANNED_BYTES = 34;
+    // numerator from ART_DATUM_GC_FULL_HEAP_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
+    ART_DATUM_DELTA_GC_FULL_HEAP_COLLECTION_FREED_BYTES = 35;
+    // denominator from ART_DATUM_GC_FULL_HEAP_TRACING_THROUGHPUT_AVG_MB_PER_SEC
+    // and ART_DATUM_GC_FULL_HEAP_COLLECTION_THROUGHPUT_AVG_MB_PER_SEC
+    ART_DATUM_DELTA_GC_FULL_HEAP_COLLECTION_DURATION_MS = 36;
+
+    reserved 1, 2, 4, 7, 10, 11, 12, 13, 14, 15, 18, 19, 20, 22, 23, 24, 25, 26, 27;
+}
+
+// Indicates what class of thread the reported values apply to.
+enum ArtThreadType {
+    ART_THREAD_UNKNOWN = 0;
+    ART_THREAD_MAIN = 1;
+    ART_THREAD_BACKGROUND = 2;
+}
+
+// Indicates the type of dex metadata.
+enum ArtDexMetadataType {
+  ART_DEX_METADATA_TYPE_UNKNOWN = 0;
+  ART_DEX_METADATA_TYPE_PROFILE = 1;
+  ART_DEX_METADATA_TYPE_VDEX = 2;
+  ART_DEX_METADATA_TYPE_PROFILE_AND_VDEX = 3;
+  ART_DEX_METADATA_TYPE_NONE = 4;
+  ART_DEX_METADATA_TYPE_ERROR = 5;
+}
+
+// Indicates the type of the apk.
+enum ArtApkType {
+    ART_APK_TYPE_UNKNOWN = 0;
+    ART_APK_TYPE_BASE = 1;
+    ART_APK_TYPE_SPLIT = 2;
+}
+
+// Indicates the ISA.
+enum ArtIsa {
+    ART_ISA_UNKNOWN = 0;
+    ART_ISA_ARM = 1;
+    ART_ISA_ARM64 = 2;
+    ART_ISA_X86 = 3;
+    ART_ISA_X86_64 = 4;
+    ART_ISA_MIPS = 5;
+    ART_ISA_MIPS64 = 6;
+    ART_ISA_RISCV64 = 7;
+}
+
+// Indicates the GC collector type.
+enum ArtGcCollectorType {
+    ART_GC_COLLECTOR_TYPE_UNKNOWN = 0;
+    ART_GC_COLLECTOR_TYPE_MARK_SWEEP = 1;
+    ART_GC_COLLECTOR_TYPE_CONCURRENT_MARK_SWEEP = 2;
+    ART_GC_COLLECTOR_TYPE_CONCURRENT_MARK_COMPACT = 3;
+    ART_GC_COLLECTOR_TYPE_SEMI_SPACE = 4;
+    ART_GC_COLLECTOR_TYPE_CONCURRENT_COPYING = 5;
+    ART_GC_COLLECTOR_TYPE_CONCURRENT_COPYING_BACKGROUND = 6;
+}
+
+// Indicates support for userfaultfd and minor fault mode.
+enum ArtUffdSupport {
+    ART_UFFD_SUPPORT_UNKNOWN = 0;
+    ART_UFFD_SUPPORT_UFFD_NOT_SUPPORTED = 1;
+    ART_UFFD_SUPPORT_MINOR_FAULT_MODE_NOT_SUPPORTED = 2;
+    ART_UFFD_SUPPORT_MINOR_FAULT_MODE_SUPPORTED = 3;
+}
+
+message ArtDatumReported {
+    // The session ID is used to correlate this report with others from the same ART instance.
+    optional int64 session_id = 1;
+
+    // The UID of the app that ART is running on behalf of.
+    optional int32 uid = 2 [(is_uid) = true];
+
+    // What compiler filter the APK or DEX file was compiled with.
+    optional ArtCompileFilter compile_filter = 3;
+
+    // Why the package was compiled the way it was.
+    optional ArtCompilationReason compilation_reason = 4;
+
+    // The number of milliseconds since the ART runtime instance was started.
+    optional int64 timestamp_millis = 5;
+
+    // What kind of thread (UI or background) this metric corresponds to.
+    optional ArtThreadType thread_type = 6;
+
+    // Which counter this is that is being reported.
+    optional ArtDatumId kind = 7;
+
+    // The value of the counter.
+    optional int64 value = 8;
+
+    // The type of dex metadata
+    optional ArtDexMetadataType dex_metadata_type = 9;
+
+    // The type of the APK file.
+    optional ArtApkType apk_type = 10;
+
+    // The ISA of the device.
+    optional ArtIsa isa = 11;
+
+    // The Garbage Collector used in the Android Runtime.
+    optional ArtGcCollectorType gc = 12;
+
+    // The support for userfaultfd and minor fault mode.
+    optional ArtUffdSupport uffd_support = 13;
+}
+
+// ArtDatumDeltaReported is the same as ArtDatumReported, except for the kind field
+// (ArtDatumDeltaId here, ArtDatumId for ArtDatumReported)
+message ArtDatumDeltaReported {
+    // The session ID is used to correlate this report with others from the same ART instance.
+    optional int64 session_id = 1;
+
+    // The UID of the app that ART is running on behalf of.
+    optional int32 uid = 2 [(is_uid) = true];
+
+    // What compiler filter the APK or DEX file was compiled with.
+    optional ArtCompileFilter compile_filter = 3;
+
+    // Why the package was compiled the way it was.
+    optional ArtCompilationReason compilation_reason = 4;
+
+    // The number of milliseconds since the ART runtime instance was started.
+    optional int64 timestamp_millis = 5;
+
+    // What kind of thread (UI or background) this metric corresponds to.
+    optional ArtThreadType thread_type = 6;
+
+    // Which counter this is that is being reported.
+    optional ArtDatumDeltaId kind = 7;
+
+    // The value of the counter.
+    optional int64 value = 8;
+
+    // The type of dex metadata
+    optional ArtDexMetadataType dex_metadata_type = 9;
+
+    // The type of the APK file.
+    optional ArtApkType apk_type = 10;
+
+    // The ISA of the device.
+    optional ArtIsa isa = 11;
+
+    // The Garbage Collector used in the Android Runtime.
+    optional ArtGcCollectorType gc = 12;
+
+    // The support for userfaultfd and minor fault mode.
+    optional ArtUffdSupport uffd_support = 13;
+}
+
+/**
+ * Logs ART metrics that are device-specific (as opposed to app-specific ones logged by
+ * ArtDatumReported).
+ *
+ * Logged from:
+ *   art/runtime/metrics/statsd.cc
+ */
+ message ArtDeviceDatumReported {
+    enum BootImageStatus {
+        // Unknown value.
+        STATUS_UNSPECIFIED = 0;
+        // Boot image(s) are fully usable.
+        STATUS_FULL = 1;
+        // Only the minimal boot image is usable.
+        STATUS_MINIMAL = 2;
+        // No boot image is usable.
+        STATUS_NONE = 3;
+    }
+
+    optional BootImageStatus boot_image_status = 1;
+}
diff --git a/stats/atoms/art/background_dexopt_atoms.proto b/stats/atoms/art/background_dexopt_atoms.proto
new file mode 100644
index 0000000..562f985
--- /dev/null
+++ b/stats/atoms/art/background_dexopt_atoms.proto
@@ -0,0 +1,82 @@
+syntax = "proto2";
+
+package android.os.statsd.art;
+
+import "frameworks/proto_logging/stats/enums/app/job/enums.proto";
+
+option java_package = "com.android.os.art";
+
+/**
+ * Logs when a background dexopt job is ended.
+ *
+ * Logged from:
+ *   frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
+ */
+ message BackgroundDexoptJobEnded {
+    // Corresponds to `BackgroundDexOptService.Status`, except for
+    // `STATUS_JOB_FINISHED`.
+    enum Status {
+        STATUS_UNKNOWN = 0;
+
+        // The job has finished. This value is used even if some packages have
+        // failed compilation during the job. (Corresponds to either
+        // `BackgroundDexOptService.Status.STATUS_OK` or
+        // `BackgroundDexOptService.Status.STATUS_DEX_OPT_FAILED`.)
+        STATUS_JOB_FINISHED = 1;
+
+        // The job is aborted by the job scheduler. The reason is logged in
+        // `cancellation_reason`.
+        STATUS_ABORT_BY_CANCELLATION = 2;
+
+        // The job is aborted by itself because there is no space left. Note
+        // that this does NOT include cases where the job is aborted by the job
+        // scheduler due to no space left, which are logged as
+        // `STATUS_ABORT_BY_CANCELLATION` with `cancellation_reason` being
+        // `STOP_REASON_CONSTRAINT_STORAGE_NOT_LOW`.
+        STATUS_ABORT_NO_SPACE_LEFT = 3;
+
+        // The job is aborted by itself because of thermal issues. Note that
+        // this does NOT include cases where the job is aborted by the job
+        // scheduler due to thermal issues, which are logged as
+        // `STATUS_ABORT_BY_CANCELLATION` with `cancellation_reason` being
+        // `STOP_REASON_DEVICE_STATE`.
+        //
+        // Only applies to the legacy dexopt job.
+        STATUS_ABORT_THERMAL = 4;
+
+        // The job is aborted by itself because of unsatisfied battery level.
+        // Note that this does NOT include cases where the job is aborted by the
+        // job scheduler due to unsatisfied battery level, which are logged as
+        // `STATUS_ABORT_BY_CANCELLATION` with `cancellation_reason` being
+        // `STOP_REASON_CONSTRAINT_BATTERY_NOT_LOW`.
+        //
+        // Only applies to the legacy dexopt job.
+        STATUS_ABORT_BATTERY = 5;
+
+        // The job is aborted by the API
+        // `ArtManagerLocal.cancelBackgroundDexoptJob`.
+        //
+        // Only applies to the background dexopt job in ART Service.
+        STATUS_ABORT_BY_API = 6;
+
+        // The job encountered a fatal error, such as a runtime exception. Note
+        // that this does NOT include cases where the job finishes normally with
+        // some dexopt failures on some apps, which are expected and logged as
+        // `STATUS_JOB_FINISHED`.
+        STATUS_FATAL_ERROR = 7;
+    }
+
+    optional Status status = 1;
+
+    // If `status` is `STATUS_ABORT_BY_CANCELLATION`, the reason of the
+    // cancellation.
+    optional android.app.job.StopReasonEnum cancellation_reason = 2;
+
+    // The duration of the job run, in milliseconds.
+    optional int64 duration_ms = 3;
+
+    // The duration of the job run, in milliseconds, including time spent in
+    // sleep. Deprecated as the job scheduler holds a wake lock, hence this
+    // duration is always going to be the same as above.
+    optional int64 duration_including_sleep_ms = 4 [deprecated = true];
+}
diff --git a/stats/atoms/art/odrefresh_atoms.proto b/stats/atoms/art/odrefresh_atoms.proto
new file mode 100644
index 0000000..be48d8e
--- /dev/null
+++ b/stats/atoms/art/odrefresh_atoms.proto
@@ -0,0 +1,200 @@
+syntax = "proto2";
+
+package android.os.statsd.art;
+
+option java_package = "com.android.os.art";
+
+/*
+ * Logs information about on-device refresh of ART AOT artifacts for boot classpath extensions
+ * and system_server.
+ *
+ * Logged from:
+ *   art/odrefresh/odrefresh.cc
+ */
+ message OdrefreshReported {
+    optional int64 art_apex_version = 1;
+
+    enum Trigger {
+        // A placeholder for unknown values.
+        TRIGGER_UNKNOWN = 0;
+
+        // ART APEX version has changed since time artifacts were generated.
+        TRIGGER_APEX_VERSION_MISMATCH = 1;
+
+        // Dex files on the boot classpath or system_server classpath have changed.
+        TRIGGER_DEX_FILES_CHANGED = 2;
+
+        // Missing artifacts.
+        TRIGGER_MISSING_ARTIFACTS = 3;
+    }
+
+    optional Trigger trigger = 2;
+
+    enum Stage {
+        // A placeholder for unknown values.
+        STAGE_UNKNOWN = 0;
+
+        // Checking stage.
+        STAGE_CHECK = 10;
+
+        // Preparation for compilation.
+        STAGE_PREPARATION = 20;
+
+        // Compilation of the boot classpath for the primary architecture
+        // ("primary boot classpath").
+        STAGE_PRIMARY_BOOT_CLASSPATH = 30;
+
+        // Compilation of the boot classpath for the secondary architecture
+        // ("secondary boot classpath"), if any.
+        STAGE_SECONDARY_BOOT_CLASSPATH = 40;
+
+        // Compilation of system_server classpath.
+        STAGE_SYSTEM_SERVER_CLASSPATH = 50;
+
+        // All stages completed.
+        STAGE_COMPLETE = 60;
+    }
+
+    optional Stage stage_reached = 3;
+
+    enum Status {
+        // A placeholder for unknown values.
+        STATUS_UNKNOWN = 0;
+
+        // OK, no problems encountered.
+        STATUS_OK = 1;
+
+        // Insufficient space.
+        STATUS_NO_SPACE = 2;
+
+        // Storage operation failed.
+        STATUS_IO_ERROR = 3;
+
+        // Dex2oat reported an error.
+        STATUS_DEX2OAT_ERROR = 4;
+
+        reserved 5; // was STATUS_TIME_LIMIT_EXCEEDED
+
+        // Failure creating staging area.
+        STATUS_STAGING_FAILED = 6;
+
+        // Installation of artifacts failed.
+        STATUS_INSTALL_FAILED = 7;
+
+        // Failed to access the dalvik-cache directory due to lack of
+        // permission.
+        STATUS_DALVIK_CACHE_PERMISSION_DENIED = 8;
+    }
+
+    optional Status status = 4;
+
+    // Compilation time of the boot classpath for the primary architecture
+    // ("primary boot classpath"), in seconds.
+    optional int32 primary_bcp_compilation_seconds = 5;
+
+    // Compilation time of the boot classpath for the secondary architecture
+    // ("secondary boot classpath"), if any, in seconds.
+    optional int32 secondary_bcp_compilation_seconds = 6;
+
+    // Compilation time of system_server classpath, in seconds.
+    optional int32 system_server_compilation_seconds = 7;
+
+    // Cache space at start of update.
+    optional int32 cache_space_free_start_mib = 8;
+
+    // Cache space at end of update.
+    optional int32 cache_space_free_end_mib = 9;
+
+    // Compilation time of the boot classpath for the primary architecture
+    // ("primary boot classpath"), in milliseconds.
+    optional int32 primary_bcp_compilation_millis = 10;
+
+    // Compilation time of the boot classpath for the secondary architecture
+    // ("secondary boot classpath"), if any, in milliseconds.
+    optional int32 secondary_bcp_compilation_millis = 11;
+
+    // Compilation time of system_server classpath, in milliseconds.
+    optional int32 system_server_compilation_millis = 12;
+
+    enum ExecResultStatus {
+        // Unable to get the status.
+        EXEC_RESULT_STATUS_UNKNOWN = 0;
+        // Process exited normally with an exit code.
+        EXEC_RESULT_STATUS_EXITED = 1;
+        // Process terminated by a signal.
+        EXEC_RESULT_STATUS_SIGNALED = 2;
+        // Process timed out and killed.
+        EXEC_RESULT_STATUS_TIMED_OUT = 3;
+        // Failed to start the process.
+        EXEC_RESULT_STATUS_START_FAILED = 4;
+        // Process was not run.
+        EXEC_RESULT_STATUS_NOT_RUN = 5;
+    }
+
+    // Status for the compilation of the boot
+    // classpath for the primary architecture.
+    optional ExecResultStatus primary_bcp_dex2oat_result_status = 13;
+
+    // Exit code for the compilation of the boot classpath for the
+    // primary architecture if status is EXEC_RESULT_STATUS_EXITED, else -1.
+    optional int32 primary_bcp_dex2oat_result_exit_code = 14;
+
+    // Signal for the compilation of the boot classpath for the
+    // primary architecture if status is EXEC_RESULT_STATUS_SIGNALED, else 0.
+    optional int32 primary_bcp_dex2oat_result_signal = 15;
+
+    // Status for the compilation of the boot
+    // classpath for the secondary architecture.
+    optional ExecResultStatus secondary_bcp_dex2oat_result_status = 16;
+
+    // Exit code for the compilation of the boot classpath for the
+    // secondary architecture if status is EXEC_RESULT_STATUS_EXITED, else -1.
+    optional int32 secondary_bcp_dex2oat_result_exit_code = 17;
+
+    // Signal for the compilation of the boot classpath for the
+    // secondary architecture if status is EXEC_RESULT_STATUS_SIGNALED, else 0.
+    optional int32 secondary_bcp_dex2oat_result_signal = 18;
+
+    // Status for the compilation of the boot classpath for the system_server.
+    optional ExecResultStatus system_server_dex2oat_result_status = 19;
+
+    // Exit code for the compilation of the boot classpath for the
+    // system_server if status is EXEC_RESULT_STATUS_EXITED, else -1.
+    optional int32 system_server_dex2oat_result_exit_code = 20;
+
+    // Signal for the compilation of the boot classpath for the
+    // system_server if status is EXEC_RESULT_STATUS_SIGNALED, else 0.
+    optional int32 system_server_dex2oat_result_signal = 21;
+};
+
+/**
+ * Logs odsign metrics.
+ *
+ * Logged from:
+ *   frameworks/base/services/core/java/com/android/server/pm/dex/OdsignStatsLogger.java
+ */
+ message OdsignReported {
+    enum Status {
+        // Unknown value.
+        STATUS_UNSPECIFIED = 0;
+        // All artifacts are generated and signed.
+        STATUS_ALL_OK = 1;
+        // Some artifacts are generated and signed, but odrefresh failed to generate the rest. See
+        // odrefresh metrics for the odrefresh failure.
+        STATUS_PARTIAL_OK = 2;
+        // Odrefresh failed to generate any artifact. See odrefresh metrics for the odrefresh
+        // failure.
+        STATUS_ODREFRESH_FAILED = 3;
+        // Odsign failed when interacting with Keystore.
+        STATUS_KEYSTORE_FAILED = 4;
+        // Odsign failed when initializing certificate.
+        STATUS_CERT_FAILED = 5;
+        // Odsign failed when cleaning up existing artifacts. Note that odrefresh may also clean up
+        // existing artifacts, and failures about that are logged as `STATUS_ODREFRESH_FAILED`.
+        STATUS_CLEANUP_FAILED = 6;
+        // Odsign failed when signing artifacts.
+        STATUS_SIGNING_FAILED = 7;
+    }
+
+    optional Status status = 1;
+}