aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Android.bp5
-rw-r--r--BUILD4
-rw-r--r--protos/perfetto/metrics/android/BUILD.gn1
-rw-r--r--protos/perfetto/metrics/android/android_boot.proto31
-rw-r--r--protos/perfetto/metrics/android/android_oom_adjuster_metric.proto53
-rw-r--r--protos/perfetto/metrics/metrics.proto5
-rw-r--r--protos/perfetto/metrics/perfetto_merged_metrics.proto72
-rw-r--r--python/perfetto/trace_processor/metrics.descriptor67
-rw-r--r--src/trace_processor/metrics/sql/android/BUILD.gn1
-rw-r--r--src/trace_processor/metrics/sql/android/android_boot.sql264
-rw-r--r--src/trace_processor/metrics/sql/android/android_oom_adjuster.sql139
-rw-r--r--src/trace_processor/perfetto_sql/intrinsics/operators/BUILD.gn3
-rw-r--r--src/trace_processor/perfetto_sql/intrinsics/operators/counter_mipmap_operator.cc265
-rw-r--r--src/trace_processor/perfetto_sql/intrinsics/operators/counter_mipmap_operator.h127
-rw-r--r--src/trace_processor/trace_processor_impl.cc4
-rw-r--r--test/trace_processor/diff_tests/metrics/android/android_boot.out972
-rw-r--r--test/trace_processor/diff_tests/metrics/android/android_oom_adjuster.out2745
-rw-r--r--test/trace_processor/diff_tests/metrics/android/tests.py6
-rw-r--r--ui/src/frontend/base_counter_track.ts171
-rw-r--r--ui/src/tracks/counter/index.ts32
20 files changed, 4713 insertions, 254 deletions
diff --git a/Android.bp b/Android.bp
index 8a4ba32ec..6a37b9211 100644
--- a/Android.bp
+++ b/Android.bp
@@ -5168,6 +5168,7 @@ genrule {
"protos/perfetto/metrics/android/android_boot_unagg.proto",
"protos/perfetto/metrics/android/android_frame_timeline_metric.proto",
"protos/perfetto/metrics/android/android_garbage_collection_unagg_metric.proto",
+ "protos/perfetto/metrics/android/android_oom_adjuster_metric.proto",
"protos/perfetto/metrics/android/android_sysui_notifications_blocking_calls_metric.proto",
"protos/perfetto/metrics/android/android_trusty_workqueues.proto",
"protos/perfetto/metrics/android/anr_metric.proto",
@@ -5257,6 +5258,7 @@ genrule {
"protos/perfetto/metrics/android/android_boot_unagg.proto",
"protos/perfetto/metrics/android/android_frame_timeline_metric.proto",
"protos/perfetto/metrics/android/android_garbage_collection_unagg_metric.proto",
+ "protos/perfetto/metrics/android/android_oom_adjuster_metric.proto",
"protos/perfetto/metrics/android/android_sysui_notifications_blocking_calls_metric.proto",
"protos/perfetto/metrics/android/android_trusty_workqueues.proto",
"protos/perfetto/metrics/android/anr_metric.proto",
@@ -5329,6 +5331,7 @@ genrule {
"protos/perfetto/metrics/android/android_boot_unagg.proto",
"protos/perfetto/metrics/android/android_frame_timeline_metric.proto",
"protos/perfetto/metrics/android/android_garbage_collection_unagg_metric.proto",
+ "protos/perfetto/metrics/android/android_oom_adjuster_metric.proto",
"protos/perfetto/metrics/android/android_sysui_notifications_blocking_calls_metric.proto",
"protos/perfetto/metrics/android/android_trusty_workqueues.proto",
"protos/perfetto/metrics/android/anr_metric.proto",
@@ -12038,6 +12041,7 @@ genrule {
"src/trace_processor/metrics/sql/android/android_multiuser.sql",
"src/trace_processor/metrics/sql/android/android_multiuser_populator.sql",
"src/trace_processor/metrics/sql/android/android_netperf.sql",
+ "src/trace_processor/metrics/sql/android/android_oom_adjuster.sql",
"src/trace_processor/metrics/sql/android/android_other_traces.sql",
"src/trace_processor/metrics/sql/android/android_package_list.sql",
"src/trace_processor/metrics/sql/android/android_powrails.sql",
@@ -12286,6 +12290,7 @@ filegroup {
filegroup {
name: "perfetto_src_trace_processor_perfetto_sql_intrinsics_operators_operators",
srcs: [
+ "src/trace_processor/perfetto_sql/intrinsics/operators/counter_mipmap_operator.cc",
"src/trace_processor/perfetto_sql/intrinsics/operators/span_join_operator.cc",
"src/trace_processor/perfetto_sql/intrinsics/operators/window_operator.cc",
],
diff --git a/BUILD b/BUILD
index c9f3381cb..1b4778ec5 100644
--- a/BUILD
+++ b/BUILD
@@ -1998,6 +1998,7 @@ perfetto_filegroup(
"src/trace_processor/metrics/sql/android/android_multiuser.sql",
"src/trace_processor/metrics/sql/android/android_multiuser_populator.sql",
"src/trace_processor/metrics/sql/android/android_netperf.sql",
+ "src/trace_processor/metrics/sql/android/android_oom_adjuster.sql",
"src/trace_processor/metrics/sql/android/android_other_traces.sql",
"src/trace_processor/metrics/sql/android/android_package_list.sql",
"src/trace_processor/metrics/sql/android/android_powrails.sql",
@@ -2313,6 +2314,8 @@ perfetto_cc_tp_tables(
perfetto_filegroup(
name = "src_trace_processor_perfetto_sql_intrinsics_operators_operators",
srcs = [
+ "src/trace_processor/perfetto_sql/intrinsics/operators/counter_mipmap_operator.cc",
+ "src/trace_processor/perfetto_sql/intrinsics/operators/counter_mipmap_operator.h",
"src/trace_processor/perfetto_sql/intrinsics/operators/span_join_operator.cc",
"src/trace_processor/perfetto_sql/intrinsics/operators/span_join_operator.h",
"src/trace_processor/perfetto_sql/intrinsics/operators/window_operator.cc",
@@ -4442,6 +4445,7 @@ perfetto_proto_library(
"protos/perfetto/metrics/android/android_boot_unagg.proto",
"protos/perfetto/metrics/android/android_frame_timeline_metric.proto",
"protos/perfetto/metrics/android/android_garbage_collection_unagg_metric.proto",
+ "protos/perfetto/metrics/android/android_oom_adjuster_metric.proto",
"protos/perfetto/metrics/android/android_sysui_notifications_blocking_calls_metric.proto",
"protos/perfetto/metrics/android/android_trusty_workqueues.proto",
"protos/perfetto/metrics/android/anr_metric.proto",
diff --git a/protos/perfetto/metrics/android/BUILD.gn b/protos/perfetto/metrics/android/BUILD.gn
index 5b8fab6dd..5430c22fc 100644
--- a/protos/perfetto/metrics/android/BUILD.gn
+++ b/protos/perfetto/metrics/android/BUILD.gn
@@ -28,6 +28,7 @@ perfetto_proto_library("@TYPE@") {
"android_boot_unagg.proto",
"android_frame_timeline_metric.proto",
"android_garbage_collection_unagg_metric.proto",
+ "android_oom_adjuster_metric.proto",
"android_sysui_notifications_blocking_calls_metric.proto",
"android_trusty_workqueues.proto",
"anr_metric.proto",
diff --git a/protos/perfetto/metrics/android/android_boot.proto b/protos/perfetto/metrics/android/android_boot.proto
index a043efe06..9f90ba555 100644
--- a/protos/perfetto/metrics/android/android_boot.proto
+++ b/protos/perfetto/metrics/android/android_boot.proto
@@ -56,8 +56,39 @@ message AndroidBootMetric {
optional int64 alloc_gc_count = 11;
optional double mb_per_ms_of_gc = 12;
}
+ message OomAdjusterTransitionCounts {
+ // name of the item aggregated by. example: process_name, oom_adjuster_reason.
+ optional string name = 1;
+ // name of previous oom bucket.
+ optional string src_bucket = 2;
+ // name of oom bucket.
+ optional string dest_bucket = 3;
+ // count of transitions
+ optional int64 count = 4;
+ }
+ message OomAdjBucketDurationAggregation {
+ // name of the item aggregated by. example: process_name, oom_adjuster_reason
+ optional string name = 1;
+ // name of oom bucket.
+ optional string bucket = 2;
+ // Duration of the time in the bucket
+ optional int64 total_dur = 3;
+ }
+ message OomAdjDurationAggregation {
+ optional int64 min_oom_adj_dur = 1;
+ optional int64 max_oom_adj_dur = 2;
+ optional double avg_oom_adj_dur = 3;
+ optional int64 oom_adj_event_count = 4;
+ optional string oom_adj_reason = 5;
+ }
optional ProcessStartAggregation full_trace_process_start_aggregation = 6;
optional ProcessStartAggregation post_boot_process_start_aggregation = 7;
optional GarbageCollectionAggregation full_trace_gc_aggregation = 8;
optional GarbageCollectionAggregation post_boot_gc_aggregation = 9;
+ repeated OomAdjusterTransitionCounts post_boot_oom_adjuster_transition_counts_global = 10;
+ repeated OomAdjusterTransitionCounts post_boot_oom_adjuster_transition_counts_by_process = 11;
+ repeated OomAdjusterTransitionCounts post_boot_oom_adjuster_transition_counts_by_oom_adj_reason = 12;
+ repeated OomAdjBucketDurationAggregation post_boot_oom_adj_bucket_duration_agg_global = 13;
+ repeated OomAdjBucketDurationAggregation post_boot_oom_adj_bucket_duration_agg_by_process = 14;
+ repeated OomAdjDurationAggregation post_boot_oom_adj_duration_agg = 15;
}
diff --git a/protos/perfetto/metrics/android/android_oom_adjuster_metric.proto b/protos/perfetto/metrics/android/android_oom_adjuster_metric.proto
new file mode 100644
index 000000000..95af7b4b0
--- /dev/null
+++ b/protos/perfetto/metrics/android/android_oom_adjuster_metric.proto
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License; Version 2.0 (the "License")= ;
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing; software
+ * distributed under the License is distributed on an "AS IS" BASIS;
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND; either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+syntax = "proto2";
+
+package perfetto.protos;
+
+message AndroidOomAdjusterMetric {
+ message OomAdjusterTransitionCounts {
+ // name of the item aggregated by. example: process_name, oom_adjuster_reason.
+ optional string name = 1;
+ // name of previous oom bucket.
+ optional string src_bucket = 2;
+ // name of oom bucket.
+ optional string dest_bucket = 3;
+ // count of transitions
+ optional int64 count = 4;
+ }
+ message OomAdjBucketDurationAggregation {
+ // name of the item aggregated by. example: process_name, oom_adjuster_reason
+ optional string name = 1;
+ // name of oom bucket.
+ optional string bucket = 2;
+ // Duration of the time in the bucket
+ optional int64 total_dur = 3;
+ }
+ message OomAdjDurationAggregation {
+ optional int64 min_oom_adj_dur = 1;
+ optional int64 max_oom_adj_dur = 2;
+ optional double avg_oom_adj_dur = 3;
+ optional int64 oom_adj_event_count = 4;
+ optional string oom_adj_reason = 5;
+ }
+ repeated OomAdjusterTransitionCounts oom_adjuster_transition_counts_global = 1;
+ repeated OomAdjusterTransitionCounts oom_adjuster_transition_counts_by_process = 2;
+ repeated OomAdjusterTransitionCounts oom_adjuster_transition_counts_by_oom_adj_reason = 3;
+ repeated OomAdjBucketDurationAggregation oom_adj_bucket_duration_agg_global = 4;
+ repeated OomAdjBucketDurationAggregation oom_adj_bucket_duration_agg_by_process = 5;
+ repeated OomAdjDurationAggregation oom_adj_duration_agg = 6;
+} \ No newline at end of file
diff --git a/protos/perfetto/metrics/metrics.proto b/protos/perfetto/metrics/metrics.proto
index 83395ecb4..c3025c301 100644
--- a/protos/perfetto/metrics/metrics.proto
+++ b/protos/perfetto/metrics/metrics.proto
@@ -71,6 +71,7 @@ import "protos/perfetto/metrics/android/binder_metric.proto";
import "protos/perfetto/metrics/android/monitor_contention_metric.proto";
import "protos/perfetto/metrics/android/monitor_contention_agg_metric.proto";
import "protos/perfetto/metrics/android/app_process_starts_metric.proto";
+import "protos/perfetto/metrics/android/android_oom_adjuster_metric.proto";
// Trace processor metadata
message TraceMetadata {
@@ -298,6 +299,10 @@ message TraceMetrics {
// All blocking calls (e.g. binder calls) for a trace.
optional AndroidBlockingCallsUnagg android_blocking_calls_unagg = 65;
+ // Android OOM unaggregated metrics.
+ optional AndroidOomAdjusterMetric android_oom_adjuster = 66;
+
+ // Android
// Demo extensions.
extensions 450 to 499;
diff --git a/protos/perfetto/metrics/perfetto_merged_metrics.proto b/protos/perfetto/metrics/perfetto_merged_metrics.proto
index 6b7a611d2..86f7d5986 100644
--- a/protos/perfetto/metrics/perfetto_merged_metrics.proto
+++ b/protos/perfetto/metrics/perfetto_merged_metrics.proto
@@ -203,10 +203,41 @@ message AndroidBootMetric {
optional int64 alloc_gc_count = 11;
optional double mb_per_ms_of_gc = 12;
}
+ message OomAdjusterTransitionCounts {
+ // name of the item aggregated by. example: process_name, oom_adjuster_reason.
+ optional string name = 1;
+ // name of previous oom bucket.
+ optional string src_bucket = 2;
+ // name of oom bucket.
+ optional string dest_bucket = 3;
+ // count of transitions
+ optional int64 count = 4;
+ }
+ message OomAdjBucketDurationAggregation {
+ // name of the item aggregated by. example: process_name, oom_adjuster_reason
+ optional string name = 1;
+ // name of oom bucket.
+ optional string bucket = 2;
+ // Duration of the time in the bucket
+ optional int64 total_dur = 3;
+ }
+ message OomAdjDurationAggregation {
+ optional int64 min_oom_adj_dur = 1;
+ optional int64 max_oom_adj_dur = 2;
+ optional double avg_oom_adj_dur = 3;
+ optional int64 oom_adj_event_count = 4;
+ optional string oom_adj_reason = 5;
+ }
optional ProcessStartAggregation full_trace_process_start_aggregation = 6;
optional ProcessStartAggregation post_boot_process_start_aggregation = 7;
optional GarbageCollectionAggregation full_trace_gc_aggregation = 8;
optional GarbageCollectionAggregation post_boot_gc_aggregation = 9;
+ repeated OomAdjusterTransitionCounts post_boot_oom_adjuster_transition_counts_global = 10;
+ repeated OomAdjusterTransitionCounts post_boot_oom_adjuster_transition_counts_by_process = 11;
+ repeated OomAdjusterTransitionCounts post_boot_oom_adjuster_transition_counts_by_oom_adj_reason = 12;
+ repeated OomAdjBucketDurationAggregation post_boot_oom_adj_bucket_duration_agg_global = 13;
+ repeated OomAdjBucketDurationAggregation post_boot_oom_adj_bucket_duration_agg_by_process = 14;
+ repeated OomAdjDurationAggregation post_boot_oom_adj_duration_agg = 15;
}
// End of protos/perfetto/metrics/android/android_boot.proto
@@ -365,6 +396,43 @@ message AndroidFrameTimelineMetric {
// End of protos/perfetto/metrics/android/android_frame_timeline_metric.proto
+// Begin of protos/perfetto/metrics/android/android_oom_adjuster_metric.proto
+
+message AndroidOomAdjusterMetric {
+ message OomAdjusterTransitionCounts {
+ // name of the item aggregated by. example: process_name, oom_adjuster_reason.
+ optional string name = 1;
+ // name of previous oom bucket.
+ optional string src_bucket = 2;
+ // name of oom bucket.
+ optional string dest_bucket = 3;
+ // count of transitions
+ optional int64 count = 4;
+ }
+ message OomAdjBucketDurationAggregation {
+ // name of the item aggregated by. example: process_name, oom_adjuster_reason
+ optional string name = 1;
+ // name of oom bucket.
+ optional string bucket = 2;
+ // Duration of the time in the bucket
+ optional int64 total_dur = 3;
+ }
+ message OomAdjDurationAggregation {
+ optional int64 min_oom_adj_dur = 1;
+ optional int64 max_oom_adj_dur = 2;
+ optional double avg_oom_adj_dur = 3;
+ optional int64 oom_adj_event_count = 4;
+ optional string oom_adj_reason = 5;
+ }
+ repeated OomAdjusterTransitionCounts oom_adjuster_transition_counts_global = 1;
+ repeated OomAdjusterTransitionCounts oom_adjuster_transition_counts_by_process = 2;
+ repeated OomAdjusterTransitionCounts oom_adjuster_transition_counts_by_oom_adj_reason = 3;
+ repeated OomAdjBucketDurationAggregation oom_adj_bucket_duration_agg_global = 4;
+ repeated OomAdjBucketDurationAggregation oom_adj_bucket_duration_agg_by_process = 5;
+ repeated OomAdjDurationAggregation oom_adj_duration_agg = 6;
+}
+// End of protos/perfetto/metrics/android/android_oom_adjuster_metric.proto
+
// Begin of protos/perfetto/metrics/android/android_sysui_notifications_blocking_calls_metric.proto
// Blocking calls inside System UI Notifications. Shows count and total duration for each.
@@ -2721,6 +2789,10 @@ message TraceMetrics {
// All blocking calls (e.g. binder calls) for a trace.
optional AndroidBlockingCallsUnagg android_blocking_calls_unagg = 65;
+ // Android OOM unaggregated metrics.
+ optional AndroidOomAdjusterMetric android_oom_adjuster = 66;
+
+ // Android
// Demo extensions.
extensions 450 to 499;
diff --git a/python/perfetto/trace_processor/metrics.descriptor b/python/perfetto/trace_processor/metrics.descriptor
index cc4850f97..c337e462d 100644
--- a/python/perfetto/trace_processor/metrics.descriptor
+++ b/python/perfetto/trace_processor/metrics.descriptor
@@ -25,11 +25,11 @@ adIdMetricT
app_set_id_metric ( 2).perfetto.protos.AdServicesAppSetIdMetricRappSetIdMetricM
odp_metric ( 2..perfetto.protos.OnDevicePersonalizationMetricR odpMetric
-¼
+ï
2protos/perfetto/metrics/android/android_boot.protoperfetto.protos"p
ProcessStateDurations
total_dur (RtotalDur:
-uninterruptible_sleep_dur (RuninterruptibleSleepDur"‚
+uninterruptible_sleep_dur (RuninterruptibleSleepDur"µ
AndroidBootMetric^
system_server_durations ( 2&.perfetto.protos.ProcessStateDurationsRsystemServerDurationsU
systemui_durations ( 2&.perfetto.protos.ProcessStateDurationsRsystemuiDurationsU
@@ -39,7 +39,14 @@ odp_metric ( 2..perfetto.protos.OnDevicePersonalizationMetricR odpMetric
$full_trace_process_start_aggregation ( 2:.perfetto.protos.AndroidBootMetric.ProcessStartAggregationR fullTraceProcessStartAggregationˆ
#post_boot_process_start_aggregation ( 2:.perfetto.protos.AndroidBootMetric.ProcessStartAggregationRpostBootProcessStartAggregationz
full_trace_gc_aggregation ( 2?.perfetto.protos.AndroidBootMetric.GarbageCollectionAggregationRfullTraceGcAggregationx
-post_boot_gc_aggregation ( 2?.perfetto.protos.AndroidBootMetric.GarbageCollectionAggregationRpostBootGcAggregation9
+post_boot_gc_aggregation ( 2?.perfetto.protos.AndroidBootMetric.GarbageCollectionAggregationRpostBootGcAggregation¢
+/post_boot_oom_adjuster_transition_counts_global
+ ( 2>.perfetto.protos.AndroidBootMetric.OomAdjusterTransitionCountsR)postBootOomAdjusterTransitionCountsGlobal©
+3post_boot_oom_adjuster_transition_counts_by_process ( 2>.perfetto.protos.AndroidBootMetric.OomAdjusterTransitionCountsR,postBootOomAdjusterTransitionCountsByProcessµ
+:post_boot_oom_adjuster_transition_counts_by_oom_adj_reason ( 2>.perfetto.protos.AndroidBootMetric.OomAdjusterTransitionCountsR1postBootOomAdjusterTransitionCountsByOomAdjReasonŸ
+,post_boot_oom_adj_bucket_duration_agg_global ( 2B.perfetto.protos.AndroidBootMetric.OomAdjBucketDurationAggregationR%postBootOomAdjBucketDurationAggGlobal¦
+0post_boot_oom_adj_bucket_duration_agg_by_process ( 2B.perfetto.protos.AndroidBootMetric.OomAdjBucketDurationAggregationR(postBootOomAdjBucketDurationAggByProcess
+post_boot_oom_adj_duration_agg ( 2<.perfetto.protos.AndroidBootMetric.OomAdjDurationAggregationRpostBootOomAdjDurationAgg9
LauncherBreakdown$
cold_start_dur (R coldStartDur™
ProcessStartAggregation&
@@ -59,7 +66,24 @@ $full_trace_process_start_aggregation ( 2:.perfetto.protos.AndroidBootMetric.
explicit_gc_count
(RexplicitGcCount$
alloc_gc_count (R allocGcCount$
-mb_per_ms_of_gc (R mbPerMsOfGc
+mb_per_ms_of_gc (R mbPerMsOfGc‡
+OomAdjusterTransitionCounts
+name ( Rname
+
+src_bucket ( R srcBucket
+ dest_bucket ( R
+destBucket
+count (Rcountj
+OomAdjBucketDurationAggregation
+name ( Rname
+bucket ( Rbucket
+ total_dur (RtotalDurå
+OomAdjDurationAggregation%
+min_oom_adj_dur (R minOomAdjDur%
+max_oom_adj_dur (R maxOomAdjDur%
+avg_oom_adj_dur (R avgOomAdjDur-
+oom_adj_event_count (RoomAdjEventCount$
+oom_adj_reason ( R oomAdjReason
Ž
?protos/perfetto/metrics/android/app_process_starts_metric.protoperfetto.protos"¹
AndroidAppProcessStartsMetricV
@@ -1203,8 +1227,34 @@ Cprotos/perfetto/metrics/android/monitor_contention_agg_metric.protoperfetto.p
total_contention_dur (RtotalContentionDur?
main_thread_contention_count (RmainThreadContentionCount;
main_thread_contention_dur (RmainThreadContentionDur
-›G
-%protos/perfetto/metrics/metrics.protoperfetto.protos8protos/perfetto/metrics/android/ad_services_metric.proto2protos/perfetto/metrics/android/android_boot.proto8protos/perfetto/metrics/android/android_boot_unagg.protoMprotos/perfetto/metrics/android/android_garbage_collection_unagg_metric.protoKprotos/perfetto/metrics/android/sysui_notif_shade_list_builder_metric.protoRprotos/perfetto/metrics/android/sysui_update_notif_on_ui_mode_changed_metric.protoCprotos/perfetto/metrics/android/android_frame_timeline_metric.proto0protos/perfetto/metrics/android/anr_metric.proto1protos/perfetto/metrics/android/batt_metric.protoWprotos/perfetto/metrics/android/android_sysui_notifications_blocking_calls_metric.protoGprotos/perfetto/metrics/android/android_blocking_calls_cuj_metric.protoBprotos/perfetto/metrics/android/android_blocking_calls_unagg.proto3protos/perfetto/metrics/android/codec_metrics.proto0protos/perfetto/metrics/android/cpu_metric.proto3protos/perfetto/metrics/android/camera_metric.proto9protos/perfetto/metrics/android/camera_unagg_metric.proto5protos/perfetto/metrics/android/display_metrics.proto5protos/perfetto/metrics/android/dma_heap_metric.proto1protos/perfetto/metrics/android/dvfs_metric.proto4protos/perfetto/metrics/android/fastrpc_metric.proto0protos/perfetto/metrics/android/g2d_metric.proto0protos/perfetto/metrics/android/gpu_metric.proto0protos/perfetto/metrics/android/hwcomposer.proto1protos/perfetto/metrics/android/hwui_metric.proto/protos/perfetto/metrics/android/io_metric.proto5protos/perfetto/metrics/android/io_unagg_metric.proto0protos/perfetto/metrics/android/ion_metric.proto8protos/perfetto/metrics/android/irq_runtime_metric.proto5protos/perfetto/metrics/android/jank_cuj_metric.proto9protos/perfetto/metrics/android/java_heap_histogram.proto5protos/perfetto/metrics/android/java_heap_stats.proto0protos/perfetto/metrics/android/lmk_metric.proto7protos/perfetto/metrics/android/lmk_reason_metric.proto0protos/perfetto/metrics/android/mem_metric.proto6protos/perfetto/metrics/android/mem_unagg_metric.proto6protos/perfetto/metrics/android/multiuser_metric.proto4protos/perfetto/metrics/android/network_metric.proto2protos/perfetto/metrics/android/other_traces.proto2protos/perfetto/metrics/android/package_list.proto5protos/perfetto/metrics/android/powrails_metric.proto4protos/perfetto/metrics/android/profiler_smaps.proto7protos/perfetto/metrics/android/rt_runtime_metric.proto0protos/perfetto/metrics/android/simpleperf.proto4protos/perfetto/metrics/android/startup_metric.proto4protos/perfetto/metrics/android/surfaceflinger.proto0protos/perfetto/metrics/android/task_names.proto3protos/perfetto/metrics/android/trace_quality.proto?protos/perfetto/metrics/android/android_trusty_workqueues.proto9protos/perfetto/metrics/android/unsymbolized_frames.proto3protos/perfetto/metrics/android/binder_metric.proto?protos/perfetto/metrics/android/monitor_contention_metric.protoCprotos/perfetto/metrics/android/monitor_contention_agg_metric.proto?protos/perfetto/metrics/android/app_process_starts_metric.proto"î
+Aprotos/perfetto/metrics/android/android_oom_adjuster_metric.protoperfetto.protos"‹
+AndroidOomAdjusterMetric—
+%oom_adjuster_transition_counts_global ( 2E.perfetto.protos.AndroidOomAdjusterMetric.OomAdjusterTransitionCountsR!oomAdjusterTransitionCountsGlobalž
+)oom_adjuster_transition_counts_by_process ( 2E.perfetto.protos.AndroidOomAdjusterMetric.OomAdjusterTransitionCountsR$oomAdjusterTransitionCountsByProcessª
+0oom_adjuster_transition_counts_by_oom_adj_reason ( 2E.perfetto.protos.AndroidOomAdjusterMetric.OomAdjusterTransitionCountsR)oomAdjusterTransitionCountsByOomAdjReason”
+"oom_adj_bucket_duration_agg_global ( 2I.perfetto.protos.AndroidOomAdjusterMetric.OomAdjBucketDurationAggregationRoomAdjBucketDurationAggGlobal›
+&oom_adj_bucket_duration_agg_by_process ( 2I.perfetto.protos.AndroidOomAdjusterMetric.OomAdjBucketDurationAggregationR oomAdjBucketDurationAggByProcesst
+oom_adj_duration_agg ( 2C.perfetto.protos.AndroidOomAdjusterMetric.OomAdjDurationAggregationRoomAdjDurationAgg‡
+OomAdjusterTransitionCounts
+name ( Rname
+
+src_bucket ( R srcBucket
+ dest_bucket ( R
+destBucket
+count (Rcountj
+OomAdjBucketDurationAggregation
+name ( Rname
+bucket ( Rbucket
+ total_dur (RtotalDurå
+OomAdjDurationAggregation%
+min_oom_adj_dur (R minOomAdjDur%
+max_oom_adj_dur (R maxOomAdjDur%
+avg_oom_adj_dur (R avgOomAdjDur-
+oom_adj_event_count (RoomAdjEventCount$
+oom_adj_reason ( R oomAdjReason
+»H
+%protos/perfetto/metrics/metrics.protoperfetto.protos8protos/perfetto/metrics/android/ad_services_metric.proto2protos/perfetto/metrics/android/android_boot.proto8protos/perfetto/metrics/android/android_boot_unagg.protoMprotos/perfetto/metrics/android/android_garbage_collection_unagg_metric.protoKprotos/perfetto/metrics/android/sysui_notif_shade_list_builder_metric.protoRprotos/perfetto/metrics/android/sysui_update_notif_on_ui_mode_changed_metric.protoCprotos/perfetto/metrics/android/android_frame_timeline_metric.proto0protos/perfetto/metrics/android/anr_metric.proto1protos/perfetto/metrics/android/batt_metric.protoWprotos/perfetto/metrics/android/android_sysui_notifications_blocking_calls_metric.protoGprotos/perfetto/metrics/android/android_blocking_calls_cuj_metric.protoBprotos/perfetto/metrics/android/android_blocking_calls_unagg.proto3protos/perfetto/metrics/android/codec_metrics.proto0protos/perfetto/metrics/android/cpu_metric.proto3protos/perfetto/metrics/android/camera_metric.proto9protos/perfetto/metrics/android/camera_unagg_metric.proto5protos/perfetto/metrics/android/display_metrics.proto5protos/perfetto/metrics/android/dma_heap_metric.proto1protos/perfetto/metrics/android/dvfs_metric.proto4protos/perfetto/metrics/android/fastrpc_metric.proto0protos/perfetto/metrics/android/g2d_metric.proto0protos/perfetto/metrics/android/gpu_metric.proto0protos/perfetto/metrics/android/hwcomposer.proto1protos/perfetto/metrics/android/hwui_metric.proto/protos/perfetto/metrics/android/io_metric.proto5protos/perfetto/metrics/android/io_unagg_metric.proto0protos/perfetto/metrics/android/ion_metric.proto8protos/perfetto/metrics/android/irq_runtime_metric.proto5protos/perfetto/metrics/android/jank_cuj_metric.proto9protos/perfetto/metrics/android/java_heap_histogram.proto5protos/perfetto/metrics/android/java_heap_stats.proto0protos/perfetto/metrics/android/lmk_metric.proto7protos/perfetto/metrics/android/lmk_reason_metric.proto0protos/perfetto/metrics/android/mem_metric.proto6protos/perfetto/metrics/android/mem_unagg_metric.proto6protos/perfetto/metrics/android/multiuser_metric.proto4protos/perfetto/metrics/android/network_metric.proto2protos/perfetto/metrics/android/other_traces.proto2protos/perfetto/metrics/android/package_list.proto5protos/perfetto/metrics/android/powrails_metric.proto4protos/perfetto/metrics/android/profiler_smaps.proto7protos/perfetto/metrics/android/rt_runtime_metric.proto0protos/perfetto/metrics/android/simpleperf.proto4protos/perfetto/metrics/android/startup_metric.proto4protos/perfetto/metrics/android/surfaceflinger.proto0protos/perfetto/metrics/android/task_names.proto3protos/perfetto/metrics/android/trace_quality.proto?protos/perfetto/metrics/android/android_trusty_workqueues.proto9protos/perfetto/metrics/android/unsymbolized_frames.proto3protos/perfetto/metrics/android/binder_metric.proto?protos/perfetto/metrics/android/monitor_contention_metric.protoCprotos/perfetto/metrics/android/monitor_contention_agg_metric.proto?protos/perfetto/metrics/android/app_process_starts_metric.protoAprotos/perfetto/metrics/android/android_oom_adjuster_metric.proto"î
TraceMetadata*
trace_duration_ns (RtraceDurationNs
@@ -1234,7 +1284,7 @@ trace_uuid ( R traceUuid:
Source
SOURCE_UNKNOWN
SOURCE_TRACE
-SOURCE_ANALYSIS"·'
+SOURCE_ANALYSIS"”(
TraceMetricsH
android_batt ( 2%.perfetto.protos.AndroidBatteryMetricR androidBattB
android_cpu ( 2!.perfetto.protos.AndroidCpuMetricR
@@ -1299,5 +1349,6 @@ androidAnrw
android_boot_unagg> ( 2!.perfetto.protos.AndroidBootUnaggRandroidBootUnagg}
android_garbage_collection_unagg? ( 24.perfetto.protos.AndroidGarbageCollectionUnaggMetricRandroidGarbageCollectionUnagg]
android_auto_multiuser@ ( 2'.perfetto.protos.AndroidMultiuserMetricRandroidAutoMultiuserk
-android_blocking_calls_unaggA ( 2*.perfetto.protos.AndroidBlockingCallsUnaggRandroidBlockingCallsUnagg*Âô*ôé*éÑ*ÑÅJJ
+android_blocking_calls_unaggA ( 2*.perfetto.protos.AndroidBlockingCallsUnaggRandroidBlockingCallsUnagg[
+android_oom_adjusterB ( 2).perfetto.protos.AndroidOomAdjusterMetricRandroidOomAdjuster*Âô*ôé*éÑ*ÑÅJJ
 J JJJJJJ \ No newline at end of file
diff --git a/src/trace_processor/metrics/sql/android/BUILD.gn b/src/trace_processor/metrics/sql/android/BUILD.gn
index bd77d0a62..7de8cf6c3 100644
--- a/src/trace_processor/metrics/sql/android/BUILD.gn
+++ b/src/trace_processor/metrics/sql/android/BUILD.gn
@@ -56,6 +56,7 @@ perfetto_sql_source_set("android") {
"android_multiuser.sql",
"android_multiuser_populator.sql",
"android_netperf.sql",
+ "android_oom_adjuster.sql",
"android_other_traces.sql",
"android_package_list.sql",
"android_powrails.sql",
diff --git a/src/trace_processor/metrics/sql/android/android_boot.sql b/src/trace_processor/metrics/sql/android/android_boot.sql
index 34d1c403d..91403878f 100644
--- a/src/trace_processor/metrics/sql/android/android_boot.sql
+++ b/src/trace_processor/metrics/sql/android/android_boot.sql
@@ -17,6 +17,7 @@
INCLUDE PERFETTO MODULE android.process_metadata;
INCLUDE PERFETTO MODULE android.app_process_starts;
INCLUDE PERFETTO MODULE android.garbage_collection;
+INCLUDE PERFETTO MODULE android.oom_adjuster;
CREATE OR REPLACE PERFETTO FUNCTION get_durations(process_name STRING)
RETURNS TABLE(uint_sleep_dur LONG, total_dur LONG) AS
@@ -27,6 +28,55 @@ FROM android_process_metadata
INNER JOIN thread ON thread.upid=android_process_metadata.upid
INNER JOIN thread_state ON thread.utid=thread_state.utid WHERE android_process_metadata.process_name=$process_name;
+CREATE OR REPLACE PERFETTO FUNCTION first_user_unlocked() RETURNS INT AS
+SELECT COALESCE(MIN(ts), 0) FROM thread_slice
+WHERE name GLOB "*android.intent.action.USER_UNLOCKED*";
+
+DROP TABLE IF EXISTS _oom_adj_events_with_src_bucket;
+CREATE PERFETTO TABLE _oom_adj_events_with_src_bucket
+AS
+SELECT
+ LAG(bucket) OVER (PARTITION BY upid ORDER BY ts) AS src_bucket,
+ ts,
+ bucket,
+ process_name,
+ oom_adj_reason
+FROM android_oom_adj_intervals;
+
+DROP VIEW IF EXISTS oom_adj_events_by_process_name;
+CREATE PERFETTO VIEW oom_adj_events_by_process_name AS
+SELECT
+ src_bucket,
+ bucket,
+ count(ts) as count,
+ process_name
+FROM _oom_adj_events_with_src_bucket
+ WHERE ts > first_user_unlocked()
+GROUP BY process_name, bucket, src_bucket;
+
+DROP VIEW IF EXISTS oom_adj_events_global_by_bucket;
+CREATE PERFETTO VIEW oom_adj_events_global_by_bucket AS
+SELECT
+ src_bucket,
+ bucket,
+ count(ts) as count,
+ NULL as name
+FROM _oom_adj_events_with_src_bucket
+WHERE
+ ts > first_user_unlocked()
+GROUP BY bucket, src_bucket;
+
+DROP VIEW IF EXISTS oom_adj_events_by_oom_adj_reason;
+CREATE PERFETTO VIEW oom_adj_events_by_oom_adj_reason AS
+SELECT
+ src_bucket,
+ bucket,
+ count(ts) as count,
+ oom_adj_reason as name
+FROM _oom_adj_events_with_src_bucket
+WHERE ts > first_user_unlocked()
+GROUP BY bucket, src_bucket, oom_adj_reason;
+
DROP VIEW IF EXISTS android_boot_output;
CREATE PERFETTO VIEW android_boot_output AS
SELECT AndroidBootMetric(
@@ -59,23 +109,23 @@ SELECT AndroidBootMetric(
'total_start_sum', (SELECT SUM(total_dur) FROM android_app_process_starts),
'num_of_processes', (SELECT COUNT(*) FROM android_app_process_starts),
'average_start_time', (SELECT AVG(total_dur) FROM android_app_process_starts)))
- FROM android_app_process_starts),
+ FROM android_app_process_starts),
'post_boot_process_start_aggregation', (
SELECT NULL_IF_EMPTY(AndroidBootMetric_ProcessStartAggregation(
- 'total_start_sum', (SELECT SUM(total_dur) FROM android_app_process_starts
- WHERE proc_start_ts > (SELECT COALESCE(MIN(ts), 0)
- FROM thread_slice WHERE name GLOB "*android.intent.action.USER_UNLOCKED*"
- ORDER BY ts ASC LIMIT 1 )
- ),
- 'num_of_processes', (SELECT COUNT(*) FROM android_app_process_starts
- WHERE proc_start_ts > (SELECT COALESCE(MIN(ts), 0) FROM thread_slice
- WHERE name GLOB "*android.intent.action.USER_UNLOCKED*" ORDER BY ts
- ASC LIMIT 1 )
- ),
- 'average_start_time', (SELECT AVG(total_dur) FROM android_app_process_starts
- WHERE proc_start_ts > (SELECT COALESCE(MIN(ts), 0) FROM thread_slice
- WHERE name GLOB "*android.intent.action.USER_UNLOCKED*" ORDER BY ts
- ASC LIMIT 1 )
+ 'total_start_sum', (
+ SELECT SUM(total_dur)
+ FROM android_app_process_starts
+ WHERE proc_start_ts > first_user_unlocked()
+ ),
+ 'num_of_processes', (
+ SELECT COUNT(*)
+ FROM android_app_process_starts
+ WHERE proc_start_ts > first_user_unlocked()
+ ),
+ 'average_start_time', (
+ SELECT AVG(total_dur)
+ FROM android_app_process_starts
+ WHERE proc_start_ts > first_user_unlocked()
)
))
),
@@ -85,16 +135,23 @@ SELECT AndroidBootMetric(
),
'num_of_processes_with_gc', (SELECT COUNT(process_name) FROM android_garbage_collection_events
),
- 'num_of_threads_with_gc', (SELECT SUM(cnt) FROM (SELECT COUNT(*) AS cnt
- FROM android_garbage_collection_events
- GROUP by thread_name, process_name)
+ 'num_of_threads_with_gc', (
+ SELECT SUM(cnt) FROM (
+ SELECT COUNT(*) AS cnt
+ FROM android_garbage_collection_events
+ GROUP by thread_name, process_name
+ )
),
'avg_gc_duration', (SELECT AVG(gc_dur) FROM android_garbage_collection_events),
'avg_running_gc_duration', (SELECT AVG(gc_running_dur) FROM android_garbage_collection_events),
- 'full_gc_count', (SELECT COUNT(*) FROM android_garbage_collection_events
+ 'full_gc_count', (
+ SELECT COUNT(*)
+ FROM android_garbage_collection_events
WHERE gc_type = "full"
),
- 'collector_transition_gc_count', (SELECT COUNT(*) FROM android_garbage_collection_events
+ 'collector_transition_gc_count', (
+ SELECT COUNT(*)
+ FROM android_garbage_collection_events
WHERE gc_type = "collector_transition"
),
'young_gc_count', (SELECT COUNT(*) FROM android_garbage_collection_events
@@ -117,68 +174,153 @@ SELECT AndroidBootMetric(
'post_boot_gc_aggregation', (
SELECT NULL_IF_EMPTY(AndroidBootMetric_GarbageCollectionAggregation(
'total_gc_count', (SELECT COUNT(*) FROM android_garbage_collection_events
- WHERE gc_ts > (SELECT COALESCE(MIN(ts), 0)
- FROM thread_slice WHERE name GLOB "*android.intent.action.USER_UNLOCKED*"
- ORDER BY ts ASC LIMIT 1 )
+ WHERE gc_ts > first_user_unlocked()
),
'num_of_processes_with_gc', (SELECT COUNT(process_name) FROM android_garbage_collection_events
- WHERE gc_ts > (SELECT COALESCE(MIN(ts), 0)
- FROM thread_slice WHERE name GLOB "*android.intent.action.USER_UNLOCKED*"
- ORDER BY ts ASC LIMIT 1 )
+ WHERE gc_ts > first_user_unlocked()
),
'num_of_threads_with_gc', (SELECT SUM(cnt) FROM (SELECT COUNT(*) AS cnt
FROM android_garbage_collection_events
- WHERE gc_ts > (SELECT COALESCE(MIN(ts), 0) FROM thread_slice
- WHERE name GLOB "*android.intent.action.USER_UNLOCKED*" ORDER BY ts
- ASC LIMIT 1 )
+ WHERE gc_ts > first_user_unlocked()
GROUP by thread_name, process_name)
),
'avg_gc_duration', (SELECT AVG(gc_dur) FROM android_garbage_collection_events
- WHERE gc_ts > (SELECT COALESCE(MIN(ts), 0) FROM thread_slice
- WHERE name GLOB "*android.intent.action.USER_UNLOCKED*" ORDER BY ts
- ASC LIMIT 1 )
+ WHERE gc_ts > first_user_unlocked()
),
'avg_running_gc_duration', (SELECT AVG(gc_running_dur) FROM android_garbage_collection_events
- WHERE gc_ts > (SELECT COALESCE(MIN(ts), 0) FROM thread_slice
- WHERE name GLOB "*android.intent.action.USER_UNLOCKED*" ORDER BY ts
- ASC LIMIT 1 )
+ WHERE gc_ts > first_user_unlocked()
),
'full_gc_count', (SELECT COUNT(*) FROM android_garbage_collection_events
- WHERE gc_type = "full" AND gc_ts > (SELECT COALESCE(MIN(ts), 0)
- FROM thread_slice WHERE name GLOB "*android.intent.action.USER_UNLOCKED*"
- ORDER BY ts ASC LIMIT 1 )
+ WHERE gc_type = "full" AND gc_ts > first_user_unlocked()
),
'collector_transition_gc_count', (SELECT COUNT(*) FROM android_garbage_collection_events
- WHERE gc_type = "collector_transition" AND gc_ts > (SELECT COALESCE(MIN(ts), 0)
- FROM thread_slice WHERE name GLOB "*android.intent.action.USER_UNLOCKED*"
- ORDER BY ts ASC LIMIT 1 )
+ WHERE gc_type = "collector_transition" AND gc_ts > (
+ SELECT COALESCE(MIN(ts), 0)
+ FROM thread_slice
+ WHERE name GLOB "*android.intent.action.USER_UNLOCKED*"
+ ORDER BY ts ASC LIMIT 1
+ )
),
- 'young_gc_count', (SELECT COUNT(*) FROM android_garbage_collection_events
- WHERE gc_type = "young" AND gc_ts > (SELECT COALESCE(MIN(ts), 0)
- FROM thread_slice WHERE name GLOB "*android.intent.action.USER_UNLOCKED*"
- ORDER BY ts ASC LIMIT 1 )
+ 'young_gc_count', (
+ SELECT COUNT(*)
+ FROM android_garbage_collection_events
+ WHERE gc_type = "young" AND gc_ts > (
+ SELECT COALESCE(MIN(ts), 0)
+ FROM thread_slice
+ WHERE name GLOB "*android.intent.action.USER_UNLOCKED*"
+ ORDER BY ts ASC LIMIT 1
+ )
),
- 'native_alloc_gc_count', (SELECT COUNT(*) FROM android_garbage_collection_events
- WHERE gc_type = "native_alloc" AND gc_ts > (SELECT COALESCE(MIN(ts), 0)
- FROM thread_slice WHERE name GLOB "*android.intent.action.USER_UNLOCKED*"
- ORDER BY ts ASC LIMIT 1 )
+ 'native_alloc_gc_count', (
+ SELECT COUNT(*)
+ FROM android_garbage_collection_events
+ WHERE gc_type = "native_alloc" AND gc_ts > first_user_unlocked()
),
- 'explicit_gc_count', (SELECT COUNT(*) FROM android_garbage_collection_events
- WHERE gc_type = "explicit_gc" AND gc_ts > (SELECT COALESCE(MIN(ts), 0)
- FROM thread_slice WHERE name GLOB "*android.intent.action.USER_UNLOCKED*"
- ORDER BY ts ASC LIMIT 1 )
+ 'explicit_gc_count', (
+ SELECT COUNT(*) FROM android_garbage_collection_events
+ WHERE gc_type = "explicit_gc" AND gc_ts > (
+ SELECT COALESCE(MIN(ts), 0)
+ FROM thread_slice
+ WHERE name GLOB "*android.intent.action.USER_UNLOCKED*"
+ ORDER BY ts ASC LIMIT 1
+ )
),
- 'alloc_gc_count', (SELECT COUNT(*) FROM android_garbage_collection_events
- WHERE gc_type = "alloc_gc" AND gc_ts > (SELECT COALESCE(MIN(ts), 0)
- FROM thread_slice WHERE name GLOB "*android.intent.action.USER_UNLOCKED*"
- ORDER BY ts ASC LIMIT 1 )
+ 'alloc_gc_count', (
+ SELECT COUNT(*) FROM android_garbage_collection_events
+ WHERE gc_type = "alloc_gc" AND gc_ts > first_user_unlocked()
),
- 'mb_per_ms_of_gc', (SELECT SUM(reclaimed_mb)/SUM(gc_running_dur/1e6) AS mb_per_ms_dur
+ 'mb_per_ms_of_gc', (
+ SELECT
+ SUM(reclaimed_mb)/SUM(gc_running_dur/1e6) AS mb_per_ms_dur
FROM android_garbage_collection_events
- WHERE gc_ts > (SELECT COALESCE(MIN(ts), 0) FROM thread_slice
- WHERE name GLOB "*android.intent.action.USER_UNLOCKED*" ORDER BY ts
- ASC LIMIT 1 )
+ WHERE gc_ts > first_user_unlocked()
)
))
+ ),
+ 'post_boot_oom_adjuster_transition_counts_by_process', (
+ SELECT RepeatedField(
+ AndroidBootMetric_OomAdjusterTransitionCounts(
+ 'name', process_name,
+ 'src_bucket', src_bucket,
+ 'dest_bucket', bucket,
+ 'count', count
+ )
+ ) FROM oom_adj_events_by_process_name
+ ),
+ 'post_boot_oom_adjuster_transition_counts_global', (
+ SELECT RepeatedField(
+ AndroidBootMetric_OomAdjusterTransitionCounts(
+ 'name', name,
+ 'src_bucket', src_bucket,
+ 'dest_bucket', bucket,
+ 'count', count
+ )
+ )
+ FROM oom_adj_events_global_by_bucket
+ ),
+ 'post_boot_oom_adjuster_transition_counts_by_oom_adj_reason',(
+ SELECT RepeatedField(
+ AndroidBootMetric_OomAdjusterTransitionCounts(
+ 'name', name,
+ 'src_bucket', src_bucket,
+ 'dest_bucket', bucket,
+ 'count', count
+ )
+ )
+ FROM oom_adj_events_by_oom_adj_reason
+ ),
+ 'post_boot_oom_adj_bucket_duration_agg_global',(SELECT RepeatedField(
+ AndroidBootMetric_OomAdjBucketDurationAggregation(
+ 'name', name,
+ 'bucket', bucket,
+ 'total_dur', total_dur
+ ))
+ FROM (
+ SELECT
+ NULL as name,
+ bucket,
+ SUM(dur) as total_dur
+ FROM android_oom_adj_intervals
+ WHERE ts > first_user_unlocked()
+ GROUP BY bucket)
+ ),
+ 'post_boot_oom_adj_bucket_duration_agg_by_process',(SELECT RepeatedField(
+ AndroidBootMetric_OomAdjBucketDurationAggregation(
+ 'name', name,
+ 'bucket', bucket,
+ 'total_dur', total_dur
+ )
+ )
+ FROM (
+ SELECT
+ process_name as name,
+ bucket,
+ SUM(dur) as total_dur
+ FROM android_oom_adj_intervals
+ WHERE ts > first_user_unlocked()
+ AND process_name IS NOT NULL
+ GROUP BY process_name, bucket)
+ ),
+ 'post_boot_oom_adj_duration_agg',
+ (SELECT RepeatedField(
+ AndroidBootMetric_OomAdjDurationAggregation(
+ 'min_oom_adj_dur', min_oom_adj_dur,
+ 'max_oom_adj_dur', max_oom_adj_dur,
+ 'avg_oom_adj_dur', avg_oom_adj_dur,
+ 'oom_adj_event_count', oom_adj_event_count,
+ 'oom_adj_reason', oom_adj_reason
+ )
+ )
+ FROM (
+ SELECT
+ MIN(oom_adj_dur) as min_oom_adj_dur,
+ MAX(oom_adj_dur) as max_oom_adj_dur,
+ AVG(oom_adj_dur) as avg_oom_adj_dur,
+ COUNT(DISTINCT(oom_adj_id)) oom_adj_event_count,
+ oom_adj_reason
+ FROM android_oom_adj_intervals
+ WHERE ts > first_user_unlocked()
+ GROUP BY oom_adj_reason
)
+ )
);
diff --git a/src/trace_processor/metrics/sql/android/android_oom_adjuster.sql b/src/trace_processor/metrics/sql/android/android_oom_adjuster.sql
new file mode 100644
index 000000000..7b752a89d
--- /dev/null
+++ b/src/trace_processor/metrics/sql/android/android_oom_adjuster.sql
@@ -0,0 +1,139 @@
+--
+-- Copyright 2024 The Android Open Source Project
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- https://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+INCLUDE PERFETTO MODULE android.oom_adjuster;
+
+DROP TABLE IF EXISTS _oom_adj_events_with_src_bucket;
+CREATE PERFETTO TABLE _oom_adj_events_with_src_bucket
+AS
+SELECT
+ LAG(bucket) OVER (PARTITION BY upid ORDER BY ts) AS src_bucket,
+ ts,
+ bucket,
+ process_name,
+ oom_adj_reason
+FROM android_oom_adj_intervals;
+
+DROP VIEW IF EXISTS oom_adj_events_by_process_name;
+CREATE PERFETTO VIEW oom_adj_events_by_process_name AS
+SELECT
+ src_bucket,
+ bucket,
+ count(ts) as count,
+ process_name
+FROM _oom_adj_events_with_src_bucket
+GROUP BY process_name, bucket, src_bucket;
+
+DROP VIEW IF EXISTS oom_adj_events_global_by_bucket;
+CREATE PERFETTO VIEW oom_adj_events_global_by_bucket AS
+SELECT
+ src_bucket,
+ bucket,
+ count(ts) as count,
+ NULL as name
+FROM _oom_adj_events_with_src_bucket
+GROUP BY bucket, src_bucket;
+
+DROP VIEW IF EXISTS oom_adj_events_by_oom_adj_reason;
+CREATE PERFETTO VIEW oom_adj_events_by_oom_adj_reason AS
+SELECT
+ src_bucket,
+ bucket,
+ count(ts) as count,
+ oom_adj_reason as name
+FROM _oom_adj_events_with_src_bucket
+GROUP BY bucket, src_bucket, oom_adj_reason;
+
+DROP VIEW IF EXISTS android_oom_adjuster_output;
+CREATE PERFETTO VIEW android_oom_adjuster_output AS
+SELECT AndroidOomAdjusterMetric(
+ 'oom_adjuster_transition_counts_by_process', (
+ SELECT RepeatedField(
+ AndroidOomAdjusterMetric_OomAdjusterTransitionCounts(
+ 'name', process_name,
+ 'src_bucket', src_bucket,
+ 'dest_bucket', bucket,
+ 'count', count
+ )
+ ) FROM oom_adj_events_by_process_name
+ ),
+ 'oom_adjuster_transition_counts_global', (
+ SELECT RepeatedField(
+ AndroidOomAdjusterMetric_OomAdjusterTransitionCounts(
+ 'name', name,
+ 'src_bucket', src_bucket,
+ 'dest_bucket', bucket,
+ 'count', count
+ )
+ )
+ FROM oom_adj_events_global_by_bucket
+ ),
+ 'oom_adjuster_transition_counts_by_oom_adj_reason',(
+ SELECT RepeatedField(
+ AndroidOomAdjusterMetric_OomAdjusterTransitionCounts(
+ 'name', name,
+ 'src_bucket', src_bucket,
+ 'dest_bucket', bucket,
+ 'count', count
+ )
+ )
+ FROM oom_adj_events_by_oom_adj_reason
+ ),
+ 'oom_adj_bucket_duration_agg_global',(SELECT RepeatedField(
+ AndroidOomAdjusterMetric_OomAdjBucketDurationAggregation(
+ 'name', name,
+ 'bucket', bucket,
+ 'total_dur', total_dur
+ )
+ )
+ FROM (
+ SELECT NULL as name, bucket, SUM(dur) as total_dur
+ FROM android_oom_adj_intervals GROUP BY bucket
+ )
+ ),
+ 'oom_adj_bucket_duration_agg_by_process',(SELECT RepeatedField(
+ AndroidOomAdjusterMetric_OomAdjBucketDurationAggregation(
+ 'name', name,
+ 'bucket', bucket,
+ 'total_dur', total_dur
+ )
+ )
+ FROM (
+ SELECT process_name as name, bucket, SUM(dur) as total_dur
+ FROM android_oom_adj_intervals
+ WHERE process_name IS NOT NULL
+ GROUP BY process_name, bucket
+ )
+ ),
+ 'oom_adj_duration_agg', (SELECT RepeatedField(
+ AndroidOomAdjusterMetric_OomAdjDurationAggregation(
+ 'min_oom_adj_dur', min_oom_adj_dur,
+ 'max_oom_adj_dur', max_oom_adj_dur,
+ 'avg_oom_adj_dur', avg_oom_adj_dur,
+ 'oom_adj_event_count', oom_adj_event_count,
+ 'oom_adj_reason', oom_adj_reason
+ )
+ )
+ FROM (
+ SELECT
+ MIN(oom_adj_dur) as min_oom_adj_dur,
+ MAX(oom_adj_dur) as max_oom_adj_dur,
+ AVG(oom_adj_dur) as avg_oom_adj_dur,
+ COUNT(DISTINCT(oom_adj_id)) oom_adj_event_count,
+ oom_adj_reason
+ FROM android_oom_adj_intervals GROUP BY oom_adj_reason
+ )
+ )
+);
diff --git a/src/trace_processor/perfetto_sql/intrinsics/operators/BUILD.gn b/src/trace_processor/perfetto_sql/intrinsics/operators/BUILD.gn
index bbcb771fb..2dca8b627 100644
--- a/src/trace_processor/perfetto_sql/intrinsics/operators/BUILD.gn
+++ b/src/trace_processor/perfetto_sql/intrinsics/operators/BUILD.gn
@@ -18,6 +18,8 @@ assert(enable_perfetto_trace_processor_sqlite)
source_set("operators") {
sources = [
+ "counter_mipmap_operator.cc",
+ "counter_mipmap_operator.h",
"span_join_operator.cc",
"span_join_operator.h",
"window_operator.cc",
@@ -30,6 +32,7 @@ source_set("operators") {
"../../../../../include/perfetto/trace_processor",
"../../../../../protos/perfetto/trace_processor:zero",
"../../../../base",
+ "../../../containers",
"../../../sqlite",
"../../../util",
"../../engine",
diff --git a/src/trace_processor/perfetto_sql/intrinsics/operators/counter_mipmap_operator.cc b/src/trace_processor/perfetto_sql/intrinsics/operators/counter_mipmap_operator.cc
new file mode 100644
index 000000000..83321ce05
--- /dev/null
+++ b/src/trace_processor/perfetto_sql/intrinsics/operators/counter_mipmap_operator.cc
@@ -0,0 +1,265 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "src/trace_processor/perfetto_sql/intrinsics/operators/counter_mipmap_operator.h"
+
+#include <sqlite3.h>
+#include <algorithm>
+#include <cstddef>
+#include <cstdint>
+#include <functional>
+#include <iterator>
+#include <memory>
+#include <string>
+#include <utility>
+
+#include "perfetto/base/logging.h"
+#include "perfetto/base/status.h"
+#include "perfetto/ext/base/status_or.h"
+#include "src/trace_processor/containers/implicit_segment_forest.h"
+#include "src/trace_processor/sqlite/bindings/sqlite_result.h"
+#include "src/trace_processor/sqlite/module_lifecycle_manager.h"
+#include "src/trace_processor/sqlite/sql_source.h"
+#include "src/trace_processor/sqlite/sqlite_utils.h"
+
+namespace perfetto::trace_processor {
+namespace {
+
+constexpr char kSchema[] = R"(
+ CREATE TABLE x(
+ in_window_start BIGINT HIDDEN,
+ in_window_end BIGINT HIDDEN,
+ in_window_step BIGINT HIDDEN,
+ min_value DOUBLE,
+ max_value DOUBLE,
+ last_ts BIGINT,
+ last_value DOUBLE,
+ PRIMARY KEY(last_ts)
+ ) WITHOUT ROWID
+)";
+
+enum ColumnIndex : size_t {
+ kInWindowStart = 0,
+ kInWindowEnd,
+ kInWindowStep,
+
+ kMinValue,
+ kMaxValue,
+ kLastTs,
+ kLastValue,
+};
+
+constexpr size_t kArgCount = kInWindowStep + 1;
+
+bool IsArgColumn(size_t index) {
+ return index < kArgCount;
+}
+
+using Counter = CounterMipmapOperator::Counter;
+using Agg = CounterMipmapOperator::Agg;
+using Forest = ImplicitSegmentForest<Counter, Agg>;
+
+} // namespace
+
+int CounterMipmapOperator::Create(sqlite3* db,
+ void* raw_ctx,
+ int argc,
+ const char* const* argv,
+ sqlite3_vtab** vtab,
+ char** zErr) {
+ if (argc != 4) {
+ *zErr = sqlite3_mprintf("counter_mipmap: wrong number of arguments");
+ return SQLITE_ERROR;
+ }
+
+ if (int ret = sqlite3_declare_vtab(db, kSchema); ret != SQLITE_OK) {
+ return ret;
+ }
+
+ auto* ctx = GetContext(raw_ctx);
+ auto state = std::make_unique<State>();
+
+ std::string sql = "SELECT ts, value FROM ";
+ sql.append(argv[3]);
+ auto res = ctx->engine->ExecuteUntilLastStatement(
+ SqlSource::FromTraceProcessorImplementation(std::move(sql)));
+ if (!res.ok()) {
+ *zErr = sqlite3_mprintf("%s", res.status().c_message());
+ return SQLITE_ERROR;
+ }
+ do {
+ int64_t ts = sqlite3_column_int64(res->stmt.sqlite_stmt(), 0);
+ auto value =
+ static_cast<float>(sqlite3_column_double(res->stmt.sqlite_stmt(), 1));
+ state->timestamps.push_back(ts);
+ state->forest.Push(Counter{value, value});
+ } while (res->stmt.Step());
+ if (!res->stmt.status().ok()) {
+ *zErr = sqlite3_mprintf("%s", res->stmt.status().c_message());
+ return SQLITE_ERROR;
+ }
+
+ std::unique_ptr<Vtab> vtab_res = std::make_unique<Vtab>();
+ vtab_res->state = ctx->manager.OnCreate(argv, std::move(state));
+ *vtab = vtab_res.release();
+ return SQLITE_OK;
+}
+
+int CounterMipmapOperator::Destroy(sqlite3_vtab* vtab) {
+ std::unique_ptr<Vtab> tab(GetVtab(vtab));
+ sqlite::ModuleStateManager<CounterMipmapOperator>::OnDestroy(tab->state);
+ return SQLITE_OK;
+}
+
+int CounterMipmapOperator::Connect(sqlite3* db,
+ void* raw_ctx,
+ int argc,
+ const char* const* argv,
+ sqlite3_vtab** vtab,
+ char**) {
+ PERFETTO_CHECK(argc == 4);
+ if (int ret = sqlite3_declare_vtab(db, kSchema); ret != SQLITE_OK) {
+ return ret;
+ }
+ auto* ctx = GetContext(raw_ctx);
+ std::unique_ptr<Vtab> res = std::make_unique<Vtab>();
+ res->state = ctx->manager.OnConnect(argv);
+ *vtab = res.release();
+ return SQLITE_OK;
+}
+
+int CounterMipmapOperator::Disconnect(sqlite3_vtab* vtab) {
+ std::unique_ptr<Vtab> tab(GetVtab(vtab));
+ sqlite::ModuleStateManager<CounterMipmapOperator>::OnDisconnect(tab->state);
+ return SQLITE_OK;
+}
+
+int CounterMipmapOperator::BestIndex(sqlite3_vtab*, sqlite3_index_info* info) {
+ base::Status status =
+ sqlite::utils::ValidateFunctionArguments(info, kArgCount, IsArgColumn);
+ if (!status.ok()) {
+ return SQLITE_CONSTRAINT;
+ }
+ if (info->nConstraint != kArgCount) {
+ return SQLITE_CONSTRAINT;
+ }
+ return SQLITE_OK;
+}
+
+int CounterMipmapOperator::Open(sqlite3_vtab*, sqlite3_vtab_cursor** cursor) {
+ std::unique_ptr<Cursor> c = std::make_unique<Cursor>();
+ *cursor = c.release();
+ return SQLITE_OK;
+}
+
+int CounterMipmapOperator::Close(sqlite3_vtab_cursor* cursor) {
+ std::unique_ptr<Cursor> c(GetCursor(cursor));
+ return SQLITE_OK;
+}
+
+int CounterMipmapOperator::Filter(sqlite3_vtab_cursor* cursor,
+ int,
+ const char*,
+ int argc,
+ sqlite3_value** argv) {
+ auto* c = GetCursor(cursor);
+ auto* t = GetVtab(c->pVtab);
+ auto* state =
+ sqlite::ModuleStateManager<CounterMipmapOperator>::GetState(t->state);
+ PERFETTO_CHECK(argc == kArgCount);
+
+ int64_t start_ts = sqlite3_value_int64(argv[0]);
+ int64_t end_ts = sqlite3_value_int64(argv[1]);
+ int64_t step_ts = sqlite3_value_int64(argv[2]);
+ if (start_ts == end_ts) {
+ return sqlite::utils::SetError(t, "counter_mipmap: empty range provided");
+ }
+
+ c->index = 0;
+ c->counters.clear();
+
+ // If there is a counter value before the start of this window, include it in
+ // the aggregation as well becaue it contributes to what should be rendered
+ // here.
+ auto ts_lb = std::lower_bound(state->timestamps.begin(),
+ state->timestamps.end(), start_ts);
+ if (ts_lb != state->timestamps.begin() &&
+ (ts_lb == state->timestamps.end() || *ts_lb != start_ts)) {
+ --ts_lb;
+ }
+ int64_t start_idx = std::distance(state->timestamps.begin(), ts_lb);
+ for (int64_t s = start_ts; s < end_ts; s += step_ts) {
+ int64_t end_idx =
+ std::distance(state->timestamps.begin(),
+ std::lower_bound(state->timestamps.begin() +
+ static_cast<int64_t>(start_idx),
+ state->timestamps.end(), s + step_ts));
+ if (start_idx == end_idx) {
+ continue;
+ }
+ c->counters.emplace_back(Cursor::Result{
+ state->forest.Query(static_cast<uint32_t>(start_idx),
+ static_cast<uint32_t>(end_idx)),
+ state->forest[static_cast<uint32_t>(end_idx) - 1],
+ state->timestamps[static_cast<uint32_t>(end_idx) - 1],
+ });
+ start_idx = end_idx;
+ }
+ return SQLITE_OK;
+}
+
+int CounterMipmapOperator::Next(sqlite3_vtab_cursor* cursor) {
+ GetCursor(cursor)->index++;
+ return SQLITE_OK;
+}
+
+int CounterMipmapOperator::Eof(sqlite3_vtab_cursor* cursor) {
+ auto* c = GetCursor(cursor);
+ return c->index >= c->counters.size();
+}
+
+int CounterMipmapOperator::Column(sqlite3_vtab_cursor* cursor,
+ sqlite3_context* ctx,
+ int N) {
+ auto* t = GetVtab(cursor->pVtab);
+ auto* c = GetCursor(cursor);
+ const auto& res = c->counters[c->index];
+ switch (N) {
+ case ColumnIndex::kMinValue:
+ sqlite::result::Double(ctx, static_cast<double>(res.min_max_counter.min));
+ return SQLITE_OK;
+ case ColumnIndex::kMaxValue:
+ sqlite::result::Double(ctx, static_cast<double>(res.min_max_counter.max));
+ return SQLITE_OK;
+ case ColumnIndex::kLastTs:
+ sqlite::result::Long(ctx, res.last_ts);
+ return SQLITE_OK;
+ case ColumnIndex::kLastValue:
+ PERFETTO_DCHECK(
+ std::equal_to<>()(res.last_counter.min, res.last_counter.max));
+ sqlite::result::Double(ctx, static_cast<double>(res.last_counter.min));
+ return SQLITE_OK;
+ default:
+ return sqlite::utils::SetError(t, "Bad column");
+ }
+ PERFETTO_FATAL("For GCC");
+}
+
+int CounterMipmapOperator::Rowid(sqlite3_vtab_cursor*, sqlite_int64*) {
+ return SQLITE_ERROR;
+}
+
+} // namespace perfetto::trace_processor
diff --git a/src/trace_processor/perfetto_sql/intrinsics/operators/counter_mipmap_operator.h b/src/trace_processor/perfetto_sql/intrinsics/operators/counter_mipmap_operator.h
new file mode 100644
index 000000000..1b0897cc0
--- /dev/null
+++ b/src/trace_processor/perfetto_sql/intrinsics/operators/counter_mipmap_operator.h
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SRC_TRACE_PROCESSOR_PERFETTO_SQL_INTRINSICS_OPERATORS_COUNTER_MIPMAP_OPERATOR_H_
+#define SRC_TRACE_PROCESSOR_PERFETTO_SQL_INTRINSICS_OPERATORS_COUNTER_MIPMAP_OPERATOR_H_
+
+#include <sqlite3.h>
+#include <cstdint>
+#include <vector>
+
+#include "src/trace_processor/containers/implicit_segment_forest.h"
+#include "src/trace_processor/perfetto_sql/engine/perfetto_sql_engine.h"
+#include "src/trace_processor/sqlite/bindings/sqlite_module.h"
+#include "src/trace_processor/sqlite/module_lifecycle_manager.h"
+
+namespace perfetto::trace_processor {
+
+// Operator for building "mipmaps" [1] over the counter-like tracks.
+//
+// In the context of trace data, mipmap really means aggregating the counter
+// values in a given time period into the {min, max, last} value for that
+// period, allowing UIs to efficiently display the contents of a counter track
+// when very zoomed out.
+//
+// Specifically, we are computing the query:
+// ```
+// select
+// last_value(ts),
+// min(value),
+// max(value),
+// last_value(value)
+// from $input in
+// where in.ts_end >= $window_start and in.ts <= $window_end
+// group by ts / $window_resolution
+// order by ts
+// ```
+// but in O(logn) time by using a segment-tree like data structure (see
+// ImplicitSegmentForest).
+//
+// [1] https://en.wikipedia.org/wiki/Mipmap
+struct CounterMipmapOperator : sqlite::Module<CounterMipmapOperator> {
+ struct Counter {
+ float min;
+ float max;
+ };
+ struct Agg {
+ Counter operator()(const Counter& a, const Counter& b) {
+ Counter res;
+ res.min = b.min < a.min ? b.min : a.min;
+ res.max = b.max > a.max ? b.max : a.max;
+ return res;
+ }
+ };
+ struct State {
+ ImplicitSegmentForest<Counter, Agg> forest;
+ std::vector<int64_t> timestamps;
+ };
+ struct Context {
+ explicit Context(PerfettoSqlEngine* _engine) : engine(_engine) {}
+ PerfettoSqlEngine* engine;
+ sqlite::ModuleStateManager<CounterMipmapOperator> manager;
+ };
+ struct Vtab : sqlite::Module<CounterMipmapOperator>::Vtab {
+ sqlite::ModuleStateManager<CounterMipmapOperator>::PerVtabState* state;
+ };
+ struct Cursor : sqlite::Module<CounterMipmapOperator>::Cursor {
+ struct Result {
+ Counter min_max_counter;
+ Counter last_counter;
+ int64_t last_ts;
+ };
+ std::vector<Result> counters;
+ uint32_t index;
+ };
+
+ static constexpr auto kType = kCreateOnly;
+ static constexpr bool kSupportsWrites = false;
+ static constexpr bool kDoesOverloadFunctions = false;
+
+ static int Create(sqlite3*,
+ void*,
+ int,
+ const char* const*,
+ sqlite3_vtab**,
+ char**);
+ static int Destroy(sqlite3_vtab*);
+
+ static int Connect(sqlite3*,
+ void*,
+ int,
+ const char* const*,
+ sqlite3_vtab**,
+ char**);
+ static int Disconnect(sqlite3_vtab*);
+
+ static int BestIndex(sqlite3_vtab*, sqlite3_index_info*);
+
+ static int Open(sqlite3_vtab*, sqlite3_vtab_cursor**);
+ static int Close(sqlite3_vtab_cursor*);
+
+ static int Filter(sqlite3_vtab_cursor*,
+ int,
+ const char*,
+ int,
+ sqlite3_value**);
+ static int Next(sqlite3_vtab_cursor*);
+ static int Eof(sqlite3_vtab_cursor*);
+ static int Column(sqlite3_vtab_cursor*, sqlite3_context*, int);
+ static int Rowid(sqlite3_vtab_cursor*, sqlite_int64*);
+};
+
+} // namespace perfetto::trace_processor
+
+#endif // SRC_TRACE_PROCESSOR_PERFETTO_SQL_INTRINSICS_OPERATORS_COUNTER_MIPMAP_OPERATOR_H_
diff --git a/src/trace_processor/trace_processor_impl.cc b/src/trace_processor/trace_processor_impl.cc
index b36a63a81..2deba7ac7 100644
--- a/src/trace_processor/trace_processor_impl.cc
+++ b/src/trace_processor/trace_processor_impl.cc
@@ -81,6 +81,7 @@
#include "src/trace_processor/perfetto_sql/intrinsics/functions/to_ftrace.h"
#include "src/trace_processor/perfetto_sql/intrinsics/functions/utils.h"
#include "src/trace_processor/perfetto_sql/intrinsics/functions/window_functions.h"
+#include "src/trace_processor/perfetto_sql/intrinsics/operators/counter_mipmap_operator.h"
#include "src/trace_processor/perfetto_sql/intrinsics/operators/span_join_operator.h"
#include "src/trace_processor/perfetto_sql/intrinsics/operators/window_operator.h"
#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/ancestor.h"
@@ -747,6 +748,9 @@ void TraceProcessorImpl::InitPerfettoSqlEngine() {
std::make_unique<SpanJoinOperatorModule::Context>(engine_.get()));
engine_->sqlite_engine()->RegisterVirtualTableModule<WindowOperatorModule>(
"window", std::make_unique<WindowOperatorModule::Context>());
+ engine_->sqlite_engine()->RegisterVirtualTableModule<CounterMipmapOperator>(
+ "__intrinsic_counter_mipmap",
+ std::make_unique<CounterMipmapOperator::Context>(engine_.get()));
// Initalize the tables and views in the prelude.
InitializePreludeTablesViews(db);
diff --git a/test/trace_processor/diff_tests/metrics/android/android_boot.out b/test/trace_processor/diff_tests/metrics/android/android_boot.out
index 3bf13cce9..50f4757df 100644
--- a/test/trace_processor/diff_tests/metrics/android/android_boot.out
+++ b/test/trace_processor/diff_tests/metrics/android/android_boot.out
@@ -1,59 +1,915 @@
android_boot {
- system_server_durations {
- total_dur: 90219646678
- uninterruptible_sleep_dur: 618417159
- }
- systemui_durations {
- total_dur: 48481027953
- uninterruptible_sleep_dur: 796263
- }
- launcher_durations {
- total_dur: 23595248987
- uninterruptible_sleep_dur: 257290255
- }
- gms_durations {
- total_dur: 27804143410
- uninterruptible_sleep_dur: 101685087
- }
- launcher_breakdown {
- cold_start_dur: 403543498
- }
- full_trace_process_start_aggregation {
- total_start_sum: 10678297679
- num_of_processes: 29
- average_start_time: 368217161.3448276
- }
- post_boot_process_start_aggregation {
- total_start_sum: 6112984648
- num_of_processes: 21
- average_start_time: 291094507.04761904
- }
- full_trace_gc_aggregation {
- total_gc_count: 4
- num_of_processes_with_gc: 4
- num_of_threads_with_gc: 4
- avg_gc_duration: 260516077.75
- avg_running_gc_duration: 3902628.5
- full_gc_count: 4
- collector_transition_gc_count: 0
- young_gc_count: 0
- native_alloc_gc_count: 0
- explicit_gc_count: 0
- alloc_gc_count: 0
- mb_per_ms_of_gc: 0.8829305684617432
- }
- post_boot_gc_aggregation {
- total_gc_count: 4
- num_of_processes_with_gc: 4
- num_of_threads_with_gc: 4
- avg_gc_duration: 260516077.75
- avg_running_gc_duration: 3902628.5
- full_gc_count: 4
- collector_transition_gc_count: 0
- young_gc_count: 0
- native_alloc_gc_count: 0
- explicit_gc_count: 0
- alloc_gc_count: 0
- mb_per_ms_of_gc: 0.8829305684617432
- }
-} \ No newline at end of file
+system_server_durations {
+total_dur: 90219646678
+uninterruptible_sleep_dur: 618417159
+}
+systemui_durations {
+total_dur: 48481027953
+uninterruptible_sleep_dur: 796263
+}
+launcher_durations {
+total_dur: 23595248987
+uninterruptible_sleep_dur: 257290255
+}
+gms_durations {
+total_dur: 27804143410
+uninterruptible_sleep_dur: 101685087
+}
+launcher_breakdown {
+cold_start_dur: 403543498
+}
+full_trace_process_start_aggregation {
+total_start_sum: 10678297679
+num_of_processes: 29
+average_start_time: 368217161.3448276
+}
+post_boot_process_start_aggregation {
+total_start_sum: 6112984648
+num_of_processes: 21
+average_start_time: 291094507.04761904
+}
+full_trace_gc_aggregation {
+total_gc_count: 4
+num_of_processes_with_gc: 4
+num_of_threads_with_gc: 4
+avg_gc_duration: 260516077.75
+avg_running_gc_duration: 3902628.5
+full_gc_count: 4
+collector_transition_gc_count: 0
+young_gc_count: 0
+native_alloc_gc_count: 0
+explicit_gc_count: 0
+alloc_gc_count: 0
+mb_per_ms_of_gc: 0.8829305684617432
+}
+post_boot_gc_aggregation {
+total_gc_count: 4
+num_of_processes_with_gc: 4
+num_of_threads_with_gc: 4
+avg_gc_duration: 260516077.75
+avg_running_gc_duration: 3902628.5
+full_gc_count: 4
+collector_transition_gc_count: 0
+young_gc_count: 0
+native_alloc_gc_count: 0
+explicit_gc_count: 0
+alloc_gc_count: 0
+mb_per_ms_of_gc: 0.8829305684617432
+}
+post_boot_oom_adjuster_transition_counts_global {
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 16
+}
+post_boot_oom_adjuster_transition_counts_global {
+src_bucket: "foreground_app"
+dest_bucket: "cached_app"
+count: 3
+}
+post_boot_oom_adjuster_transition_counts_global {
+src_bucket: "previous_app"
+dest_bucket: "cached_app"
+count: 2
+}
+post_boot_oom_adjuster_transition_counts_global {
+dest_bucket: "foreground_app"
+count: 21
+}
+post_boot_oom_adjuster_transition_counts_global {
+src_bucket: "cached_app"
+dest_bucket: "foreground_app"
+count: 4
+}
+post_boot_oom_adjuster_transition_counts_global {
+src_bucket: "perceptible_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_global {
+src_bucket: "perceptible_low_app"
+dest_bucket: "foreground_app"
+count: 2
+}
+post_boot_oom_adjuster_transition_counts_global {
+src_bucket: "previous_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_global {
+src_bucket: "visible_app"
+dest_bucket: "foreground_app"
+count: 3
+}
+post_boot_oom_adjuster_transition_counts_global {
+dest_bucket: "native"
+count: 4
+}
+post_boot_oom_adjuster_transition_counts_global {
+src_bucket: "foreground_app"
+dest_bucket: "perceptible_app"
+count: 2
+}
+post_boot_oom_adjuster_transition_counts_global {
+src_bucket: "foreground_app"
+dest_bucket: "perceptible_low_app"
+count: 3
+}
+post_boot_oom_adjuster_transition_counts_global {
+src_bucket: "foreground_app"
+dest_bucket: "persistent_service"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_global {
+src_bucket: "foreground_app"
+dest_bucket: "visible_app"
+count: 4
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "/system/bin/apexd"
+dest_bucket: "native"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "<pre-initialized>"
+dest_bucket: "native"
+count: 2
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "android.process.acore"
+src_bucket: "previous_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.amazon.mp3"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.android.keychain"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.android.printspooler"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.android.providers.calendar"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.android.settings"
+src_bucket: "foreground_app"
+dest_bucket: "cached_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.apple.android.music"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.blinkslabs.blinkist.android"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.books"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.dreamliner"
+src_bucket: "foreground_app"
+dest_bucket: "cached_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.dreamliner"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.dreamliner"
+src_bucket: "perceptible_low_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.dreamliner"
+src_bucket: "foreground_app"
+dest_bucket: "perceptible_low_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.messaging"
+dest_bucket: "native"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.messaging:rcs"
+src_bucket: "perceptible_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.messaging:rcs"
+src_bucket: "foreground_app"
+dest_bucket: "perceptible_app"
+count: 2
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.nexuslauncher"
+src_bucket: "visible_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.wallpaper"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.wellbeing"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 5
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.wellbeing"
+src_bucket: "cached_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.work.clouddpc"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 2
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.youtube.music"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.as.oss"
+src_bucket: "foreground_app"
+dest_bucket: "cached_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.as.oss"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.as.oss"
+src_bucket: "perceptible_low_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.as.oss"
+src_bucket: "foreground_app"
+dest_bucket: "perceptible_low_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.calendar"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.carrier"
+src_bucket: "previous_app"
+dest_bucket: "cached_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.cellbroadcastreceiver"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.deskclock"
+src_bucket: "cached_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.devicelockcontroller"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.devicelockcontroller"
+src_bucket: "cached_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.devicelockcontroller"
+src_bucket: "visible_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.devicelockcontroller"
+src_bucket: "foreground_app"
+dest_bucket: "visible_app"
+count: 2
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.dialer"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 4
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.gms"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 2
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.gms"
+src_bucket: "cached_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.gms"
+src_bucket: "visible_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.gms"
+src_bucket: "foreground_app"
+dest_bucket: "visible_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.googlequicksearchbox:interactor"
+src_bucket: "foreground_app"
+dest_bucket: "visible_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.googlequicksearchbox:search"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.keep"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.permissioncontroller"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.providers.media.module"
+src_bucket: "foreground_app"
+dest_bucket: "persistent_service"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.android.youtube"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.ar.core"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.ar.core"
+src_bucket: "foreground_app"
+dest_bucket: "perceptible_low_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.google.euiccpixel"
+src_bucket: "previous_app"
+dest_bucket: "cached_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.overdrive.mobile.android.libby"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.patreon.android"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "com.spotify.music"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "org.thoughtcrime.securesms"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_process {
+name: "org.videolan.vlc"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "activityChange"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 3
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "bindService"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 5
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "getProvider"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "startReceiver"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 7
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "activityChange"
+src_bucket: "foreground_app"
+dest_bucket: "cached_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "executingService"
+src_bucket: "foreground_app"
+dest_bucket: "cached_app"
+count: 2
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "activityChange"
+src_bucket: "previous_app"
+dest_bucket: "cached_app"
+count: 2
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "processBegin"
+dest_bucket: "foreground_app"
+count: 21
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "getProvider"
+src_bucket: "cached_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "startReceiver"
+src_bucket: "cached_app"
+dest_bucket: "foreground_app"
+count: 2
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "startService"
+src_bucket: "cached_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "startService"
+src_bucket: "perceptible_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "unbindService"
+src_bucket: "perceptible_low_app"
+dest_bucket: "foreground_app"
+count: 2
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "getProvider"
+src_bucket: "previous_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "bindService"
+src_bucket: "visible_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "getProvider"
+src_bucket: "visible_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "startService"
+src_bucket: "visible_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "executingService"
+dest_bucket: "native"
+count: 4
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "executingService"
+src_bucket: "foreground_app"
+dest_bucket: "perceptible_app"
+count: 2
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "executingService"
+src_bucket: "foreground_app"
+dest_bucket: "perceptible_low_app"
+count: 3
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "startService"
+src_bucket: "foreground_app"
+dest_bucket: "persistent_service"
+count: 1
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "executingService"
+src_bucket: "foreground_app"
+dest_bucket: "visible_app"
+count: 3
+}
+post_boot_oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "finishReceiver"
+src_bucket: "foreground_app"
+dest_bucket: "visible_app"
+count: 1
+}
+post_boot_oom_adj_bucket_duration_agg_global {
+bucket: "cached_app"
+total_dur: 10419196404
+}
+post_boot_oom_adj_bucket_duration_agg_global {
+bucket: "foreground_app"
+total_dur: 23641055480
+}
+post_boot_oom_adj_bucket_duration_agg_global {
+bucket: "native"
+total_dur: 101590616
+}
+post_boot_oom_adj_bucket_duration_agg_global {
+bucket: "perceptible_app"
+total_dur: 940071238
+}
+post_boot_oom_adj_bucket_duration_agg_global {
+bucket: "perceptible_low_app"
+total_dur: 199288116
+}
+post_boot_oom_adj_bucket_duration_agg_global {
+bucket: "persistent_service"
+total_dur: 1546461864
+}
+post_boot_oom_adj_bucket_duration_agg_global {
+bucket: "visible_app"
+total_dur: 2769744731
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/apexd"
+bucket: "native"
+total_dur: 25397654
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "<pre-initialized>"
+bucket: "native"
+total_dur: 50795308
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "android.process.acore"
+bucket: "foreground_app"
+total_dur: 823432282
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.amazon.mp3"
+bucket: "foreground_app"
+total_dur: 1322230378
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.android.keychain"
+bucket: "foreground_app"
+total_dur: 196867340
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.android.printspooler"
+bucket: "foreground_app"
+total_dur: 343904124
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.android.providers.calendar"
+bucket: "foreground_app"
+total_dur: 281386139
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.android.settings"
+bucket: "cached_app"
+total_dur: 967052521
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.apple.android.music"
+bucket: "foreground_app"
+total_dur: 1268519522
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.blinkslabs.blinkist.android"
+bucket: "foreground_app"
+total_dur: 1250421540
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.books"
+bucket: "foreground_app"
+total_dur: 1076963328
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.dreamliner"
+bucket: "cached_app"
+total_dur: 1086183503
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.dreamliner"
+bucket: "foreground_app"
+total_dur: 402609904
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.dreamliner"
+bucket: "perceptible_low_app"
+total_dur: 7658935
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.messaging"
+bucket: "native"
+total_dur: 25397654
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.messaging:rcs"
+bucket: "foreground_app"
+total_dur: 109047811
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.messaging:rcs"
+bucket: "perceptible_app"
+total_dur: 940071238
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.nexuslauncher"
+bucket: "foreground_app"
+total_dur: 1661132477
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.wallpaper"
+bucket: "foreground_app"
+total_dur: 177919993
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.wellbeing"
+bucket: "cached_app"
+total_dur: 816703328
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.wellbeing"
+bucket: "foreground_app"
+total_dur: 884970246
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.work.clouddpc"
+bucket: "cached_app"
+total_dur: 1695452790
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.youtube.music"
+bucket: "foreground_app"
+total_dur: 1558635529
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.as.oss"
+bucket: "cached_app"
+total_dur: 621111806
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.as.oss"
+bucket: "foreground_app"
+total_dur: 303909018
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.as.oss"
+bucket: "perceptible_low_app"
+total_dur: 9431030
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.calendar"
+bucket: "foreground_app"
+total_dur: 1573637523
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.carrier"
+bucket: "cached_app"
+total_dur: 870239329
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.cellbroadcastreceiver"
+bucket: "cached_app"
+total_dur: 870311514
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.deskclock"
+bucket: "foreground_app"
+total_dur: 1674669994
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.devicelockcontroller"
+bucket: "cached_app"
+total_dur: 11603068
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.devicelockcontroller"
+bucket: "foreground_app"
+total_dur: 115664632
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.devicelockcontroller"
+bucket: "visible_app"
+total_dur: 1568444611
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.dialer"
+bucket: "cached_app"
+total_dur: 1701572215
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.gms"
+bucket: "cached_app"
+total_dur: 38437012
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.gms"
+bucket: "foreground_app"
+total_dur: 1259805736
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.gms"
+bucket: "visible_app"
+total_dur: 397030029
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.googlequicksearchbox:interactor"
+bucket: "visible_app"
+total_dur: 804270091
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.googlequicksearchbox:search"
+bucket: "foreground_app"
+total_dur: 1467442984
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.keep"
+bucket: "foreground_app"
+total_dur: 576153188
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.permissioncontroller"
+bucket: "cached_app"
+total_dur: 870388947
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.providers.media.module"
+bucket: "persistent_service"
+total_dur: 1546461864
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.youtube"
+bucket: "foreground_app"
+total_dur: 1450400991
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.ar.core"
+bucket: "foreground_app"
+total_dur: 733794515
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.ar.core"
+bucket: "perceptible_low_app"
+total_dur: 182198151
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.google.euiccpixel"
+bucket: "cached_app"
+total_dur: 870140371
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.overdrive.mobile.android.libby"
+bucket: "foreground_app"
+total_dur: 889039012
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.patreon.android"
+bucket: "foreground_app"
+total_dur: 608530141
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "com.spotify.music"
+bucket: "foreground_app"
+total_dur: 566682160
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "org.thoughtcrime.securesms"
+bucket: "foreground_app"
+total_dur: 701758738
+}
+post_boot_oom_adj_bucket_duration_agg_by_process {
+name: "org.videolan.vlc"
+bucket: "foreground_app"
+total_dur: 361526235
+}
+post_boot_oom_adj_duration_agg {
+min_oom_adj_dur: 266887
+max_oom_adj_dur: 7292196
+avg_oom_adj_dur: 6121311.166666667
+oom_adj_event_count: 2
+oom_adj_reason: "activityChange"
+}
+post_boot_oom_adj_duration_agg {
+min_oom_adj_dur: 67180
+max_oom_adj_dur: 225871
+avg_oom_adj_dur: 160115.83333333334
+oom_adj_event_count: 5
+oom_adj_reason: "bindService"
+}
+post_boot_oom_adj_duration_agg {
+min_oom_adj_dur: 64657
+max_oom_adj_dur: 565674
+avg_oom_adj_dur: 232660.2142857143
+oom_adj_event_count: 11
+oom_adj_reason: "executingService"
+}
+post_boot_oom_adj_duration_agg {
+min_oom_adj_dur: 198120
+max_oom_adj_dur: 198120
+avg_oom_adj_dur: 198120.0
+oom_adj_event_count: 1
+oom_adj_reason: "finishReceiver"
+}
+post_boot_oom_adj_duration_agg {
+min_oom_adj_dur: 193766
+max_oom_adj_dur: 626302
+avg_oom_adj_dur: 383901.0
+oom_adj_event_count: 4
+oom_adj_reason: "getProvider"
+}
+post_boot_oom_adj_duration_agg {
+min_oom_adj_dur: 92366
+max_oom_adj_dur: 1461914
+avg_oom_adj_dur: 257078.14285714287
+oom_adj_event_count: 21
+oom_adj_reason: "processBegin"
+}
+post_boot_oom_adj_duration_agg {
+min_oom_adj_dur: 238525
+max_oom_adj_dur: 5160522
+avg_oom_adj_dur: 883870.1111111111
+oom_adj_event_count: 4
+oom_adj_reason: "startReceiver"
+}
+post_boot_oom_adj_duration_agg {
+min_oom_adj_dur: 68645
+max_oom_adj_dur: 2294270
+avg_oom_adj_dur: 747080.5
+oom_adj_event_count: 4
+oom_adj_reason: "startService"
+}
+post_boot_oom_adj_duration_agg {
+min_oom_adj_dur: 165242
+max_oom_adj_dur: 380290
+avg_oom_adj_dur: 272766.0
+oom_adj_event_count: 2
+oom_adj_reason: "unbindService"
+}
+}
diff --git a/test/trace_processor/diff_tests/metrics/android/android_oom_adjuster.out b/test/trace_processor/diff_tests/metrics/android/android_oom_adjuster.out
new file mode 100644
index 000000000..e7135d00c
--- /dev/null
+++ b/test/trace_processor/diff_tests/metrics/android/android_oom_adjuster.out
@@ -0,0 +1,2745 @@
+android_oom_adjuster {
+oom_adjuster_transition_counts_global {
+dest_bucket: "cached_app"
+count: 7
+}
+oom_adjuster_transition_counts_global {
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 27
+}
+oom_adjuster_transition_counts_global {
+src_bucket: "cached_app_lmk_first"
+dest_bucket: "cached_app"
+count: 5
+}
+oom_adjuster_transition_counts_global {
+src_bucket: "foreground_app"
+dest_bucket: "cached_app"
+count: 3
+}
+oom_adjuster_transition_counts_global {
+src_bucket: "previous_app"
+dest_bucket: "cached_app"
+count: 2
+}
+oom_adjuster_transition_counts_global {
+dest_bucket: "cached_app_lmk_first"
+count: 2
+}
+oom_adjuster_transition_counts_global {
+src_bucket: "cached_app"
+dest_bucket: "cached_app_lmk_first"
+count: 2
+}
+oom_adjuster_transition_counts_global {
+src_bucket: "cached_app_lmk_first"
+dest_bucket: "cached_app_lmk_first"
+count: 2
+}
+oom_adjuster_transition_counts_global {
+src_bucket: "previous_app"
+dest_bucket: "cached_app_lmk_first"
+count: 1
+}
+oom_adjuster_transition_counts_global {
+dest_bucket: "foreground_app"
+count: 27
+}
+oom_adjuster_transition_counts_global {
+src_bucket: "cached_app"
+dest_bucket: "foreground_app"
+count: 4
+}
+oom_adjuster_transition_counts_global {
+src_bucket: "perceptible_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_global {
+src_bucket: "perceptible_low_app"
+dest_bucket: "foreground_app"
+count: 2
+}
+oom_adjuster_transition_counts_global {
+src_bucket: "previous_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_global {
+src_bucket: "visible_app"
+dest_bucket: "foreground_app"
+count: 4
+}
+oom_adjuster_transition_counts_global {
+dest_bucket: "logcat"
+count: 1
+}
+oom_adjuster_transition_counts_global {
+dest_bucket: "native"
+count: 121
+}
+oom_adjuster_transition_counts_global {
+src_bucket: "foreground_app"
+dest_bucket: "perceptible_app"
+count: 2
+}
+oom_adjuster_transition_counts_global {
+src_bucket: "foreground_app"
+dest_bucket: "perceptible_low_app"
+count: 3
+}
+oom_adjuster_transition_counts_global {
+dest_bucket: "persistent_proc"
+count: 17
+}
+oom_adjuster_transition_counts_global {
+dest_bucket: "persistent_service"
+count: 2
+}
+oom_adjuster_transition_counts_global {
+src_bucket: "foreground_app"
+dest_bucket: "persistent_service"
+count: 1
+}
+oom_adjuster_transition_counts_global {
+dest_bucket: "previous_app"
+count: 5
+}
+oom_adjuster_transition_counts_global {
+dest_bucket: "service"
+count: 1
+}
+oom_adjuster_transition_counts_global {
+dest_bucket: "system"
+count: 1
+}
+oom_adjuster_transition_counts_global {
+dest_bucket: "unknown_native"
+count: 1
+}
+oom_adjuster_transition_counts_global {
+dest_bucket: "visible_app"
+count: 6
+}
+oom_adjuster_transition_counts_global {
+src_bucket: "foreground_app"
+dest_bucket: "visible_app"
+count: 4
+}
+oom_adjuster_transition_counts_by_process {
+name: ".ShannonImsService"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/apex/com.android.adbd/bin/adbd"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/apex/com.android.hardware.cas/bin/hw/android.hardware.cas-service.example"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/apex/com.android.os.statsd/bin/statsd"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/apex/com.google.android.hardware.biometrics.face/bin/hw/android.hardware.biometrics.face-service.22.pixel"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/apex/com.google.android.widevine/bin/hw/android.hardware.drm-service.widevine"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/apex/com.google.pixel.camera.hal/bin/hw/android.hardware.camera.provider@2.7-service-google"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/apex/com.google.pixel.camera.hal/bin/rlsservice"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/apex/com.google.pixel.wifi.ext/bin/hw/vendor.google.wifi_ext-service-vendor"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/apexd"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/audioserver"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/cameraserver"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/credstore"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/drmserver"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/gatekeeperd"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/gpuservice"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/hw/android.system.suspend-service"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/incidentd"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/init"
+dest_bucket: "native"
+count: 2
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/installd"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/ip6tables-restore"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/iptables-restore"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/keystore2"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/lmkd"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/logd"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/mediaserver"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/netd"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/prng_seeder"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/servicemanager"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/storaged"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/surfaceflinger"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/tombstoned"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/traced"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/traced_probes"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/ueventd"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/update_engine"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/virtual_camera"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/vold"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/bin/wificond"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/system_ext/bin/hw/android.hidl.allocator@1.0-service"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/system_ext/bin/hwservicemanager"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system/vendor/bin/wfc-pkt-router"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system_ext/bin/gs_watchdogd"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/system_ext/bin/hw/vendor.google.edgetpu_app_service@1.0-service"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/aocd"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/bipchmgr"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/cbd"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/chre"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/dmd"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.audio.service"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.authsecret-service.citadel"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.biometrics.fingerprint-service.goodix"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.bluetooth-service.bcmbtlinux"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.boot-service.default-pixel"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.cas@1.2-service"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.composer.hwc3-service.pixel"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.confirmationui-service.trusty.vendor"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.contexthub-service.generic"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.drm-service.clearkey"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.dumpstate-service"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.edgetpu.logging@service-edgetpu-logging"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.gatekeeper-service.trusty"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.gnss@2.1-service-brcm"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.graphics.allocator-V2-service"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.gxp.logging@service-gxp-logging"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.health-service.gs201"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.identity@1.0-service.citadel"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.input.processor-service"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.memtrack-service.pixel"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.neuralnetworks@service-darwinn-aidl"
+dest_bucket: "native"
+count: 2
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.nfc-service.st"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.oemlock-service.citadel"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.power-service.pixel-libperfmgr"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.power.stats-service.pixel"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.secure_element@1.2-service-gto"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.secure_element@1.2-service-gto-ese2"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.secure_element@1.2-uicc-service"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.security.keymint-service.citadel"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.security.keymint-service.trusty"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.sensors-service.multihal"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.thermal-service.pixel"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.usb-service"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.usb.gadget-service"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.vibrator-service.cs40l26"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/android.hardware.weaver-service.citadel"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/battery_mitigation"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/citadeld"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/google.hardware.media.c2@1.0-service"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/gpsd"
+dest_bucket: "unknown_native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/lhd"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/rild_exynos"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/samsung.hardware.media.c2@1.0-service"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/scd"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/vendor.dolby.media.c2@1.0-service"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/vendor.google.audiometricext@1.0-service-vendor"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/vendor.google.google_battery-service"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/vendor.google.radioext@1.0-service"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/vendor.google.wireless_charger-default"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/hw/wpa_supplicant"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/modem_svc_sit"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/pixelstats-vendor"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/ramdump"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/rfsd"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/sced"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/securedpud.slider"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/sscoredump"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/storageproxyd"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/trusty_metricsd"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/twoshay"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/vcd"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "/vendor/bin/vndservicemanager"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "<pre-initialized>"
+dest_bucket: "native"
+count: 2
+}
+oom_adjuster_transition_counts_by_process {
+name: "android.process.acore"
+src_bucket: "previous_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "android.process.acore"
+dest_bucket: "previous_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.amazon.mp3"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.android.hbmsvmanager"
+dest_bucket: "persistent_proc"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.android.keychain"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.android.networkstack.process"
+dest_bucket: "persistent_proc"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.android.nfc"
+dest_bucket: "persistent_proc"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.android.phone"
+dest_bucket: "persistent_proc"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.android.pixellogger"
+dest_bucket: "persistent_proc"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.android.printspooler"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.android.providers.calendar"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.android.qns"
+dest_bucket: "visible_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.android.se"
+dest_bucket: "persistent_proc"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.android.settings"
+src_bucket: "foreground_app"
+dest_bucket: "cached_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.android.settings"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.android.systemui"
+dest_bucket: "persistent_proc"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.apple.android.music"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.blinkslabs.blinkist.android"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.SSRestartDetector"
+dest_bucket: "persistent_proc"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.books"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.cbrsnetworkmonitor"
+dest_bucket: "persistent_proc"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.dreamliner"
+src_bucket: "foreground_app"
+dest_bucket: "cached_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.dreamliner"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.dreamliner"
+src_bucket: "perceptible_low_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.dreamliner"
+src_bucket: "foreground_app"
+dest_bucket: "perceptible_low_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.messaging"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.messaging:rcs"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.messaging:rcs"
+src_bucket: "perceptible_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.messaging:rcs"
+src_bucket: "foreground_app"
+dest_bucket: "perceptible_app"
+count: 2
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.nexuslauncher"
+src_bucket: "visible_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.nexuslauncher"
+dest_bucket: "visible_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.scone"
+dest_bucket: "service"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.wallpaper"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.wellbeing"
+dest_bucket: "cached_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.wellbeing"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 8
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.wellbeing"
+src_bucket: "cached_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.work.clouddpc"
+dest_bucket: "cached_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.work.clouddpc"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 2
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.work.clouddpc"
+src_bucket: "cached_app_lmk_first"
+dest_bucket: "cached_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.work.clouddpc"
+src_bucket: "cached_app"
+dest_bucket: "cached_app_lmk_first"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.apps.youtube.music"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.as"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.as.oss"
+src_bucket: "foreground_app"
+dest_bucket: "cached_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.as.oss"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.as.oss"
+src_bucket: "perceptible_low_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.as.oss"
+src_bucket: "foreground_app"
+dest_bucket: "perceptible_low_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.bluetooth"
+dest_bucket: "persistent_service"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.calendar"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.carrier"
+src_bucket: "previous_app"
+dest_bucket: "cached_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.carrier"
+dest_bucket: "previous_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.cellbroadcastreceiver"
+dest_bucket: "cached_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.cellbroadcastreceiver"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 3
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.connectivitythermalpowermanager"
+dest_bucket: "persistent_proc"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.deskclock"
+src_bucket: "cached_app_lmk_first"
+dest_bucket: "cached_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.deskclock"
+dest_bucket: "cached_app_lmk_first"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.deskclock"
+src_bucket: "cached_app_lmk_first"
+dest_bucket: "cached_app_lmk_first"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.deskclock"
+src_bucket: "cached_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.devicelockcontroller"
+dest_bucket: "cached_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.devicelockcontroller"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.devicelockcontroller"
+src_bucket: "cached_app_lmk_first"
+dest_bucket: "cached_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.devicelockcontroller"
+src_bucket: "cached_app"
+dest_bucket: "cached_app_lmk_first"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.devicelockcontroller"
+src_bucket: "cached_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.devicelockcontroller"
+src_bucket: "visible_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.devicelockcontroller"
+src_bucket: "foreground_app"
+dest_bucket: "visible_app"
+count: 2
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.dialer"
+dest_bucket: "cached_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.dialer"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 7
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.euicc"
+dest_bucket: "visible_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.ext.services"
+dest_bucket: "visible_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.flipendo"
+src_bucket: "cached_app_lmk_first"
+dest_bucket: "cached_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.flipendo"
+src_bucket: "previous_app"
+dest_bucket: "cached_app_lmk_first"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.flipendo"
+dest_bucket: "previous_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.gms"
+dest_bucket: "cached_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.gms"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 5
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.gms"
+src_bucket: "cached_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.gms"
+src_bucket: "visible_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.gms"
+src_bucket: "foreground_app"
+dest_bucket: "visible_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.gms.persistent"
+src_bucket: "visible_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.gms.persistent"
+dest_bucket: "visible_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.googlequicksearchbox:interactor"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.googlequicksearchbox:interactor"
+src_bucket: "foreground_app"
+dest_bucket: "visible_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.googlequicksearchbox:search"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.grilservice"
+dest_bucket: "persistent_proc"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.ims"
+dest_bucket: "persistent_service"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.iwlan"
+dest_bucket: "visible_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.keep"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.permissioncontroller"
+dest_bucket: "cached_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.permissioncontroller"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.pixelsystemservice"
+dest_bucket: "persistent_proc"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.providers.media.module"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.providers.media.module"
+src_bucket: "foreground_app"
+dest_bucket: "persistent_service"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.repairmode"
+src_bucket: "cached_app_lmk_first"
+dest_bucket: "cached_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.repairmode"
+dest_bucket: "cached_app_lmk_first"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.repairmode"
+src_bucket: "cached_app_lmk_first"
+dest_bucket: "cached_app_lmk_first"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.android.youtube"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.ar.core"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.ar.core"
+src_bucket: "foreground_app"
+dest_bucket: "perceptible_low_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.euiccpixel"
+src_bucket: "previous_app"
+dest_bucket: "cached_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.euiccpixel"
+dest_bucket: "previous_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.google.pixel.camera.services"
+dest_bucket: "persistent_proc"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.overdrive.mobile.android.libby"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.patreon.android"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.samsung.slsi.telephony.oem.oemrilhookservice"
+dest_bucket: "persistent_proc"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.samsung.slsi.telephony.oemril"
+dest_bucket: "persistent_proc"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.shannon.imsservice"
+dest_bucket: "persistent_proc"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.shannon.rcsservice"
+dest_bucket: "persistent_proc"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.shannon.rcsservice:shannonrcsservice"
+dest_bucket: "previous_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "com.spotify.music"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "logcat"
+dest_bucket: "logcat"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "logcat"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "media.extractor"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "media.metrics"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "media.swcodec"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "org.thoughtcrime.securesms"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "org.videolan.vlc"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "perfetto"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "system_server"
+dest_bucket: "system"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "webview_zygote"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_process {
+name: "zygote64"
+dest_bucket: "native"
+count: 1
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+dest_bucket: "cached_app"
+count: 7
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "activityChange"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 8
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "bindService"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 8
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "getProvider"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "startReceiver"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 7
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "uiVisibility"
+src_bucket: "cached_app"
+dest_bucket: "cached_app"
+count: 3
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "uiVisibility"
+src_bucket: "cached_app_lmk_first"
+dest_bucket: "cached_app"
+count: 5
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "activityChange"
+src_bucket: "foreground_app"
+dest_bucket: "cached_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "executingService"
+src_bucket: "foreground_app"
+dest_bucket: "cached_app"
+count: 2
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "activityChange"
+src_bucket: "previous_app"
+dest_bucket: "cached_app"
+count: 2
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+dest_bucket: "cached_app_lmk_first"
+count: 2
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "activityChange"
+src_bucket: "cached_app"
+dest_bucket: "cached_app_lmk_first"
+count: 2
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "activityChange"
+src_bucket: "cached_app_lmk_first"
+dest_bucket: "cached_app_lmk_first"
+count: 2
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "activityChange"
+src_bucket: "previous_app"
+dest_bucket: "cached_app_lmk_first"
+count: 1
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+dest_bucket: "foreground_app"
+count: 2
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "activityChange"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "processBegin"
+dest_bucket: "foreground_app"
+count: 24
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "getProvider"
+src_bucket: "cached_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "startReceiver"
+src_bucket: "cached_app"
+dest_bucket: "foreground_app"
+count: 2
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "startService"
+src_bucket: "cached_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "startService"
+src_bucket: "perceptible_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "unbindService"
+src_bucket: "perceptible_low_app"
+dest_bucket: "foreground_app"
+count: 2
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "getProvider"
+src_bucket: "previous_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "bindService"
+src_bucket: "visible_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "getProvider"
+src_bucket: "visible_app"
+dest_bucket: "foreground_app"
+count: 1
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "startService"
+src_bucket: "visible_app"
+dest_bucket: "foreground_app"
+count: 2
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+dest_bucket: "logcat"
+count: 1
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+dest_bucket: "native"
+count: 117
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "executingService"
+dest_bucket: "native"
+count: 4
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "executingService"
+src_bucket: "foreground_app"
+dest_bucket: "perceptible_app"
+count: 2
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "executingService"
+src_bucket: "foreground_app"
+dest_bucket: "perceptible_low_app"
+count: 3
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+dest_bucket: "persistent_proc"
+count: 13
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "processBegin"
+dest_bucket: "persistent_proc"
+count: 4
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+dest_bucket: "persistent_service"
+count: 2
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "startService"
+src_bucket: "foreground_app"
+dest_bucket: "persistent_service"
+count: 1
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+dest_bucket: "previous_app"
+count: 5
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+dest_bucket: "service"
+count: 1
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+dest_bucket: "system"
+count: 1
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+dest_bucket: "unknown_native"
+count: 1
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+dest_bucket: "visible_app"
+count: 6
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "executingService"
+src_bucket: "foreground_app"
+dest_bucket: "visible_app"
+count: 3
+}
+oom_adjuster_transition_counts_by_oom_adj_reason {
+name: "finishReceiver"
+src_bucket: "foreground_app"
+dest_bucket: "visible_app"
+count: 1
+}
+oom_adj_bucket_duration_agg_global {
+bucket: "cached_app"
+total_dur: 20351484924
+}
+oom_adj_bucket_duration_agg_global {
+bucket: "cached_app_lmk_first"
+total_dur: 544761924
+}
+oom_adj_bucket_duration_agg_global {
+bucket: "foreground_app"
+total_dur: 33803455234
+}
+oom_adj_bucket_duration_agg_global {
+bucket: "logcat"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_global {
+bucket: "native"
+total_dur: 263503709570
+}
+oom_adj_bucket_duration_agg_global {
+bucket: "perceptible_app"
+total_dur: 940071238
+}
+oom_adj_bucket_duration_agg_global {
+bucket: "perceptible_low_app"
+total_dur: 199288116
+}
+oom_adj_bucket_duration_agg_global {
+bucket: "persistent_proc"
+total_dur: 36752485443
+}
+oom_adj_bucket_duration_agg_global {
+bucket: "persistent_service"
+total_dur: 6049062188
+}
+oom_adj_bucket_duration_agg_global {
+bucket: "previous_app"
+total_dur: 6572285720
+}
+oom_adj_bucket_duration_agg_global {
+bucket: "service"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_global {
+bucket: "system"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_global {
+bucket: "unknown_native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_global {
+bucket: "visible_app"
+total_dur: 12579222928
+}
+oom_adj_bucket_duration_agg_by_process {
+name: ".ShannonImsService"
+bucket: "foreground_app"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/apex/com.android.adbd/bin/adbd"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/apex/com.android.hardware.cas/bin/hw/android.hardware.cas-service.example"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/apex/com.android.os.statsd/bin/statsd"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/apex/com.google.android.hardware.biometrics.face/bin/hw/android.hardware.biometrics.face-service.22.pixel"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/apex/com.google.android.widevine/bin/hw/android.hardware.drm-service.widevine"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/apex/com.google.pixel.camera.hal/bin/hw/android.hardware.camera.provider@2.7-service-google"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/apex/com.google.pixel.camera.hal/bin/rlsservice"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/apex/com.google.pixel.wifi.ext/bin/hw/vendor.google.wifi_ext-service-vendor"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/apexd"
+bucket: "native"
+total_dur: 25397654
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/audioserver"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/cameraserver"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/credstore"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/drmserver"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/gatekeeperd"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/gpuservice"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/hw/android.system.suspend-service"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/incidentd"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/init"
+bucket: "native"
+total_dur: 4502600324
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/installd"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/ip6tables-restore"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/iptables-restore"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/keystore2"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/lmkd"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/logd"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/mediaserver"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/netd"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/prng_seeder"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/servicemanager"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/storaged"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/surfaceflinger"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/tombstoned"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/traced"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/traced_probes"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/ueventd"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/update_engine"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/virtual_camera"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/vold"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/bin/wificond"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/system_ext/bin/hw/android.hidl.allocator@1.0-service"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/system_ext/bin/hwservicemanager"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system/vendor/bin/wfc-pkt-router"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system_ext/bin/gs_watchdogd"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/system_ext/bin/hw/vendor.google.edgetpu_app_service@1.0-service"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/aocd"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/bipchmgr"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/cbd"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/chre"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/dmd"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.audio.service"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.authsecret-service.citadel"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.biometrics.fingerprint-service.goodix"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.bluetooth-service.bcmbtlinux"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.boot-service.default-pixel"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.cas@1.2-service"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.composer.hwc3-service.pixel"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.confirmationui-service.trusty.vendor"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.contexthub-service.generic"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.drm-service.clearkey"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.dumpstate-service"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.edgetpu.logging@service-edgetpu-logging"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.gatekeeper-service.trusty"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.gnss@2.1-service-brcm"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.graphics.allocator-V2-service"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.gxp.logging@service-gxp-logging"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.health-service.gs201"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.identity@1.0-service.citadel"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.input.processor-service"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.memtrack-service.pixel"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.neuralnetworks@service-darwinn-aidl"
+bucket: "native"
+total_dur: 4502600324
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.nfc-service.st"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.oemlock-service.citadel"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.power-service.pixel-libperfmgr"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.power.stats-service.pixel"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.secure_element@1.2-service-gto"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.secure_element@1.2-service-gto-ese2"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.secure_element@1.2-uicc-service"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.security.keymint-service.citadel"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.security.keymint-service.trusty"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.sensors-service.multihal"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.thermal-service.pixel"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.usb-service"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.usb.gadget-service"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.vibrator-service.cs40l26"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/android.hardware.weaver-service.citadel"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/battery_mitigation"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/citadeld"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/google.hardware.media.c2@1.0-service"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/gpsd"
+bucket: "unknown_native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/lhd"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/rild_exynos"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/samsung.hardware.media.c2@1.0-service"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/scd"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/vendor.dolby.media.c2@1.0-service"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/vendor.google.audiometricext@1.0-service-vendor"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/vendor.google.google_battery-service"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/vendor.google.radioext@1.0-service"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/vendor.google.wireless_charger-default"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/hw/wpa_supplicant"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/modem_svc_sit"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/pixelstats-vendor"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/ramdump"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/rfsd"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/sced"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/securedpud.slider"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/sscoredump"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/storageproxyd"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/trusty_metricsd"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/twoshay"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/vcd"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "/vendor/bin/vndservicemanager"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "<pre-initialized>"
+bucket: "native"
+total_dur: 50795308
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "android.process.acore"
+bucket: "foreground_app"
+total_dur: 823432282
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "android.process.acore"
+bucket: "previous_app"
+total_dur: 1427867880
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.amazon.mp3"
+bucket: "foreground_app"
+total_dur: 1322230378
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.android.hbmsvmanager"
+bucket: "persistent_proc"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.android.keychain"
+bucket: "foreground_app"
+total_dur: 196867340
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.android.networkstack.process"
+bucket: "persistent_proc"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.android.nfc"
+bucket: "persistent_proc"
+total_dur: 1883581900
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.android.phone"
+bucket: "persistent_proc"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.android.pixellogger"
+bucket: "persistent_proc"
+total_dur: 1852027416
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.android.printspooler"
+bucket: "foreground_app"
+total_dur: 343904124
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.android.providers.calendar"
+bucket: "foreground_app"
+total_dur: 281386139
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.android.qns"
+bucket: "visible_app"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.android.se"
+bucket: "persistent_proc"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.android.settings"
+bucket: "cached_app"
+total_dur: 967052521
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.android.settings"
+bucket: "foreground_app"
+total_dur: 1284247641
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.android.systemui"
+bucket: "persistent_proc"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.apple.android.music"
+bucket: "foreground_app"
+total_dur: 1268519522
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.blinkslabs.blinkist.android"
+bucket: "foreground_app"
+total_dur: 1250421540
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.SSRestartDetector"
+bucket: "persistent_proc"
+total_dur: 1885479849
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.books"
+bucket: "foreground_app"
+total_dur: 1076963328
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.cbrsnetworkmonitor"
+bucket: "persistent_proc"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.dreamliner"
+bucket: "cached_app"
+total_dur: 1086183503
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.dreamliner"
+bucket: "foreground_app"
+total_dur: 402609904
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.dreamliner"
+bucket: "perceptible_low_app"
+total_dur: 7658935
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.messaging"
+bucket: "native"
+total_dur: 25397654
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.messaging:rcs"
+bucket: "foreground_app"
+total_dur: 991455486
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.messaging:rcs"
+bucket: "perceptible_app"
+total_dur: 940071238
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.nexuslauncher"
+bucket: "foreground_app"
+total_dur: 1661132477
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.nexuslauncher"
+bucket: "visible_app"
+total_dur: 590167685
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.scone"
+bucket: "service"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.wallpaper"
+bucket: "foreground_app"
+total_dur: 177919993
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.wellbeing"
+bucket: "cached_app"
+total_dur: 1366329916
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.wellbeing"
+bucket: "foreground_app"
+total_dur: 884970246
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.work.clouddpc"
+bucket: "cached_app"
+total_dur: 2194632641
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.work.clouddpc"
+bucket: "cached_app_lmk_first"
+total_dur: 56667521
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.apps.youtube.music"
+bucket: "foreground_app"
+total_dur: 1558635529
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.as"
+bucket: "foreground_app"
+total_dur: 2003700552
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.as.oss"
+bucket: "cached_app"
+total_dur: 621111806
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.as.oss"
+bucket: "foreground_app"
+total_dur: 303909018
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.as.oss"
+bucket: "perceptible_low_app"
+total_dur: 9431030
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.bluetooth"
+bucket: "persistent_service"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.calendar"
+bucket: "foreground_app"
+total_dur: 1573637523
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.carrier"
+bucket: "cached_app"
+total_dur: 870239329
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.carrier"
+bucket: "previous_app"
+total_dur: 1381060833
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.cellbroadcastreceiver"
+bucket: "cached_app"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.connectivitythermalpowermanager"
+bucket: "persistent_proc"
+total_dur: 1864494172
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.deskclock"
+bucket: "cached_app"
+total_dur: 389354777
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.deskclock"
+bucket: "cached_app_lmk_first"
+total_dur: 187275391
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.deskclock"
+bucket: "foreground_app"
+total_dur: 1674669994
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.devicelockcontroller"
+bucket: "cached_app"
+total_dur: 510497641
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.devicelockcontroller"
+bucket: "cached_app_lmk_first"
+total_dur: 56693278
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.devicelockcontroller"
+bucket: "foreground_app"
+total_dur: 115664632
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.devicelockcontroller"
+bucket: "visible_app"
+total_dur: 1568444611
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.dialer"
+bucket: "cached_app"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.euicc"
+bucket: "visible_app"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.ext.services"
+bucket: "visible_app"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.flipendo"
+bucket: "cached_app"
+total_dur: 2063730581
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.flipendo"
+bucket: "cached_app_lmk_first"
+total_dur: 56672527
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.flipendo"
+bucket: "previous_app"
+total_dur: 130897054
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.gms"
+bucket: "cached_app"
+total_dur: 594464397
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.gms"
+bucket: "foreground_app"
+total_dur: 1259805736
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.gms"
+bucket: "visible_app"
+total_dur: 397030029
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.gms.persistent"
+bucket: "foreground_app"
+total_dur: 2037190298
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.gms.persistent"
+bucket: "visible_app"
+total_dur: 214109864
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.googlequicksearchbox:interactor"
+bucket: "foreground_app"
+total_dur: 1185413249
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.googlequicksearchbox:interactor"
+bucket: "visible_app"
+total_dur: 804270091
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.googlequicksearchbox:search"
+bucket: "foreground_app"
+total_dur: 1467442984
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.grilservice"
+bucket: "persistent_proc"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.ims"
+bucket: "persistent_service"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.iwlan"
+bucket: "visible_app"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.keep"
+bucket: "foreground_app"
+total_dur: 576153188
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.permissioncontroller"
+bucket: "cached_app"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.pixelsystemservice"
+bucket: "persistent_proc"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.providers.media.module"
+bucket: "foreground_app"
+total_dur: 518140177
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.providers.media.module"
+bucket: "persistent_service"
+total_dur: 1546461864
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.repairmode"
+bucket: "cached_app"
+total_dur: 2063846955
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.repairmode"
+bucket: "cached_app_lmk_first"
+total_dur: 187453207
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.android.youtube"
+bucket: "foreground_app"
+total_dur: 1450400991
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.ar.core"
+bucket: "foreground_app"
+total_dur: 733794515
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.ar.core"
+bucket: "perceptible_low_app"
+total_dur: 182198151
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.euiccpixel"
+bucket: "cached_app"
+total_dur: 870140371
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.euiccpixel"
+bucket: "previous_app"
+total_dur: 1381159791
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.google.pixel.camera.services"
+bucket: "persistent_proc"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.overdrive.mobile.android.libby"
+bucket: "foreground_app"
+total_dur: 889039012
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.patreon.android"
+bucket: "foreground_app"
+total_dur: 608530141
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.samsung.slsi.telephony.oem.oemrilhookservice"
+bucket: "persistent_proc"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.samsung.slsi.telephony.oemril"
+bucket: "persistent_proc"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.shannon.imsservice"
+bucket: "persistent_proc"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.shannon.rcsservice"
+bucket: "persistent_proc"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.shannon.rcsservice:shannonrcsservice"
+bucket: "previous_app"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "com.spotify.music"
+bucket: "foreground_app"
+total_dur: 566682160
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "logcat"
+bucket: "logcat"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "logcat"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "media.extractor"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "media.metrics"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "media.swcodec"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "org.thoughtcrime.securesms"
+bucket: "foreground_app"
+total_dur: 701758738
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "org.videolan.vlc"
+bucket: "foreground_app"
+total_dur: 361526235
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "perfetto"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "system_server"
+bucket: "system"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "webview_zygote"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_bucket_duration_agg_by_process {
+name: "zygote64"
+bucket: "native"
+total_dur: 2251300162
+}
+oom_adj_duration_agg {
+oom_adj_event_count: 0
+}
+oom_adj_duration_agg {
+min_oom_adj_dur: 263550
+max_oom_adj_dur: 7292196
+avg_oom_adj_dur: 3888985.6470588236
+oom_adj_event_count: 4
+oom_adj_reason: "activityChange"
+}
+oom_adj_duration_agg {
+min_oom_adj_dur: 67180
+max_oom_adj_dur: 225871
+avg_oom_adj_dur: 171359.88888888888
+oom_adj_event_count: 6
+oom_adj_reason: "bindService"
+}
+oom_adj_duration_agg {
+min_oom_adj_dur: 64657
+max_oom_adj_dur: 565674
+avg_oom_adj_dur: 232660.2142857143
+oom_adj_event_count: 11
+oom_adj_reason: "executingService"
+}
+oom_adj_duration_agg {
+min_oom_adj_dur: 198120
+max_oom_adj_dur: 198120
+avg_oom_adj_dur: 198120.0
+oom_adj_event_count: 1
+oom_adj_reason: "finishReceiver"
+}
+oom_adj_duration_agg {
+min_oom_adj_dur: 193766
+max_oom_adj_dur: 626302
+avg_oom_adj_dur: 383901.0
+oom_adj_event_count: 4
+oom_adj_reason: "getProvider"
+}
+oom_adj_duration_agg {
+min_oom_adj_dur: 92366
+max_oom_adj_dur: 1461914
+avg_oom_adj_dur: 330079.5714285714
+oom_adj_event_count: 28
+oom_adj_reason: "processBegin"
+}
+oom_adj_duration_agg {
+min_oom_adj_dur: 238525
+max_oom_adj_dur: 5160522
+avg_oom_adj_dur: 883870.1111111111
+oom_adj_event_count: 4
+oom_adj_reason: "startReceiver"
+}
+oom_adj_duration_agg {
+min_oom_adj_dur: 68645
+max_oom_adj_dur: 2294270
+avg_oom_adj_dur: 618880.2
+oom_adj_event_count: 5
+oom_adj_reason: "startService"
+}
+oom_adj_duration_agg {
+min_oom_adj_dur: 10092
+max_oom_adj_dur: 10092
+avg_oom_adj_dur: 10092.0
+oom_adj_event_count: 1
+oom_adj_reason: "uiVisibility"
+}
+oom_adj_duration_agg {
+min_oom_adj_dur: 165242
+max_oom_adj_dur: 380290
+avg_oom_adj_dur: 272766.0
+oom_adj_event_count: 2
+oom_adj_reason: "unbindService"
+}
+}
diff --git a/test/trace_processor/diff_tests/metrics/android/tests.py b/test/trace_processor/diff_tests/metrics/android/tests.py
index 06cbe59c9..da5559ea3 100644
--- a/test/trace_processor/diff_tests/metrics/android/tests.py
+++ b/test/trace_processor/diff_tests/metrics/android/tests.py
@@ -303,3 +303,9 @@ class AndroidMetrics(TestSuite):
}
}
"""))
+ def test_android_oom_adjuster(self):
+ return DiffTestBlueprint(
+ trace=DataPath('android_postboot_unlock.pftrace'),
+ query=Metric("android_oom_adjuster"),
+ out=Path('android_oom_adjuster.out')
+ )
diff --git a/ui/src/frontend/base_counter_track.ts b/ui/src/frontend/base_counter_track.ts
index 656ec56da..6285b277c 100644
--- a/ui/src/frontend/base_counter_track.ts
+++ b/ui/src/frontend/base_counter_track.ts
@@ -17,7 +17,7 @@ import m from 'mithril';
import {searchSegment} from '../base/binary_search';
import {Disposable, NullDisposable} from '../base/disposable';
import {assertTrue, assertUnreachable} from '../base/logging';
-import {duration, Time, time} from '../base/time';
+import {Time, time} from '../base/time';
import {drawTrackHoverTooltip} from '../common/canvas_utils';
import {raf} from '../core/raf_scheduler';
import {EngineProxy, LONG, NUM, Track} from '../public';
@@ -27,9 +27,8 @@ import {MenuItem, MenuDivider, PopupMenu2} from '../widgets/menu';
import {checkerboardExcept} from './checkerboard';
import {globals} from './globals';
import {PanelSize} from './panel';
-import {constraintsToQuerySuffix} from './sql_utils';
import {NewTrackArgs} from './track';
-import {CacheKey, TimelineCache} from '../core/timeline_cache';
+import {CacheKey} from '../core/timeline_cache';
import {featureFlags} from '../core/feature_flags';
export const COUNTER_DEBUG_MENU_ITEMS = featureFlags.register({
@@ -128,8 +127,6 @@ class RangeSharer {
interface CounterData {
timestamps: BigInt64Array;
- counts: Uint32Array;
- avgValues: Float64Array;
minDisplayValues: Float64Array;
maxDisplayValues: Float64Array;
lastDisplayValues: Float64Array;
@@ -142,13 +139,10 @@ const MARGIN_TOP = 3.5;
interface CounterLimits {
maxDisplayValue: number;
minDisplayValue: number;
- maxDurNs: duration;
}
interface CounterTooltipState {
lastDisplayValue: number;
- avgValue: number;
- count: number;
ts: time;
tsEnd?: time;
}
@@ -207,16 +201,12 @@ export abstract class BaseCounterTrack implements Track {
private counters: CounterData = {
timestamps: new BigInt64Array(0),
- counts: new Uint32Array(0),
- avgValues: new Float64Array(0),
minDisplayValues: new Float64Array(0),
maxDisplayValues: new Float64Array(0),
lastDisplayValues: new Float64Array(0),
displayValueRange: [0, 0],
};
- private cache: TimelineCache<CounterData> = new TimelineCache(5);
-
// Cleanup hook for onInit.
private initState?: Disposable;
@@ -266,7 +256,7 @@ export abstract class BaseCounterTrack implements Track {
constructor(args: BaseCounterTrackArgs) {
this.engine = args.engine;
- this.trackKey = args.trackKey;
+ this.trackKey = args.trackKey.replaceAll('-', '_');
this.defaultOptions = args.options ?? {};
}
@@ -427,12 +417,9 @@ export abstract class BaseCounterTrack implements Track {
protected invalidate() {
this.limits = undefined;
- this.cache.invalidate();
this.countersKey = CacheKey.zero();
this.counters = {
timestamps: new BigInt64Array(0),
- counts: new Uint32Array(0),
- avgValues: new Float64Array(0),
minDisplayValues: new Float64Array(0),
maxDisplayValues: new Float64Array(0),
lastDisplayValues: new Float64Array(0),
@@ -479,10 +466,7 @@ export abstract class BaseCounterTrack implements Track {
}
render(ctx: CanvasRenderingContext2D, size: PanelSize) {
- const {
- visibleTimeScale: timeScale,
- // visibleWindowTime: vizTime,
- } = globals.timeline;
+ const {visibleTimeScale: timeScale} = globals.timeline;
// In any case, draw whatever we have (which might be stale/incomplete).
@@ -490,11 +474,17 @@ export abstract class BaseCounterTrack implements Track {
const data = this.counters;
if (data.timestamps.length === 0 || limits === undefined) {
+ checkerboardExcept(
+ ctx,
+ this.getHeight(),
+ 0,
+ size.width,
+ timeScale.timeToPx(this.countersKey.start),
+ timeScale.timeToPx(this.countersKey.end),
+ );
return;
}
- assertTrue(data.timestamps.length === data.counts.length);
- assertTrue(data.timestamps.length === data.avgValues.length);
assertTrue(data.timestamps.length === data.minDisplayValues.length);
assertTrue(data.timestamps.length === data.maxDisplayValues.length);
assertTrue(data.timestamps.length === data.lastDisplayValues.length);
@@ -541,11 +531,11 @@ export abstract class BaseCounterTrack implements Track {
ctx.beginPath();
const timestamp = Time.fromRaw(timestamps[0]);
- ctx.moveTo(calculateX(timestamp), zeroY);
+ ctx.moveTo(Math.max(0, calculateX(timestamp)), zeroY);
let lastDrawnY = zeroY;
for (let i = 0; i < timestamps.length; i++) {
const timestamp = Time.fromRaw(timestamps[i]);
- const x = calculateX(timestamp);
+ const x = Math.max(0, calculateX(timestamp));
const minY = calculateY(minValues[i]);
const maxY = calculateY(maxValues[i]);
const lastY = calculateY(lastValues[i]);
@@ -582,7 +572,7 @@ export abstract class BaseCounterTrack implements Track {
const hover = this.hover;
if (hover !== undefined) {
- let text = `${hover.avgValue.toLocaleString()}`;
+ let text = `${hover.lastDisplayValue.toLocaleString()}`;
const unit = this.unit;
switch (options.yMode) {
@@ -600,14 +590,11 @@ export abstract class BaseCounterTrack implements Track {
break;
}
- if (hover.count > 1) {
- text += ` (avg of ${hover.count})`;
- }
-
ctx.fillStyle = `hsl(${hue}, 45%, 75%)`;
ctx.strokeStyle = `hsl(${hue}, 45%, 45%)`;
- const xStart = Math.floor(timeScale.timeToPx(hover.ts));
+ const rawXStart = calculateX(hover.ts);
+ const xStart = Math.max(0, rawXStart);
const xEnd =
hover.tsEnd === undefined
? endPx
@@ -627,17 +614,19 @@ export abstract class BaseCounterTrack implements Track {
ctx.stroke();
ctx.lineWidth = 1;
- // Draw change marker.
- ctx.beginPath();
- ctx.arc(
- xStart,
- y,
- 3 /* r*/,
- 0 /* start angle*/,
- 2 * Math.PI /* end angle*/,
- );
- ctx.fill();
- ctx.stroke();
+ // Draw change marker if it would be visible.
+ if (rawXStart >= -6) {
+ ctx.beginPath();
+ ctx.arc(
+ xStart,
+ y,
+ 3 /* r*/,
+ 0 /* start angle*/,
+ 2 * Math.PI /* end angle*/,
+ );
+ ctx.fill();
+ ctx.stroke();
+ }
// Draw the tooltip.
drawTrackHoverTooltip(ctx, this.mousePos, this.getHeight(), text);
@@ -645,11 +634,11 @@ export abstract class BaseCounterTrack implements Track {
// Write the Y scale on the top left corner.
ctx.fillStyle = 'rgba(255, 255, 255, 0.6)';
- ctx.fillRect(0, 0, 42, 16);
+ ctx.fillRect(0, 0, 42, 13);
ctx.fillStyle = '#666';
ctx.textAlign = 'left';
ctx.textBaseline = 'alphabetic';
- ctx.fillText(`${yLabel}`, 5, 14);
+ ctx.fillText(`${yLabel}`, 5, 11);
// TODO(hjd): Refactor this into checkerboardExcept
{
@@ -691,14 +680,10 @@ export abstract class BaseCounterTrack implements Track {
const tsEnd =
right === -1 ? undefined : Time.fromRaw(data.timestamps[right]);
const lastDisplayValue = data.lastDisplayValues[left];
- const count = data.counts[left];
- const avgValue = data.avgValues[left];
this.hover = {
ts,
tsEnd,
lastDisplayValue,
- count,
- avgValue,
};
}
@@ -785,7 +770,6 @@ export abstract class BaseCounterTrack implements Track {
break;
default:
assertUnreachable(options.yMode);
- break;
}
if (options.yDisplay === 'log') {
@@ -805,7 +789,6 @@ export abstract class BaseCounterTrack implements Track {
const options = this.getCounterOptions();
let valueExpr;
-
switch (options.yMode) {
case 'value':
valueExpr = 'value';
@@ -819,7 +802,6 @@ export abstract class BaseCounterTrack implements Track {
break;
default:
assertUnreachable(options.yMode);
- break;
}
let displayValueExpr = valueExpr;
@@ -831,7 +813,6 @@ export abstract class BaseCounterTrack implements Track {
WITH data AS (
SELECT
ts,
- ${valueExpr} as value,
${displayValueExpr} as displayValue
FROM (${this.getSqlSource()})
)
@@ -841,39 +822,32 @@ export abstract class BaseCounterTrack implements Track {
private async maybeRequestData(rawCountersKey: CacheKey) {
let limits = this.limits;
if (limits === undefined) {
- const maxDurQuery = await this.engine.query(`
- ${this.getSqlPreamble()}
- SELECT
- max(dur) as maxDur
- FROM (
+ const displayValueQuery = await this.engine.query(`
+ drop table if exists counter_${this.trackKey};
+
+ create virtual table counter_${this.trackKey}
+ using __intrinsic_counter_mipmap((
+ ${this.getSqlPreamble()}
SELECT
- lead(ts, 1, ts) over (order by ts) - ts as dur
+ ts,
+ displayValue as value
FROM data
- )
- `);
- const maxDurRow = maxDurQuery.firstRow({
- maxDur: LONG,
- });
- const maxDurNs = maxDurRow.maxDur;
+ ));
- const displayValueQuery = await this.engine.query(`
- ${this.getSqlPreamble()}
- SELECT
- max(displayValue) as maxDisplayValue,
- min(displayValue) as minDisplayValue
- FROM data
+ select
+ min_value as minDisplayValue,
+ max_value as maxDisplayValue
+ from counter_${this.trackKey}(
+ trace_start(), trace_end(), trace_dur()
+ );
`);
- const displayValueRow = displayValueQuery.firstRow({
+ const {minDisplayValue, maxDisplayValue} = displayValueQuery.firstRow({
minDisplayValue: NUM,
maxDisplayValue: NUM,
});
-
- const minDisplayValue = displayValueRow.minDisplayValue;
- const maxDisplayValue = displayValueRow.maxDisplayValue;
limits = this.limits = {
minDisplayValue,
maxDisplayValue,
- maxDurNs,
};
}
@@ -888,42 +862,21 @@ export abstract class BaseCounterTrack implements Track {
);
}
- const maybeCachedCounters = this.cache.lookup(countersKey);
- if (maybeCachedCounters) {
- this.countersKey = countersKey;
- this.counters = maybeCachedCounters;
- return;
- }
-
- const bucketNs = countersKey.bucketSize;
-
- const constraint = constraintsToQuerySuffix({
- filters: [
- `ts >= ${countersKey.start} - ${limits.maxDurNs}`,
- `ts <= ${countersKey.end}`,
- `value is not null`,
- ],
- groupBy: ['tsq'],
- orderBy: ['tsq'],
- });
-
const queryRes = await this.engine.query(`
- ${this.getSqlPreamble()}
SELECT
- (ts + ${bucketNs / 2n}) / ${bucketNs} * ${bucketNs} as tsq,
- count(value) as count,
- avg(value) as avgValue,
- min(displayValue) as minDisplayValue,
- max(displayValue) as maxDisplayValue,
- value_at_max_ts(ts, displayValue) as lastDisplayValue
- FROM data
- ${constraint}
+ min_value as minDisplayValue,
+ max_value as maxDisplayValue,
+ last_ts as ts,
+ last_value as lastDisplayValue
+ FROM counter_${this.trackKey}(
+ ${countersKey.start},
+ ${countersKey.end},
+ ${countersKey.bucketSize}
+ );
`);
const it = queryRes.iter({
- tsq: LONG,
- count: NUM,
- avgValue: NUM,
+ ts: LONG,
minDisplayValue: NUM,
maxDisplayValue: NUM,
lastDisplayValue: NUM,
@@ -932,8 +885,6 @@ export abstract class BaseCounterTrack implements Track {
const numRows = queryRes.numRows();
const data: CounterData = {
timestamps: new BigInt64Array(numRows),
- counts: new Uint32Array(numRows),
- avgValues: new Float64Array(numRows),
minDisplayValues: new Float64Array(numRows),
maxDisplayValues: new Float64Array(numRows),
lastDisplayValues: new Float64Array(numRows),
@@ -943,10 +894,7 @@ export abstract class BaseCounterTrack implements Track {
let min = 0;
let max = 0;
for (let row = 0; it.valid(); it.next(), row++) {
- const ts = Time.fromRaw(it.tsq);
- data.timestamps[row] = ts;
- data.counts[row] = it.count;
- data.avgValues[row] = it.avgValue;
+ data.timestamps[row] = Time.fromRaw(it.ts);
data.minDisplayValues[row] = it.minDisplayValue;
data.maxDisplayValues[row] = it.maxDisplayValue;
data.lastDisplayValues[row] = it.lastDisplayValue;
@@ -956,7 +904,6 @@ export abstract class BaseCounterTrack implements Track {
data.displayValueRange = [min, max];
- this.cache.insert(countersKey, data);
this.countersKey = countersKey;
this.counters = data;
diff --git a/ui/src/tracks/counter/index.ts b/ui/src/tracks/counter/index.ts
index 5fdf93821..55773cd87 100644
--- a/ui/src/tracks/counter/index.ts
+++ b/ui/src/tracks/counter/index.ts
@@ -136,22 +136,24 @@ export class TraceProcessorCounterTrack extends BaseCounterTrack {
const time = visibleTimeScale.pxToHpTime(x).toTime('floor');
const query = `
- WITH X AS (
- SELECT
- id,
- ts AS leftTs,
- LEAD(ts) OVER (ORDER BY ts) AS rightTs
- FROM counter
- WHERE track_id = ${this.trackId}
- ORDER BY ts
- )
- SELECT
+ select
id,
- leftTs,
- rightTs
- FROM X
- WHERE rightTs > ${time}
- LIMIT 1
+ ts as leftTs,
+ (
+ select ts
+ from ${this.rootTable}
+ where
+ track_id = ${this.trackId}
+ and ts >= ${time}
+ order by ts
+ limit 1
+ ) as rightTs
+ from ${this.rootTable}
+ where
+ track_id = ${this.trackId}
+ and ts < ${time}
+ order by ts DESC
+ limit 1
`;
this.engine.query(query).then((result) => {