Skip to content

Commit

Permalink
metrics: Specify action of Wattson app startup
Browse files Browse the repository at this point in the history
Add the action, rails, to the suffix of the Wattson app startup metric.
The format is now wattson_<time window>_<action>.

In this case, the new metric is wattson_app_startup_rails.

Test: tools/diff_test_trace_processor.py out/linux/trace_processor_shell --name-filter '.*wattson.*'
Bug: 352627297
Change-Id: If78f6906a57204af8bffcfcb6fbd11bbc146a5bb
Signed-off-by: Samuel Wu <[email protected]>
  • Loading branch information
Samuel Wu committed Aug 12, 2024
1 parent 900e4c4 commit 7a3cdf2
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -12956,7 +12956,7 @@ genrule {
"src/trace_processor/metrics/sql/android/sysui_notif_shade_list_builder_slices.sql",
"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_app_startup_rails.sql",
"src/trace_processor/metrics/sql/android/wattson_rail_relations.sql",
"src/trace_processor/metrics/sql/android/wattson_tasks_attribution.sql",
"src/trace_processor/metrics/sql/android/wattson_trace_rails.sql",
Expand Down
2 changes: 1 addition & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2205,7 +2205,7 @@ perfetto_filegroup(
"src/trace_processor/metrics/sql/android/sysui_notif_shade_list_builder_slices.sql",
"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_app_startup_rails.sql",
"src/trace_processor/metrics/sql/android/wattson_rail_relations.sql",
"src/trace_processor/metrics/sql/android/wattson_tasks_attribution.sql",
"src/trace_processor/metrics/sql/android/wattson_trace_rails.sql",
Expand Down
4 changes: 2 additions & 2 deletions protos/perfetto/metrics/metrics.proto
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ message TraceMetrics {
// Android Broadcasts aggregated metrics
optional AndroidBroadcastsMetric android_broadcasts = 68;

// Android Wattson app startup metrics.
optional AndroidWattsonTimePeriodMetric wattson_app_startup = 69;
// Android Wattson rail estimate for each app startup.
optional AndroidWattsonTimePeriodMetric wattson_app_startup_rails = 69;

// Android Wattson rail estimate for duration of entire trace.
optional AndroidWattsonTimePeriodMetric wattson_trace_rails = 70;
Expand Down
4 changes: 2 additions & 2 deletions protos/perfetto/metrics/perfetto_merged_metrics.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3193,8 +3193,8 @@ message TraceMetrics {
// Android Broadcasts aggregated metrics
optional AndroidBroadcastsMetric android_broadcasts = 68;

// Android Wattson app startup metrics.
optional AndroidWattsonTimePeriodMetric wattson_app_startup = 69;
// Android Wattson rail estimate for each app startup.
optional AndroidWattsonTimePeriodMetric wattson_app_startup_rails = 69;

// Android Wattson rail estimate for duration of entire trace.
optional AndroidWattsonTimePeriodMetric wattson_trace_rails = 70;
Expand Down
8 changes: 4 additions & 4 deletions python/perfetto/trace_processor/metrics.descriptor
Original file line number Diff line number Diff line change
Expand Up @@ -1487,7 +1487,7 @@ threadName!
thread_id (RthreadId

process_id (R processId
�O
�O
%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<protos/perfetto/metrics/android/android_anomaly_metric.proto?protos/perfetto/metrics/android/wattson_tasks_attribution.proto"�
TraceMetadata*
trace_duration_ns (RtraceDurationNs
Expand Down Expand Up @@ -1518,7 +1518,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 @@ -1586,8 +1586,8 @@ androidAnrw
android_auto_multiuser@ ( 2+.perfetto.protos.AndroidAutoMultiuserMetricRandroidAutoMultiuserk
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_
android_broadcastsD ( 2(.perfetto.protos.AndroidBroadcastsMetricRandroidBroadcastsj
wattson_app_startup_railsE ( 2/.perfetto.protos.AndroidWattsonTimePeriodMetricRwattsonAppStartupRails_
wattson_trace_railsF ( 2/.perfetto.protos.AndroidWattsonTimePeriodMetricRwattsonTraceRailsN
android_anomalyG ( 2%.perfetto.protos.AndroidAnomalyMetricRandroidAnomalyi
wattson_trace_threadsH ( 25.perfetto.protos.AndroidWattsonTasksAttributionMetricRwattsonTraceThreads*��*��*��*��JJ
Expand Down
2 changes: 1 addition & 1 deletion src/trace_processor/metrics/sql/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ perfetto_sql_source_set("android") {
"sysui_notif_shade_list_builder_slices.sql",
"sysui_update_notif_on_ui_mode_changed_metric.sql",
"unsymbolized_frames.sql",
"wattson_app_startup.sql",
"wattson_app_startup_rails.sql",
"wattson_rail_relations.sql",
"wattson_tasks_attribution.sql",
"wattson_trace_rails.sql",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ SELECT RUN_METRIC(
'window_table', '_app_startup_window'
);

DROP VIEW IF EXISTS wattson_app_startup_output;
CREATE PERFETTO VIEW wattson_app_startup_output AS
DROP VIEW IF EXISTS wattson_app_startup_rails_output;
CREATE PERFETTO VIEW wattson_app_startup_rails_output AS
SELECT AndroidWattsonTimePeriodMetric(
'metric_version', 2,
'period_info', (
Expand Down
6 changes: 3 additions & 3 deletions test/trace_processor/diff_tests/metrics/android/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,12 @@ def test_android_broadcasts(self):
query=Metric("android_broadcasts"),
out=Path('android_broadcasts.out'))

def test_wattson_app_startup_output(self):
def test_wattson_app_startup_rails_output(self):
return DiffTestBlueprint(
trace=DataPath('android_calculator_startup.pb'),
query=Metric("wattson_app_startup"),
query=Metric("wattson_app_startup_rails"),
out=Csv("""
wattson_app_startup {
wattson_app_startup_rails {
metric_version: 2
period_info {
period_id: 1
Expand Down

0 comments on commit 7a3cdf2

Please sign in to comment.