diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2021-11-01 14:43:58 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-11-01 14:43:58 +0000 |
commit | 64c75cd2b8670332cf44747705be38024e6e9bac (patch) | |
tree | b33900d3c31d31f9761a65b65d353345c1ef8cc9 | |
parent | 50df86c10344bf6fcdace13247341f96c657946c (diff) | |
parent | f97353ec784ee88fb58c7e3ff270b545647ada3b (diff) | |
download | perfetto-64c75cd2b8670332cf44747705be38024e6e9bac.tar.gz |
Merge "tp: reorganize startup metric"
-rw-r--r-- | Android.bp | 4 | ||||
-rw-r--r-- | BUILD | 4 | ||||
-rw-r--r-- | src/trace_processor/metrics/BUILD.gn | 4 | ||||
-rw-r--r-- | src/trace_processor/metrics/android/android_startup.sql | 4 | ||||
-rw-r--r-- | src/trace_processor/metrics/android/startup/hsc.sql (renamed from src/trace_processor/metrics/android/hsc_startups.sql) | 0 | ||||
-rw-r--r-- | src/trace_processor/metrics/android/startup/launches.sql (renamed from src/trace_processor/metrics/android/android_startup_launches.sql) | 46 |
6 files changed, 31 insertions, 31 deletions
diff --git a/Android.bp b/Android.bp index 1908394c8..1887b5049 100644 --- a/Android.bp +++ b/Android.bp @@ -8014,7 +8014,6 @@ genrule { "src/trace_processor/metrics/android/android_proxy_power.sql", "src/trace_processor/metrics/android/android_simpleperf.sql", "src/trace_processor/metrics/android/android_startup.sql", - "src/trace_processor/metrics/android/android_startup_launches.sql", "src/trace_processor/metrics/android/android_surfaceflinger.sql", "src/trace_processor/metrics/android/android_sysui_cuj.sql", "src/trace_processor/metrics/android/android_sysui_cuj_jank_query.sql", @@ -8030,7 +8029,6 @@ genrule { "src/trace_processor/metrics/android/g2d_duration.sql", "src/trace_processor/metrics/android/global_counter_span_view.sql", "src/trace_processor/metrics/android/gpu_counter_span_view.sql", - "src/trace_processor/metrics/android/hsc_startups.sql", "src/trace_processor/metrics/android/java_heap_histogram.sql", "src/trace_processor/metrics/android/java_heap_stats.sql", "src/trace_processor/metrics/android/mem_stats_priority_breakdown.sql", @@ -8043,6 +8041,8 @@ genrule { "src/trace_processor/metrics/android/process_unagg_mem_view.sql", "src/trace_processor/metrics/android/profiler_smaps.sql", "src/trace_processor/metrics/android/span_view_stats.sql", + "src/trace_processor/metrics/android/startup/hsc.sql", + "src/trace_processor/metrics/android/startup/launches.sql", "src/trace_processor/metrics/android/thread_counter_span_view.sql", "src/trace_processor/metrics/android/unsymbolized_frames.sql", "src/trace_processor/metrics/chrome/actual_power_by_category.sql", @@ -1040,7 +1040,6 @@ perfetto_genrule( "src/trace_processor/metrics/android/android_proxy_power.sql", "src/trace_processor/metrics/android/android_simpleperf.sql", "src/trace_processor/metrics/android/android_startup.sql", - "src/trace_processor/metrics/android/android_startup_launches.sql", "src/trace_processor/metrics/android/android_surfaceflinger.sql", "src/trace_processor/metrics/android/android_sysui_cuj.sql", "src/trace_processor/metrics/android/android_sysui_cuj_jank_query.sql", @@ -1056,7 +1055,6 @@ perfetto_genrule( "src/trace_processor/metrics/android/g2d_duration.sql", "src/trace_processor/metrics/android/global_counter_span_view.sql", "src/trace_processor/metrics/android/gpu_counter_span_view.sql", - "src/trace_processor/metrics/android/hsc_startups.sql", "src/trace_processor/metrics/android/java_heap_histogram.sql", "src/trace_processor/metrics/android/java_heap_stats.sql", "src/trace_processor/metrics/android/mem_stats_priority_breakdown.sql", @@ -1069,6 +1067,8 @@ perfetto_genrule( "src/trace_processor/metrics/android/process_unagg_mem_view.sql", "src/trace_processor/metrics/android/profiler_smaps.sql", "src/trace_processor/metrics/android/span_view_stats.sql", + "src/trace_processor/metrics/android/startup/hsc.sql", + "src/trace_processor/metrics/android/startup/launches.sql", "src/trace_processor/metrics/android/thread_counter_span_view.sql", "src/trace_processor/metrics/android/unsymbolized_frames.sql", "src/trace_processor/metrics/chrome/actual_power_by_category.sql", diff --git a/src/trace_processor/metrics/BUILD.gn b/src/trace_processor/metrics/BUILD.gn index 72eb2e4ad..1bcb76ee4 100644 --- a/src/trace_processor/metrics/BUILD.gn +++ b/src/trace_processor/metrics/BUILD.gn @@ -40,7 +40,6 @@ sql_files = [ "android/android_powrails.sql", "android/android_proxy_power.sql", "android/android_simpleperf.sql", - "android/android_startup_launches.sql", "android/android_startup.sql", "android/android_package_list.sql", "android/android_task_names.sql", @@ -50,7 +49,6 @@ sql_files = [ "android/display_metrics.sql", "android/g2d.sql", "android/g2d_duration.sql", - "android/hsc_startups.sql", "android/android_hwcomposer.sql", "android/android_hwui_metric.sql", "android/java_heap_histogram.sql", @@ -73,6 +71,8 @@ sql_files = [ "android/gpu_counter_span_view.sql", "android/thread_counter_span_view.sql", "android/unsymbolized_frames.sql", + "android/startup/launches.sql", + "android/startup/hsc.sql", "chrome/actual_power_by_category.sql", "chrome/actual_power_by_rail_mode.sql", "chrome/chrome_event_metadata.sql", diff --git a/src/trace_processor/metrics/android/android_startup.sql b/src/trace_processor/metrics/android/android_startup.sql index d347a50b6..f561d52bf 100644 --- a/src/trace_processor/metrics/android/android_startup.sql +++ b/src/trace_processor/metrics/android/android_startup.sql @@ -15,9 +15,9 @@ -- -- Create the base tables and views containing the launch spans. -SELECT RUN_METRIC('android/android_startup_launches.sql'); +SELECT RUN_METRIC('android/startup/launches.sql'); +SELECT RUN_METRIC('android/startup/hsc.sql'); SELECT RUN_METRIC('android/process_metadata.sql'); -SELECT RUN_METRIC('android/hsc_startups.sql'); -- Create the base CPU span join table. SELECT RUN_METRIC('android/android_cpu_agg.sql'); diff --git a/src/trace_processor/metrics/android/hsc_startups.sql b/src/trace_processor/metrics/android/startup/hsc.sql index 5c0a6181e..5c0a6181e 100644 --- a/src/trace_processor/metrics/android/hsc_startups.sql +++ b/src/trace_processor/metrics/android/startup/hsc.sql diff --git a/src/trace_processor/metrics/android/android_startup_launches.sql b/src/trace_processor/metrics/android/startup/launches.sql index c5829d75a..104ec40e3 100644 --- a/src/trace_processor/metrics/android/android_startup_launches.sql +++ b/src/trace_processor/metrics/android/startup/launches.sql @@ -14,22 +14,6 @@ -- limitations under the License. -- --- The start of the launching event corresponds to the end of the AM handling --- the startActivity intent, whereas the end corresponds to the first frame drawn. --- Only successful app launches have a launching event. -DROP TABLE IF EXISTS launching_events; -CREATE TABLE launching_events AS -SELECT - ts, - dur, - ts + dur AS ts_end, - STR_SPLIT(s.name, ": ", 1) AS package_name -FROM slice s -JOIN process_track t ON s.track_id = t.id -JOIN process USING(upid) -WHERE s.name LIKE 'launching: %' -AND (process.name IS NULL OR process.name = 'system_server'); - -- Marks the beginning of the trace and is equivalent to when the statsd launch -- logging begins. DROP VIEW IF EXISTS activity_intent_received; @@ -37,13 +21,6 @@ CREATE VIEW activity_intent_received AS SELECT ts FROM slice WHERE name = 'MetricsLogger:launchObserverNotifyIntentStarted'; --- Successful activity launch. The end of the 'launching' event is not related --- to whether it actually succeeded or not. -DROP VIEW IF EXISTS activity_intent_launch_successful; -CREATE VIEW activity_intent_launch_successful AS -SELECT ts FROM slice -WHERE name = 'MetricsLogger:launchObserverNotifyActivityLaunchFinished'; - -- We partition the trace into spans based on posted activity intents. -- We will refine these progressively in the next steps to only encompass -- activity starts. @@ -59,6 +36,22 @@ SELECT FROM activity_intent_received ORDER BY ts; +-- The start of the launching event corresponds to the end of the AM handling +-- the startActivity intent, whereas the end corresponds to the first frame drawn. +-- Only successful app launches have a launching event. +DROP TABLE IF EXISTS launching_events; +CREATE TABLE launching_events AS +SELECT + ts, + dur, + ts + dur AS ts_end, + STR_SPLIT(s.name, ": ", 1) AS package_name +FROM slice s +JOIN process_track t ON s.track_id = t.id +JOIN process USING(upid) +WHERE s.name LIKE 'launching: %' +AND (process.name IS NULL OR process.name = 'system_server'); + -- Filter activity_intent_recv_spans, keeping only the ones that triggered -- a launch. DROP VIEW IF EXISTS launch_partitions; @@ -69,6 +62,13 @@ WHERE 1 = ( FROM launching_events WHERE launching_events.ts BETWEEN spans.ts AND spans.ts + spans.dur); +-- Successful activity launch. The end of the 'launching' event is not related +-- to whether it actually succeeded or not. +DROP VIEW IF EXISTS activity_intent_launch_successful; +CREATE VIEW activity_intent_launch_successful AS +SELECT ts FROM slice +WHERE name = 'MetricsLogger:launchObserverNotifyActivityLaunchFinished'; + -- All activity launches in the trace, keyed by ID. DROP TABLE IF EXISTS launches; CREATE TABLE launches( |