Skip to content

Commit

Permalink
Merge changes from topic "wattson_estimate_metric" into main
Browse files Browse the repository at this point in the history
* changes:
  metrics: Add period_type for Wattson estimation
  metric: Add Wattson estimate metric
  metrics: Refactor app_startup to be time_period
  metrics: Move Wattson metric to stdlib for reusability
  • Loading branch information
Samuel Wu authored and Gerrit Code Review committed Jul 25, 2024
2 parents eed6cb5 + 0f5c342 commit 7053c26
Show file tree
Hide file tree
Showing 12 changed files with 341 additions and 204 deletions.
8 changes: 5 additions & 3 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -5304,7 +5304,7 @@ genrule {
"protos/perfetto/metrics/android/thread_time_in_state_metric.proto",
"protos/perfetto/metrics/android/trace_quality.proto",
"protos/perfetto/metrics/android/unsymbolized_frames.proto",
"protos/perfetto/metrics/android/wattson_app_startup.proto",
"protos/perfetto/metrics/android/wattson_in_time_period.proto",
"protos/perfetto/metrics/chrome/all_chrome_metrics.proto",
"protos/perfetto/metrics/chrome/args_class_names.proto",
"protos/perfetto/metrics/chrome/dropped_frames.proto",
Expand Down Expand Up @@ -5398,7 +5398,7 @@ genrule {
"protos/perfetto/metrics/android/thread_time_in_state_metric.proto",
"protos/perfetto/metrics/android/trace_quality.proto",
"protos/perfetto/metrics/android/unsymbolized_frames.proto",
"protos/perfetto/metrics/android/wattson_app_startup.proto",
"protos/perfetto/metrics/android/wattson_in_time_period.proto",
"protos/perfetto/metrics/metrics.proto",
],
tools: [
Expand Down Expand Up @@ -5476,7 +5476,7 @@ genrule {
"protos/perfetto/metrics/android/thread_time_in_state_metric.proto",
"protos/perfetto/metrics/android/trace_quality.proto",
"protos/perfetto/metrics/android/unsymbolized_frames.proto",
"protos/perfetto/metrics/android/wattson_app_startup.proto",
"protos/perfetto/metrics/android/wattson_in_time_period.proto",
"protos/perfetto/metrics/metrics.proto",
"protos/perfetto/metrics/webview/all_webview_metrics.proto",
"protos/perfetto/metrics/webview/webview_jank_approximation.proto",
Expand Down Expand Up @@ -12960,6 +12960,8 @@ genrule {
"src/trace_processor/metrics/sql/android/sysui_update_notif_on_ui_mode_changed_metric.sql",
"src/trace_processor/metrics/sql/android/unsymbolized_frames.sql",
"src/trace_processor/metrics/sql/android/wattson_app_startup.sql",
"src/trace_processor/metrics/sql/android/wattson_estimate.sql",
"src/trace_processor/metrics/sql/android/wattson_rail_relations.sql",
"src/trace_processor/metrics/sql/chrome/actual_power_by_category.sql",
"src/trace_processor/metrics/sql/chrome/actual_power_by_rail_mode.sql",
"src/trace_processor/metrics/sql/chrome/chrome_args_class_names.sql",
Expand Down
4 changes: 3 additions & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2194,6 +2194,8 @@ perfetto_filegroup(
"src/trace_processor/metrics/sql/android/sysui_update_notif_on_ui_mode_changed_metric.sql",
"src/trace_processor/metrics/sql/android/unsymbolized_frames.sql",
"src/trace_processor/metrics/sql/android/wattson_app_startup.sql",
"src/trace_processor/metrics/sql/android/wattson_estimate.sql",
"src/trace_processor/metrics/sql/android/wattson_rail_relations.sql",
],
)

Expand Down Expand Up @@ -4801,7 +4803,7 @@ perfetto_proto_library(
"protos/perfetto/metrics/android/thread_time_in_state_metric.proto",
"protos/perfetto/metrics/android/trace_quality.proto",
"protos/perfetto/metrics/android/unsymbolized_frames.proto",
"protos/perfetto/metrics/android/wattson_app_startup.proto",
"protos/perfetto/metrics/android/wattson_in_time_period.proto",
],
visibility = [
PERFETTO_CONFIG.proto_library_visibility,
Expand Down
2 changes: 1 addition & 1 deletion protos/perfetto/metrics/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@ perfetto_proto_library("@TYPE@") {
"thread_time_in_state_metric.proto",
"trace_quality.proto",
"unsymbolized_frames.proto",
"wattson_app_startup.proto",
"wattson_in_time_period.proto",
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ package perfetto.protos;

message AndroidWattsonTimePeriodMetric {
optional int32 metric_version = 1;
repeated AndroidWattsonEstimateInfo period_info = 2;
optional string period_type = 2;
repeated AndroidWattsonEstimateInfo period_info = 3;
}

message AndroidWattsonEstimateInfo {
Expand Down
7 changes: 5 additions & 2 deletions protos/perfetto/metrics/metrics.proto
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ 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";
import "protos/perfetto/metrics/android/android_broadcasts_metric.proto";
import "protos/perfetto/metrics/android/wattson_app_startup.proto";
import "protos/perfetto/metrics/android/wattson_in_time_period.proto";

// Trace processor metadata
message TraceMetadata {
Expand Down Expand Up @@ -122,7 +122,7 @@ message TraceAnalysisStats {

// Root message for all Perfetto-based metrics.
//
// Next id: 70
// Next id: 71
message TraceMetrics {
reserved 4, 10, 13, 14, 16, 19;

Expand Down Expand Up @@ -320,6 +320,9 @@ message TraceMetrics {
// Android Wattson app startup metrics.
optional AndroidWattsonTimePeriodMetric wattson_app_startup = 69;

// Android Wattson estimate for markers metrics.
optional AndroidWattsonTimePeriodMetric wattson_estimate = 70;

// Android
// Demo extensions.
extensions 450 to 499;
Expand Down
12 changes: 8 additions & 4 deletions protos/perfetto/metrics/perfetto_merged_metrics.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2840,11 +2840,12 @@ message UnsymbolizedFrames {

// End of protos/perfetto/metrics/android/unsymbolized_frames.proto

// Begin of protos/perfetto/metrics/android/wattson_app_startup.proto
// Begin of protos/perfetto/metrics/android/wattson_in_time_period.proto

message AndroidWattsonTimePeriodMetric {
optional int32 metric_version = 1;
repeated AndroidWattsonEstimateInfo period_info = 2;
optional string period_type = 2;
repeated AndroidWattsonEstimateInfo period_info = 3;
}

message AndroidWattsonEstimateInfo {
Expand All @@ -2859,7 +2860,7 @@ message AndroidWattsonRailEstimate {
repeated AndroidWattsonRailEstimate rail = 3;
}

// End of protos/perfetto/metrics/android/wattson_app_startup.proto
// End of protos/perfetto/metrics/android/wattson_in_time_period.proto

// Begin of protos/perfetto/metrics/metrics.proto

Expand Down Expand Up @@ -2908,7 +2909,7 @@ message TraceAnalysisStats {

// Root message for all Perfetto-based metrics.
//
// Next id: 70
// Next id: 71
message TraceMetrics {
reserved 4, 10, 13, 14, 16, 19;

Expand Down Expand Up @@ -3106,6 +3107,9 @@ message TraceMetrics {
// Android Wattson app startup metrics.
optional AndroidWattsonTimePeriodMetric wattson_app_startup = 69;

// Android Wattson estimate for markers metrics.
optional AndroidWattsonTimePeriodMetric wattson_estimate = 70;

// Android
// Demo extensions.
extensions 450 to 499;
Expand Down
19 changes: 11 additions & 8 deletions python/perfetto/trace_processor/metrics.descriptor
Original file line number Diff line number Diff line change
Expand Up @@ -1408,11 +1408,13 @@ destBucket
avg_duration (R avgDuration!
max_duration (R maxDuration!
sum_duration (R sumDuration
�
9protos/perfetto/metrics/android/wattson_app_startup.protoperfetto.protos"�
�
<protos/perfetto/metrics/android/wattson_in_time_period.protoperfetto.protos"�
AndroidWattsonTimePeriodMetric%
metric_version (RmetricVersionL
period_info ( 2+.perfetto.protos.AndroidWattsonEstimateInfoR
metric_version (RmetricVersion
period_type ( R
periodTypeL
period_info ( 2+.perfetto.protos.AndroidWattsonEstimateInfoR
periodInfo"�
AndroidWattsonEstimateInfo
period_id (RperiodId
Expand All @@ -1424,8 +1426,8 @@ period_dur (R periodDur?
estimate_mw (R
estimateMw?
rail ( 2+.perfetto.protos.AndroidWattsonRailEstimateRrail
L
%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.proto1protos/perfetto/metrics/android/auto_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.proto;protos/perfetto/metrics/android/java_heap_class_stats.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?protos/perfetto/metrics/android/android_broadcasts_metric.proto9protos/perfetto/metrics/android/wattson_app_startup.proto"�
M
%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.proto1protos/perfetto/metrics/android/auto_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.proto;protos/perfetto/metrics/android/java_heap_class_stats.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?protos/perfetto/metrics/android/android_broadcasts_metric.proto<protos/perfetto/metrics/android/wattson_in_time_period.proto"�
TraceMetadata*
trace_duration_ns (RtraceDurationNs

Expand Down Expand Up @@ -1455,7 +1457,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
Expand Down Expand Up @@ -1524,5 +1526,6 @@ androidAnrw
android_blocking_calls_unaggA ( 2*.perfetto.protos.AndroidBlockingCallsUnaggRandroidBlockingCallsUnagg[
android_oom_adjusterB ( 2).perfetto.protos.AndroidOomAdjusterMetricRandroidOomAdjusterW
android_broadcastsD ( 2(.perfetto.protos.AndroidBroadcastsMetricRandroidBroadcasts_
wattson_app_startupE ( 2/.perfetto.protos.AndroidWattsonTimePeriodMetricRwattsonAppStartup*��*��*��*��JJ
wattson_app_startupE ( 2/.perfetto.protos.AndroidWattsonTimePeriodMetricRwattsonAppStartupZ
wattson_estimateF ( 2/.perfetto.protos.AndroidWattsonTimePeriodMetricRwattsonEstimate*��*��*��*��JJ
 JJJJJJJ
Expand Down
2 changes: 2 additions & 0 deletions src/trace_processor/metrics/sql/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,7 @@ perfetto_sql_source_set("android") {
"sysui_update_notif_on_ui_mode_changed_metric.sql",
"unsymbolized_frames.sql",
"wattson_app_startup.sql",
"wattson_estimate.sql",
"wattson_rail_relations.sql",
]
}
Loading

0 comments on commit 7053c26

Please sign in to comment.