From d007277e0fd97cc3a54a59d328e5e8f3200f3160 Mon Sep 17 00:00:00 2001 From: Anna Mayzner Date: Fri, 22 Nov 2024 14:08:39 +0000 Subject: [PATCH] stdlib: Add Duration type Change-Id: I03c1ed8a077acf62b835e49027b5d64f87b4839a --- include/perfetto/ext/base/string_view.h | 10 + python/generators/sql_processing/utils.py | 3 +- src/base/string_view_unittest.cc | 4 + .../stdlib/android/app_process_starts.sql | 6 +- .../android/battery/charging_states.sql | 2 +- .../stdlib/android/battery_stats.sql | 16 +- .../perfetto_sql/stdlib/android/binder.sql | 14 +- .../stdlib/android/binder_breakdown.sql | 4 +- .../stdlib/android/broadcasts.sql | 2 +- .../stdlib/android/desktop_mode.sql | 24 +- .../perfetto_sql/stdlib/android/dvfs.sql | 6 +- .../android/frames/per_frame_metrics.sql | 4 +- .../stdlib/android/frames/timeline.sql | 4 +- .../android/frames/timeline_maxsdk28.sql | 2 +- .../perfetto_sql/stdlib/android/freezer.sql | 2 +- .../stdlib/android/garbage_collection.sql | 10 +- .../stdlib/android/gpu/frequency.sql | 2 +- .../stdlib/android/gpu/memory.sql | 2 +- .../perfetto_sql/stdlib/android/input.sql | 14 +- .../perfetto_sql/stdlib/android/io.sql | 2 +- .../stdlib/android/job_scheduler.sql | 2 +- .../stdlib/android/job_scheduler_states.sql | 6 +- .../stdlib/android/memory/process.sql | 4 +- .../stdlib/android/monitor_contention.sql | 252 +++++++++--------- .../stdlib/android/network_packets.sql | 4 +- .../stdlib/android/oom_adjuster.sql | 4 +- .../stdlib/android/power_rails.sql | 2 +- .../stdlib/android/screenshots.sql | 2 +- .../perfetto_sql/stdlib/android/services.sql | 4 +- .../android/startup/startup_breakdowns.sql | 2 +- .../stdlib/android/startup/startups.sql | 8 +- .../perfetto_sql/stdlib/android/statsd.sql | 6 +- .../perfetto_sql/stdlib/android/suspend.sql | 4 +- .../stdlib/chrome/chrome_scrolls.sql | 2 +- .../stdlib/chrome/cpu_powerups.sql | 36 +-- .../stdlib/chrome/event_latency.sql | 4 +- .../stdlib/chrome/graphics_pipeline.sql | 4 +- .../perfetto_sql/stdlib/chrome/input.sql | 4 +- .../stdlib/chrome/interactions.sql | 2 +- .../perfetto_sql/stdlib/chrome/page_loads.sql | 2 +- .../stdlib/chrome/scroll_interactions.sql | 2 +- .../scroll_jank/scroll_jank_intervals.sql | 6 +- .../chrome/scroll_jank/scroll_jank_v3.sql | 12 +- .../scroll_jank/scroll_jank_v3_cause.sql | 2 +- .../stdlib/chrome/speedometer.sql | 4 +- .../stdlib/chrome/speedometer_2_1.sql | 4 +- .../stdlib/chrome/speedometer_3.sql | 4 +- .../perfetto_sql/stdlib/chrome/tasks.sql | 10 +- .../stdlib/chrome/vsync_intervals.sql | 2 +- .../chrome/web_content_interactions.sql | 2 +- .../stdlib/counters/intervals.sql | 2 +- .../stdlib/graphs/critical_path.sql | 2 +- .../stdlib/linux/cpu/frequency.sql | 2 +- .../perfetto_sql/stdlib/linux/cpu/idle.sql | 2 +- .../stdlib/linux/cpu/idle_stats.sql | 8 +- .../stdlib/linux/cpu/utilization/slice.sql | 8 +- .../perfetto_sql/stdlib/linux/devfreq.sql | 4 +- .../stdlib/linux/memory/high_watermark.sql | 2 +- .../stdlib/linux/memory/process.sql | 2 +- .../perfetto_sql/stdlib/pkvm/hypervisor.sql | 6 +- .../stdlib/prelude/after_eof/tables_views.sql | 20 +- .../stdlib/prelude/after_eof/views.sql | 14 +- .../prelude/before_eof/trace_bounds.sql | 12 +- .../stdlib/sched/thread_executing_span.sql | 4 +- .../thread_executing_span_with_slice.sql | 12 +- .../stdlib/sched/thread_state_flattened.sql | 4 +- .../stdlib/sched/time_in_state.sql | 8 +- .../perfetto_sql/stdlib/slices/hierarchy.sql | 4 +- .../perfetto_sql/stdlib/slices/slices.sql | 2 +- .../stdlib/slices/time_in_state.sql | 2 +- .../stdlib/slices/with_context.sql | 4 +- .../perfetto_sql/stdlib/time/conversion.sql | 24 +- .../perfetto_sql/stdlib/wattson/arm_dsu.sql | 2 +- .../stdlib/wattson/curves/estimates.sql | 2 +- .../stdlib/wattson/system_state.sql | 2 +- src/trace_processor/util/sql_argument.cc | 29 +- src/trace_processor/util/sql_argument.h | 9 +- 77 files changed, 374 insertions(+), 353 deletions(-) diff --git a/include/perfetto/ext/base/string_view.h b/include/perfetto/ext/base/string_view.h index 1fe3696a8c..1563be572c 100644 --- a/include/perfetto/ext/base/string_view.h +++ b/include/perfetto/ext/base/string_view.h @@ -21,6 +21,7 @@ #include #include +#include #include "perfetto/base/build_config.h" #include "perfetto/base/logging.h" @@ -120,6 +121,15 @@ class StringView { #endif } + bool CaseInsensitiveOneOf(const std::vector& others) const { + for (const StringView& other : others) { + if (CaseInsensitiveEq(other)) { + return true; + } + } + return false; + } + bool StartsWith(const StringView& other) const { if (other.size() == 0) return true; diff --git a/python/generators/sql_processing/utils.py b/python/generators/sql_processing/utils.py index 6d79c8cd6f..19d4d39258 100644 --- a/python/generators/sql_processing/utils.py +++ b/python/generators/sql_processing/utils.py @@ -42,7 +42,8 @@ 'BYTES', # Special types - 'TIMESTAMP' + 'TIMESTAMP', + 'DURATION' ] MACRO_ARG_TYPES = ['TABLEORSUBQUERY', 'EXPR', 'COLUMNNAME'] diff --git a/src/base/string_view_unittest.cc b/src/base/string_view_unittest.cc index 3b1bac7fc2..212e99c3c8 100644 --- a/src/base/string_view_unittest.cc +++ b/src/base/string_view_unittest.cc @@ -62,6 +62,10 @@ TEST(StringViewTest, BasicCases) { EXPECT_FALSE(x.CaseInsensitiveEq("ab")); EXPECT_FALSE(x.CaseInsensitiveEq("abcd")); EXPECT_FALSE(x.CaseInsensitiveEq("")); + EXPECT_FALSE(x.CaseInsensitiveOneOf({})); + EXPECT_FALSE(x.CaseInsensitiveOneOf({"AbCd", "ab", "abcd"})); + EXPECT_TRUE(x.CaseInsensitiveOneOf({"aBc", "AbC"})); + EXPECT_TRUE(x.CaseInsensitiveOneOf({"AbCd", "aBc"})); } // Test find(char). diff --git a/src/trace_processor/perfetto_sql/stdlib/android/app_process_starts.sql b/src/trace_processor/perfetto_sql/stdlib/android/app_process_starts.sql index 29657cc72c..fffd128051 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/app_process_starts.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/app_process_starts.sql @@ -125,15 +125,15 @@ CREATE PERFETTO TABLE android_app_process_starts( -- Timestamp the process start was dispatched from system_server. proc_start_ts TIMESTAMP, -- Duration to dispatch the process start from system_server. - proc_start_dur LONG, + proc_start_dur DURATION, -- Timestamp the bindApplication started in the app. bind_app_ts TIMESTAMP, -- Duration to complete bindApplication in the app. - bind_app_dur LONG, + bind_app_dur DURATION, -- Timestamp the Intent was received in the app. intent_ts TIMESTAMP, -- Duration to handle intent in the app. - intent_dur LONG, + intent_dur DURATION, -- Total duration from proc_start dispatched to intent completed. total_dur LONG ) AS diff --git a/src/trace_processor/perfetto_sql/stdlib/android/battery/charging_states.sql b/src/trace_processor/perfetto_sql/stdlib/android/battery/charging_states.sql index 09147b17db..4cbd579e25 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/battery/charging_states.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/battery/charging_states.sql @@ -22,7 +22,7 @@ CREATE PERFETTO TABLE android_charging_states( -- Timestamp at which the device charging state began. ts TIMESTAMP, -- Duration of the device charging state. - dur LONG, + dur DURATION, -- Device charging state, one of: Charging, Discharging, Not charging -- (when the charger is present but battery is not charging), -- Full, Unknown diff --git a/src/trace_processor/perfetto_sql/stdlib/android/battery_stats.sql b/src/trace_processor/perfetto_sql/stdlib/android/battery_stats.sql index 93a21f2c6c..fea2218809 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/battery_stats.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/battery_stats.sql @@ -117,12 +117,12 @@ SELECT -- by BatteryStats as a bitmap where each 'category' has a unique value at any -- given time. CREATE PERFETTO VIEW android_battery_stats_state( - -- Timestamp in nanoseconds. + -- Start of the new barrary state. ts TIMESTAMP, - -- The duration the state was active, may be negative for incomplete slices. - dur LONG, + -- The duration the state was active, -1 for incomplete slices. + dur DURATION, -- The same as `dur`, but extends to trace end for incomplete slices. - safe_dur LONG, + safe_dur DURATION, -- The name of the counter track. track_name STRING, -- The counter value as a number. @@ -161,12 +161,12 @@ WHERE counter_track.name GLOB 'battery_stats.*'; -- str_value='com.google.android.apps.nexuslauncher' -- int_value=10215 CREATE PERFETTO VIEW android_battery_stats_event_slices( - -- Timestamp in nanoseconds. + -- Start of a new battery state. ts TIMESTAMP, - -- The duration the state was active, may be negative for incomplete slices. - dur LONG, + -- The duration the state was active, -1 for incomplete slices. + dur DURATION, -- The same as `dur`, but extends to trace end for incomplete slices. - safe_dur LONG, + safe_dur DURATION, -- The name of the counter track. track_name STRING, -- String value. diff --git a/src/trace_processor/perfetto_sql/stdlib/android/binder.sql b/src/trace_processor/perfetto_sql/stdlib/android/binder.sql index bf9c37e3c9..c4fba5da4d 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/binder.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/binder.sql @@ -228,7 +228,7 @@ CREATE PERFETTO VIEW android_sync_binder_thread_state_by_txn( -- a thread_state that occurred in the txn thread_state STRING, -- aggregated dur of the |thread_state| in the txn - thread_state_dur LONG, + thread_state_dur DURATION, -- aggregated count of the |thread_state| in the txn thread_state_count LONG ) AS @@ -285,7 +285,7 @@ CREATE PERFETTO VIEW android_sync_binder_blocked_functions_by_txn( -- blocked kernel function in a thread state blocked_function STRING, -- aggregated dur of the |blocked_function| in the txn - blocked_function_dur LONG, + blocked_function_dur DURATION, -- aggregated count of the |blocked_function| in the txn blocked_function_count LONG ) AS @@ -405,7 +405,7 @@ CREATE PERFETTO TABLE android_binder_txns( -- Timestamp the binder interface name was emitted. Proxy to 'ts' and 'dur' for async txns. aidl_ts TIMESTAMP, -- Duration of the binder interface name. Proxy to 'ts' and 'dur' for async txns. - aidl_dur LONG, + aidl_dur DURATION, -- slice id of the binder txn. binder_txn_id LONG, -- name of the client process. @@ -425,7 +425,7 @@ CREATE PERFETTO TABLE android_binder_txns( -- timestamp of the client txn. client_ts TIMESTAMP, -- wall clock dur of the client txn. - client_dur LONG, + client_dur DURATION, -- slice id of the binder reply. binder_reply_id LONG, -- name of the server process. @@ -443,7 +443,7 @@ CREATE PERFETTO TABLE android_binder_txns( -- timestamp of the server txn. server_ts TIMESTAMP, -- wall clock dur of the server txn. - server_dur LONG, + server_dur DURATION, -- oom score of the client process at the start of the txn. client_oom_score LONG, -- oom score of the server process at the start of the reply. @@ -451,9 +451,9 @@ CREATE PERFETTO TABLE android_binder_txns( -- whether the txn is synchronous or async (oneway). is_sync BOOL, -- monotonic clock dur of the client txn. - client_monotonic_dur LONG, + client_monotonic_dur DURATION, -- monotonic clock dur of the server txn. - server_monotonic_dur LONG, + server_monotonic_dur DURATION, -- Client package version_code. client_package_version_code LONG, -- Server package version_code. diff --git a/src/trace_processor/perfetto_sql/stdlib/android/binder_breakdown.sql b/src/trace_processor/perfetto_sql/stdlib/android/binder_breakdown.sql index 6f1935c2c0..5a146ebb0e 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/binder_breakdown.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/binder_breakdown.sql @@ -176,7 +176,7 @@ CREATE PERFETTO TABLE android_binder_server_breakdown( -- Timestamp of an exclusive interval during the binder reply with a single reason. ts TIMESTAMP, -- Duration of an exclusive interval during the binder reply with a single reason. - dur LONG, + dur DURATION, -- Cause of delay during an exclusive interval of the binder reply. reason STRING ) @@ -198,7 +198,7 @@ CREATE PERFETTO TABLE android_binder_client_breakdown( -- Timestamp of an exclusive interval during the binder txn with a single latency reason. ts TIMESTAMP, -- Duration of an exclusive interval during the binder txn with a single latency reason. - dur LONG, + dur DURATION, -- Cause of delay during an exclusive interval of the binder txn. reason STRING ) diff --git a/src/trace_processor/perfetto_sql/stdlib/android/broadcasts.sql b/src/trace_processor/perfetto_sql/stdlib/android/broadcasts.sql index 61d3b8020a..b447d96209 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/broadcasts.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/broadcasts.sql @@ -46,7 +46,7 @@ CREATE PERFETTO TABLE _android_broadcasts_minsdk_u( -- Timestamp the broadcast was dispatched. ts TIMESTAMP, -- Duration to dispatch the broadcast. - dur LONG, + dur DURATION, -- Track id the broadcast was dispatched from. track_id LONG ) AS diff --git a/src/trace_processor/perfetto_sql/stdlib/android/desktop_mode.sql b/src/trace_processor/perfetto_sql/stdlib/android/desktop_mode.sql index 30337bd642..59fa310661 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/desktop_mode.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/desktop_mode.sql @@ -18,18 +18,18 @@ include perfetto module android.statsd; -- Desktop Windows with durations they were open. CREATE PERFETTO TABLE android_desktop_mode_windows ( --- Window add timestamp; NULL if no add event in the trace. -raw_add_ts TIMESTAMP, --- Window remove timestamp; NULL if no remove event in the trace. -raw_remove_ts TIMESTAMP, --- timestamp that the window was added; or trace_start() if no add event in the trace. -ts TIMESTAMP, --- duration the window was open; or until trace_end() if no remove event in the trace. -dur LONG, --- Desktop Window instance ID - unique per window. -instance_id LONG, --- UID of the app running in the window. -uid LONG + -- Window add timestamp; NULL if no add event in the trace. + raw_add_ts TIMESTAMP, + -- Window remove timestamp; NULL if no remove event in the trace. + raw_remove_ts TIMESTAMP, + -- Timestamp that the window was added; or trace_start() if no add event in the trace. + ts TIMESTAMP, + -- Furation the window was open; or until trace_end() if no remove event in the trace. + dur DURATION, + -- Desktop Window instance ID - unique per window. + instance_id LONG, + -- UID of the app running in the window. + uid LONG ) AS WITH atoms AS ( diff --git a/src/trace_processor/perfetto_sql/stdlib/android/dvfs.sql b/src/trace_processor/perfetto_sql/stdlib/android/dvfs.sql index 33c056dde5..36a49db266 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/dvfs.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/dvfs.sql @@ -22,7 +22,7 @@ CREATE PERFETTO VIEW android_dvfs_counters( -- Counter value. value DOUBLE, -- Counter duration. - dur LONG + dur DURATION ) AS SELECT counter_track.name, @@ -72,7 +72,7 @@ CREATE PERFETTO TABLE android_dvfs_counter_stats( -- Min of all counter values for the counter name. min DOUBLE, -- Duration between the first and last counter value for the counter name. - dur LONG, + dur DURATION, -- Weighted avergate of all the counter values for the counter name. wgt_avg DOUBLE ) AS @@ -94,7 +94,7 @@ CREATE PERFETTO VIEW android_dvfs_counter_residency( -- Counter value. value DOUBLE, -- Counter duration. - dur LONG, + dur DURATION, -- Counter duration as a percentage of total duration. pct DOUBLE ) AS diff --git a/src/trace_processor/perfetto_sql/stdlib/android/frames/per_frame_metrics.sql b/src/trace_processor/perfetto_sql/stdlib/android/frames/per_frame_metrics.sql index c98728c48e..eca28ef9ed 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/frames/per_frame_metrics.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/frames/per_frame_metrics.sql @@ -97,10 +97,10 @@ CREATE PERFETTO TABLE android_cpu_time_per_frame( -- `Choreographer#doFrame`. See `android_app_vsync_delay_per_frame` table for more details. app_vsync_delay LONG, -- Duration of `Choreographer#doFrame` slice. - do_frame_dur LONG, + do_frame_dur DURATION, -- Duration of `DrawFrame` slice. Summed duration of all `DrawFrame` -- slices, if more than one. See `android_frames_draw_frame` for more details. - draw_frame_dur LONG, + draw_frame_dur DURATION, -- CPU time across the UI Thread + RenderThread. cpu_time LONG ) AS diff --git a/src/trace_processor/perfetto_sql/stdlib/android/frames/timeline.sql b/src/trace_processor/perfetto_sql/stdlib/android/frames/timeline.sql index baf6ee2962..fbb0ddffd5 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/frames/timeline.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/frames/timeline.sql @@ -132,7 +132,7 @@ CREATE PERFETTO TABLE android_frames( -- Duration of the frame, as defined by the duration of the corresponding -- `actual_frame_timeline_slice` or, if not present the time between the -- `ts` and the end of the final `DrawFrame`. - dur LONG, + dur DURATION, -- `slice.id` of "Choreographer#doFrame" slice. do_frame_id LONG, -- `slice.id` of "DrawFrame" slice. @@ -221,7 +221,7 @@ RETURNS TABLE ( -- Start of the frame, the timestamp of the "Choreographer#doFrame" slice. ts TIMESTAMP, -- Duration of the frame. - dur LONG, + dur DURATION, -- `slice.id` of "Choreographer#doFrame" slice. do_frame_id LONG, -- `slice.id` of "DrawFrame" slice. diff --git a/src/trace_processor/perfetto_sql/stdlib/android/frames/timeline_maxsdk28.sql b/src/trace_processor/perfetto_sql/stdlib/android/frames/timeline_maxsdk28.sql index 2fdcf0b9b9..a90388d360 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/frames/timeline_maxsdk28.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/frames/timeline_maxsdk28.sql @@ -26,7 +26,7 @@ CREATE PERFETTO TABLE _frames_maxsdk_28( ts TIMESTAMP, -- Duration of the frame, defined as the duration until the last -- "DrawFrame" of this frame finishes. - dur LONG, + dur DURATION, -- `slice.id` of "Choreographer#doFrame" slice. do_frame_id LONG, -- `slice.id` of "DrawFrame" slice. Fetched as one of the "DrawFrame" diff --git a/src/trace_processor/perfetto_sql/stdlib/android/freezer.sql b/src/trace_processor/perfetto_sql/stdlib/android/freezer.sql index 6a30da2378..9a80c6cfc1 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/freezer.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/freezer.sql @@ -96,7 +96,7 @@ CREATE PERFETTO TABLE android_freezer_events ( -- Timestamp process was frozen. ts TIMESTAMP, -- Duration process was frozen for. - dur LONG, + dur DURATION, -- Unfreeze reason Integer. unfreeze_reason_int LONG, -- Unfreeze reason String. diff --git a/src/trace_processor/perfetto_sql/stdlib/android/garbage_collection.sql b/src/trace_processor/perfetto_sql/stdlib/android/garbage_collection.sql index 27b49b43a1..0dacfc851d 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/garbage_collection.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/garbage_collection.sql @@ -158,15 +158,15 @@ CREATE PERFETTO TABLE android_garbage_collection_events ( -- Garbage collection timestamp. gc_ts TIMESTAMP, -- Garbage collection wall duration. - gc_dur LONG, + gc_dur DURATION, -- Garbage collection duration spent executing on CPU. - gc_running_dur LONG, + gc_running_dur DURATION, -- Garbage collection duration spent waiting for CPU. - gc_runnable_dur LONG, + gc_runnable_dur DURATION, -- Garbage collection duration spent waiting in the Linux kernel on IO. - gc_unint_io_dur LONG, + gc_unint_io_dur DURATION, -- Garbage collection duration spent waiting in the Linux kernel without IO. - gc_unint_non_io_dur LONG, + gc_unint_non_io_dur DURATION, -- Garbage collection duration spent waiting in interruptible sleep. gc_int_dur LONG ) diff --git a/src/trace_processor/perfetto_sql/stdlib/android/gpu/frequency.sql b/src/trace_processor/perfetto_sql/stdlib/android/gpu/frequency.sql index 018dc47fb2..6883be09df 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/gpu/frequency.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/gpu/frequency.sql @@ -21,7 +21,7 @@ CREATE PERFETTO TABLE android_gpu_frequency( -- Timestamp ts TIMESTAMP, -- Duration - dur LONG, + dur DURATION, -- GPU id. Joinable with `gpu_counter_track.gpu_id`. gpu_id LONG, -- GPU frequency diff --git a/src/trace_processor/perfetto_sql/stdlib/android/gpu/memory.sql b/src/trace_processor/perfetto_sql/stdlib/android/gpu/memory.sql index f7ec499c02..21b6c8343e 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/gpu/memory.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/gpu/memory.sql @@ -20,7 +20,7 @@ CREATE PERFETTO TABLE android_gpu_memory_per_process( -- Timestamp ts TIMESTAMP, -- Duration - dur LONG, + dur DURATION, -- Upid of the process upid LONG, -- GPU memory diff --git a/src/trace_processor/perfetto_sql/stdlib/android/input.sql b/src/trace_processor/perfetto_sql/stdlib/android/input.sql index a772930fe5..45ca6d864e 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/input.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/input.sql @@ -180,15 +180,15 @@ JOIN _input_read_time -- 4. Input ACk event received in OS. CREATE PERFETTO TABLE android_input_events ( -- Duration from input dispatch to input received. - dispatch_latency_dur LONG, + dispatch_latency_dur DURATION, -- Duration from input received to input ACK sent. - handling_latency_dur LONG, + handling_latency_dur DURATION, -- Duration from input ACK sent to input ACK recieved. - ack_latency_dur LONG, + ack_latency_dur DURATION, -- Duration from input dispatch to input event ACK received. - total_latency_dur LONG, + total_latency_dur DURATION, -- Duration from input read to frame present time. Null if an input event has no associated frame event. - end_to_end_latency_dur LONG, + end_to_end_latency_dur DURATION, -- Tid of thread receiving the input event. tid LONG, -- Name of thread receiving the input event. @@ -214,13 +214,13 @@ CREATE PERFETTO TABLE android_input_events ( -- Timestamp input event was dispatched. dispatch_ts TIMESTAMP, -- Duration of input event dispatch. - dispatch_dur LONG, + dispatch_dur DURATION, -- Thread track id of input event receiving thread. receive_track_id LONG, -- Timestamp input event was received. receive_ts TIMESTAMP, -- Duration of input event receipt. - receive_dur LONG, + receive_dur DURATION, -- Vsync Id associated with the input. Null if an input event has no associated frame event. frame_id LONG ) diff --git a/src/trace_processor/perfetto_sql/stdlib/android/io.sql b/src/trace_processor/perfetto_sql/stdlib/android/io.sql index 84d2a08fd8..59081a9c63 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/io.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/io.sql @@ -26,7 +26,7 @@ CREATE PERFETTO VIEW _android_io_f2fs_counter_stats( -- Min of all counter values for the counter name. min DOUBLE, -- Duration between the first and last counter value for the counter name. - dur LONG, + dur DURATION, -- Count of all the counter values for the counter name. count LONG, -- Avergate of all the counter values for the counter name. diff --git a/src/trace_processor/perfetto_sql/stdlib/android/job_scheduler.sql b/src/trace_processor/perfetto_sql/stdlib/android/job_scheduler.sql index c5ee183b7d..ea529f01f9 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/job_scheduler.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/job_scheduler.sql @@ -43,7 +43,7 @@ CREATE PERFETTO TABLE android_job_scheduler_events ( -- Timestamp the job was scheduled. ts TIMESTAMP, -- Duration of the scheduled job. - dur LONG + dur DURATION ) AS SELECT cast_int!(STR_SPLIT(slice.name, '#', 1)) AS job_id, diff --git a/src/trace_processor/perfetto_sql/stdlib/android/job_scheduler_states.sql b/src/trace_processor/perfetto_sql/stdlib/android/job_scheduler_states.sql index 7a18cf0090..a1e93ad7fa 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/job_scheduler_states.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/job_scheduler_states.sql @@ -205,7 +205,7 @@ CREATE PERFETTO TABLE android_job_scheduler_states( -- Timestamp of job state slice. ts TIMESTAMP, -- Duration of job state slice. - dur LONG, + dur DURATION, -- Id of the slice. slice_id LONG, -- Name of the job (as named by the app). @@ -336,7 +336,7 @@ CREATE PERFETTO TABLE android_job_scheduler_with_screen_charging_states( -- Timestamp of job. ts TIMESTAMP, -- Duration of slice in ns. - dur LONG, + dur DURATION, -- Id of the slice. slice_id LONG, -- Name of the job (as named by the app). @@ -347,7 +347,7 @@ CREATE PERFETTO TABLE android_job_scheduler_with_screen_charging_states( -- Uid associated with job. uid LONG, -- Duration of entire job in ns. - job_dur LONG, + job_dur DURATION, -- Package that the job belongs (ex: associated app). package_name STRING, -- Namespace of job. diff --git a/src/trace_processor/perfetto_sql/stdlib/android/memory/process.sql b/src/trace_processor/perfetto_sql/stdlib/android/memory/process.sql index 9bd049c974..c7a9c0cb3c 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/memory/process.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/memory/process.sql @@ -29,7 +29,7 @@ CREATE PERFETTO TABLE memory_oom_score_with_rss_and_swap_per_process( -- Timestamp the oom_adj score or memory of the process changed ts TIMESTAMP, -- Duration until the next oom_adj score or memory change of the process. - dur LONG, + dur DURATION, -- oom adjuster score of the process. score LONG, -- oom adjuster bucket of the process. @@ -46,7 +46,7 @@ CREATE PERFETTO TABLE memory_oom_score_with_rss_and_swap_per_process( -- Timestamp of the latest oom_adj update in the system_server. oom_adj_ts TIMESTAMP, -- Duration of the latest oom_adj update in the system_server. - oom_adj_dur LONG, + oom_adj_dur DURATION, -- Track of the latest oom_adj update in the system_server. Alias of -- `track.id`. oom_adj_track_id LONG, diff --git a/src/trace_processor/perfetto_sql/stdlib/android/monitor_contention.sql b/src/trace_processor/perfetto_sql/stdlib/android/monitor_contention.sql index 5f8bd2d5fa..bb24852ff8 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/monitor_contention.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/monitor_contention.sql @@ -122,60 +122,60 @@ GROUP BY slice.id; -- Contains parsed monitor contention slices. CREATE PERFETTO TABLE android_monitor_contention( --- Name of the method holding the lock. -blocking_method STRING, --- Blocked_method without arguments and return types. -blocked_method STRING, --- Blocking_method without arguments and return types. -short_blocking_method STRING, --- Blocked_method without arguments and return types. -short_blocked_method STRING, --- File location of blocking_method in form . -blocking_src STRING, --- File location of blocked_method in form . -blocked_src STRING, --- Zero indexed number of threads trying to acquire the lock. -waiter_count LONG, --- Utid of thread holding the lock. -blocked_utid LONG, --- Thread name of thread holding the lock. -blocked_thread_name STRING, --- Utid of thread holding the lock. -blocking_utid LONG, --- Thread name of thread holding the lock. -blocking_thread_name STRING, --- Tid of thread holding the lock. -blocking_tid LONG, --- Upid of process experiencing lock contention. -upid LONG, --- Process name of process experiencing lock contention. -process_name STRING, --- Slice id of lock contention. -id LONG, --- Timestamp of lock contention start. -ts TIMESTAMP, --- Wall clock duration of lock contention. -dur LONG, --- Monotonic clock duration of lock contention. -monotonic_dur LONG, --- Thread track id of blocked thread. -track_id LONG, --- Whether the blocked thread is the main thread. -is_blocked_thread_main LONG, --- Tid of the blocked thread -blocked_thread_tid LONG, --- Whether the blocking thread is the main thread. -is_blocking_thread_main LONG, --- Tid of thread holding the lock. -blocking_thread_tid LONG, --- Slice id of binder reply slice if lock contention was part of a binder txn. -binder_reply_id LONG, --- Timestamp of binder reply slice if lock contention was part of a binder txn. -binder_reply_ts TIMESTAMP, --- Tid of binder reply slice if lock contention was part of a binder txn. -binder_reply_tid LONG, --- Pid of process experiencing lock contention. -pid LONG + -- Name of the method holding the lock. + blocking_method STRING, + -- Blocked_method without arguments and return types. + blocked_method STRING, + -- Blocking_method without arguments and return types. + short_blocking_method STRING, + -- Blocked_method without arguments and return types. + short_blocked_method STRING, + -- File location of blocking_method in form . + blocking_src STRING, + -- File location of blocked_method in form . + blocked_src STRING, + -- Zero indexed number of threads trying to acquire the lock. + waiter_count LONG, + -- Utid of thread holding the lock. + blocked_utid LONG, + -- Thread name of thread holding the lock. + blocked_thread_name STRING, + -- Utid of thread holding the lock. + blocking_utid LONG, + -- Thread name of thread holding the lock. + blocking_thread_name STRING, + -- Tid of thread holding the lock. + blocking_tid LONG, + -- Upid of process experiencing lock contention. + upid LONG, + -- Process name of process experiencing lock contention. + process_name STRING, + -- Slice id of lock contention. + id LONG, + -- Timestamp of lock contention start. + ts TIMESTAMP, + -- Wall clock duration of lock contention. + dur DURATION, + -- Monotonic clock duration of lock contention. + monotonic_dur DURATION, + -- Thread track id of blocked thread. + track_id LONG, + -- Whether the blocked thread is the main thread. + is_blocked_thread_main LONG, + -- Tid of the blocked thread + blocked_thread_tid LONG, + -- Whether the blocking thread is the main thread. + is_blocking_thread_main LONG, + -- Tid of thread holding the lock. + blocking_thread_tid LONG, + -- Slice id of binder reply slice if lock contention was part of a binder txn. + binder_reply_id LONG, + -- Timestamp of binder reply slice if lock contention was part of a binder txn. + binder_reply_ts TIMESTAMP, + -- Tid of binder reply slice if lock contention was part of a binder txn. + binder_reply_tid LONG, + -- Pid of process experiencing lock contention. + pid LONG ) AS SELECT android_extract_android_monitor_contention_blocking_method(slice.name) AS blocking_method, @@ -261,64 +261,64 @@ SELECT * FROM android_monitor_contention JOIN isolated USING (id); -- Contains parsed monitor contention slices with the parent-child relationships. CREATE PERFETTO TABLE android_monitor_contention_chain( --- Id of monitor contention slice blocking this contention. -parent_id LONG, --- Name of the method holding the lock. -blocking_method STRING, --- Blocked_method without arguments and return types. -blocked_method STRING, --- Blocking_method without arguments and return types. -short_blocking_method STRING, --- Blocked_method without arguments and return types. -short_blocked_method STRING, --- File location of blocking_method in form . -blocking_src STRING, --- File location of blocked_method in form . -blocked_src STRING, --- Zero indexed number of threads trying to acquire the lock. -waiter_count LONG, --- Utid of thread holding the lock. -blocked_utid LONG, --- Thread name of thread holding the lock. -blocked_thread_name STRING, --- Utid of thread holding the lock. -blocking_utid LONG, --- Thread name of thread holding the lock. -blocking_thread_name STRING, --- Tid of thread holding the lock. -blocking_tid LONG, --- Upid of process experiencing lock contention. -upid LONG, --- Process name of process experiencing lock contention. -process_name STRING, --- Slice id of lock contention. -id LONG, --- Timestamp of lock contention start. -ts TIMESTAMP, --- Wall clock duration of lock contention. -dur LONG, --- Monotonic clock duration of lock contention. -monotonic_dur LONG, --- Thread track id of blocked thread. -track_id LONG, --- Whether the blocked thread is the main thread. -is_blocked_thread_main LONG, --- Tid of the blocked thread -blocked_thread_tid LONG, --- Whether the blocking thread is the main thread. -is_blocking_thread_main LONG, --- Tid of thread holding the lock. -blocking_thread_tid LONG, --- Slice id of binder reply slice if lock contention was part of a binder txn. -binder_reply_id LONG, --- Timestamp of binder reply slice if lock contention was part of a binder txn. -binder_reply_ts TIMESTAMP, --- Tid of binder reply slice if lock contention was part of a binder txn. -binder_reply_tid LONG, --- Pid of process experiencing lock contention. -pid LONG, --- Id of monitor contention slice blocked by this contention. -child_id LONG + -- Id of monitor contention slice blocking this contention. + parent_id LONG, + -- Name of the method holding the lock. + blocking_method STRING, + -- Blocked_method without arguments and return types. + blocked_method STRING, + -- Blocking_method without arguments and return types. + short_blocking_method STRING, + -- Blocked_method without arguments and return types. + short_blocked_method STRING, + -- File location of blocking_method in form . + blocking_src STRING, + -- File location of blocked_method in form . + blocked_src STRING, + -- Zero indexed number of threads trying to acquire the lock. + waiter_count LONG, + -- Utid of thread holding the lock. + blocked_utid LONG, + -- Thread name of thread holding the lock. + blocked_thread_name STRING, + -- Utid of thread holding the lock. + blocking_utid LONG, + -- Thread name of thread holding the lock. + blocking_thread_name STRING, + -- Tid of thread holding the lock. + blocking_tid LONG, + -- Upid of process experiencing lock contention. + upid LONG, + -- Process name of process experiencing lock contention. + process_name STRING, + -- Slice id of lock contention. + id LONG, + -- Timestamp of lock contention start. + ts TIMESTAMP, + -- Wall clock duration of lock contention. + dur DURATION, + -- Monotonic clock duration of lock contention. + monotonic_dur DURATION, + -- Thread track id of blocked thread. + track_id LONG, + -- Whether the blocked thread is the main thread. + is_blocked_thread_main LONG, + -- Tid of the blocked thread + blocked_thread_tid LONG, + -- Whether the blocking thread is the main thread. + is_blocking_thread_main LONG, + -- Tid of thread holding the lock. + blocking_thread_tid LONG, + -- Slice id of binder reply slice if lock contention was part of a binder txn. + binder_reply_id LONG, + -- Timestamp of binder reply slice if lock contention was part of a binder txn. + binder_reply_ts TIMESTAMP, + -- Tid of binder reply slice if lock contention was part of a binder txn. + binder_reply_tid LONG, + -- Pid of process experiencing lock contention. + pid LONG, + -- Id of monitor contention slice blocked by this contention. + child_id LONG ) AS SELECT NULL AS parent_id, *, NULL AS child_id FROM _isolated UNION ALL @@ -365,18 +365,18 @@ USING -- This can be less than the duration the lock was 'waited on' when a different waiter acquired the -- lock earlier than the first waiter. CREATE PERFETTO TABLE android_monitor_contention_chain_thread_state( --- Slice id of lock contention. -id LONG, --- Timestamp of lock contention start. -ts TIMESTAMP, --- Wall clock duration of lock contention. -dur LONG, --- Utid of the blocking |thread_state|. -blocking_utid LONG, --- Blocked kernel function of the blocking thread. -blocked_function STRING, --- Thread state of the blocking thread. -state STRING + -- Slice id of lock contention. + id LONG, + -- Timestamp of lock contention start. + ts TIMESTAMP, + -- Wall clock duration of lock contention. + dur DURATION, + -- Utid of the blocking |thread_state|. + blocking_utid LONG, + -- Blocked kernel function of the blocking thread. + blocked_function STRING, + -- Thread state of the blocking thread. + state STRING ) AS SELECT id, @@ -400,7 +400,7 @@ CREATE PERFETTO VIEW android_monitor_contention_chain_thread_state_by_txn( -- A |thread_state| that occurred in the blocking thread during the contention. thread_state STRING, -- Total time the blocking thread spent in the |thread_state| during contention. - thread_state_dur LONG, + thread_state_dur DURATION, -- Count of all times the blocking thread entered |thread_state| during the contention. thread_state_count LONG ) AS @@ -424,7 +424,7 @@ CREATE PERFETTO VIEW android_monitor_contention_chain_blocked_functions_by_txn( -- Blocked kernel function in a thread state in the blocking thread during the contention. blocked_function STRING, -- Total time the blocking thread spent in the |blocked_function| during the contention. - blocked_function_dur LONG, + blocked_function_dur DURATION, -- Count of all times the blocking thread executed the |blocked_function| during the contention. blocked_function_count LONG ) AS diff --git a/src/trace_processor/perfetto_sql/stdlib/android/network_packets.sql b/src/trace_processor/perfetto_sql/stdlib/android/network_packets.sql index f662023ed8..e1926913b4 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/network_packets.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/network_packets.sql @@ -15,10 +15,10 @@ -- Android network packet events (from android.network_packets data source). CREATE PERFETTO VIEW android_network_packets( - -- Timestamp in nanoseconds. + -- Timestamp. ts TIMESTAMP, -- Duration (non-zero only in aggregate events) - dur LONG, + dur DURATION, -- The track name (interface and direction) track_name STRING, -- Traffic package source (or uid=$X if not found) diff --git a/src/trace_processor/perfetto_sql/stdlib/android/oom_adjuster.sql b/src/trace_processor/perfetto_sql/stdlib/android/oom_adjuster.sql index 981aa42fd7..4bed11c2e7 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/oom_adjuster.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/oom_adjuster.sql @@ -129,7 +129,7 @@ CREATE PERFETTO VIEW android_oom_adj_intervals ( -- Timestamp the oom_adj score of the process changed ts TIMESTAMP, -- Duration until the next oom_adj score change of the process. - dur LONG, + dur DURATION, -- oom_adj score of the process. score LONG, -- oom_adj bucket of the process. @@ -143,7 +143,7 @@ CREATE PERFETTO VIEW android_oom_adj_intervals ( -- Timestamp of the latest oom_adj update in the system_server. oom_adj_ts TIMESTAMP, -- Duration of the latest oom_adj update in the system_server. - oom_adj_dur LONG, + oom_adj_dur DURATION, -- Track id of the latest oom_adj update in the system_server oom_adj_track_id LONG, -- Thread name of the latest oom_adj update in the system_server. diff --git a/src/trace_processor/perfetto_sql/stdlib/android/power_rails.sql b/src/trace_processor/perfetto_sql/stdlib/android/power_rails.sql index ff480568cd..f81c75e39a 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/power_rails.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/power_rails.sql @@ -26,7 +26,7 @@ CREATE PERFETTO TABLE android_power_rails_counters ( -- Timestamp of the energy measurement. ts TIMESTAMP, -- Time until the next energy measurement. - dur LONG, + dur DURATION, -- Power rail name. Alias of `counter_track.name`. power_rail_name STRING, -- Raw power rail name. diff --git a/src/trace_processor/perfetto_sql/stdlib/android/screenshots.sql b/src/trace_processor/perfetto_sql/stdlib/android/screenshots.sql index 0218d7922d..f850aee57f 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/screenshots.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/screenshots.sql @@ -20,7 +20,7 @@ CREATE PERFETTO TABLE android_screenshots( ts TIMESTAMP, -- Slice duration, should be typically 0 since screeenshot slices are of instant -- type. - dur LONG, + dur DURATION, -- Slice name. name STRING ) AS diff --git a/src/trace_processor/perfetto_sql/stdlib/android/services.sql b/src/trace_processor/perfetto_sql/stdlib/android/services.sql index b5e80693f3..4dc3a6f030 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/services.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/services.sql @@ -91,7 +91,7 @@ CREATE PERFETTO TABLE android_service_bindings( -- Timestamp the client process made the request. client_ts TIMESTAMP, -- Duration of the client binding request. - client_dur LONG, + client_dur DURATION, -- OOM score of server process getting bound to. server_oom_score LONG, -- Name of server process getting bound to @@ -109,7 +109,7 @@ CREATE PERFETTO TABLE android_service_bindings( -- Timestamp the server process got bound to. server_ts TIMESTAMP, -- Duration of the server process handling the binding. - server_dur LONG, + server_dur DURATION, -- Unique binder identifier for the Service binding. token STRING, -- Intent action name for the service binding. diff --git a/src/trace_processor/perfetto_sql/stdlib/android/startup/startup_breakdowns.sql b/src/trace_processor/perfetto_sql/stdlib/android/startup/startup_breakdowns.sql index 6b399cdfe5..d2555b315f 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/startup/startup_breakdowns.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/startup/startup_breakdowns.sql @@ -163,7 +163,7 @@ CREATE PERFETTO TABLE android_startup_opinionated_breakdown( -- Timestamp of an exclusive interval during the app startup with a single latency reason. ts TIMESTAMP, -- Duration of an exclusive interval during the app startup with a single latency reason. - dur LONG, + dur DURATION, -- Cause of delay during an exclusive interval of the app startup. reason STRING ) diff --git a/src/trace_processor/perfetto_sql/stdlib/android/startup/startups.sql b/src/trace_processor/perfetto_sql/stdlib/android/startup/startups.sql index d816d94fb3..b5f27ece50 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/startup/startups.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/startup/startups.sql @@ -29,7 +29,7 @@ CREATE PERFETTO TABLE android_startups( -- Timestamp of startup end. ts_end LONG, -- Startup duration. - dur LONG, + dur DURATION, -- Package name. package STRING, -- Startup type. @@ -154,7 +154,7 @@ CREATE PERFETTO VIEW android_startup_threads( -- Timestamp of start. ts TIMESTAMP, -- Duration of startup. - dur LONG, + dur DURATION, -- Upid of process involved in startup. upid LONG, -- Pid if process involved in startup. @@ -248,7 +248,7 @@ RETURNS TABLE( -- Timestamp of start of the slice. slice_ts TIMESTAMP, -- Duration of the slice. - slice_dur LONG, + slice_dur DURATION, -- Name of the thread with the slice. thread_name STRING, -- Tid of the thread with the slice. @@ -270,7 +270,7 @@ RETURNS TABLE( -- Slice id. id LONG, -- Slice duration. - slice_dur LONG, + slice_dur DURATION, -- Name of the thread with slice. thread_name STRING, -- Name of the process with slice. diff --git a/src/trace_processor/perfetto_sql/stdlib/android/statsd.sql b/src/trace_processor/perfetto_sql/stdlib/android/statsd.sql index 4da6335767..71d6055124 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/statsd.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/statsd.sql @@ -22,10 +22,10 @@ CREATE PERFETTO VIEW android_statsd_atoms( id LONG, -- The name of the "most-specific" child table containing this row. type STRING, - -- The timestamp at the start of the slice (in nanoseconds). + -- The timestamp at the start of the slice. ts TIMESTAMP, - -- The duration of the slice (in nanoseconds). - dur LONG, + -- The duration of the slice. + dur DURATION, -- The id of the argument set associated with this slice. arg_set_id LONG, -- The value of the CPU instruction counter at the start of the slice. This column will only be populated if thread instruction collection is enabled with track_event. diff --git a/src/trace_processor/perfetto_sql/stdlib/android/suspend.sql b/src/trace_processor/perfetto_sql/stdlib/android/suspend.sql index 13b3eb5558..a17bbb996b 100644 --- a/src/trace_processor/perfetto_sql/stdlib/android/suspend.sql +++ b/src/trace_processor/perfetto_sql/stdlib/android/suspend.sql @@ -23,7 +23,7 @@ CREATE PERFETTO TABLE android_suspend_state( -- Timestamp ts TIMESTAMP, -- Duration - dur LONG, + dur DURATION, -- 'awake' or 'suspended' power_state STRING) AS WITH suspend_slice_from_minimal AS ( @@ -84,7 +84,7 @@ CREATE PERFETTO FUNCTION _extract_duration_without_suspend( -- Timestamp of event. ts TIMESTAMP, -- Duration of event. - dur LONG) + dur DURATION) RETURNS LONG AS SELECT to_monotonic($ts + $dur) - to_monotonic($ts); diff --git a/src/trace_processor/perfetto_sql/stdlib/chrome/chrome_scrolls.sql b/src/trace_processor/perfetto_sql/stdlib/chrome/chrome_scrolls.sql index 9a6e399d4e..a007bc080a 100644 --- a/src/trace_processor/perfetto_sql/stdlib/chrome/chrome_scrolls.sql +++ b/src/trace_processor/perfetto_sql/stdlib/chrome/chrome_scrolls.sql @@ -20,7 +20,7 @@ CREATE PERFETTO TABLE chrome_scrolls( -- The start timestamp of the scroll. ts TIMESTAMP, -- The duration of the scroll. - dur LONG, + dur DURATION, -- The earliest timestamp of the EventLatency slice of the GESTURE_SCROLL_BEGIN type for the -- corresponding scroll id. gesture_scroll_begin_ts TIMESTAMP, diff --git a/src/trace_processor/perfetto_sql/stdlib/chrome/cpu_powerups.sql b/src/trace_processor/perfetto_sql/stdlib/chrome/cpu_powerups.sql index 07ca4b887c..685a6e04f0 100644 --- a/src/trace_processor/perfetto_sql/stdlib/chrome/cpu_powerups.sql +++ b/src/trace_processor/perfetto_sql/stdlib/chrome/cpu_powerups.sql @@ -28,7 +28,7 @@ CREATE PERFETTO VIEW chrome_cpu_power_slice( -- The timestamp at the start of the slice. ts TIMESTAMP, -- The duration of the slice. - dur LONG, + dur DURATION, -- The CPU on which the transition occurred cpu LONG, -- The power state that the CPU was in at time 'ts' for duration 'dur'. @@ -100,7 +100,7 @@ CREATE PERFETTO TABLE chrome_cpu_power_first_sched_slice_after_powerup( -- The timestamp at the start of the slice. ts TIMESTAMP, -- The duration of the slice. - dur LONG, + dur DURATION, -- The cpu on which the slice executed. cpu LONG, -- Id for the sched_slice table. @@ -156,22 +156,22 @@ USING -- A table holding the slices that executed within the scheduler -- slice that ran on a CPU immediately after power-up. CREATE PERFETTO TABLE chrome_cpu_power_post_powerup_slice( --- Timestamp of the resulting slice -ts TIMESTAMP, --- Duration of the slice. -dur LONG, --- The CPU the sched slice ran on. -cpu LONG, --- Unique thread id for the slice. -utid LONG, --- 'id' field from the sched_slice table. -sched_id LONG, --- Id of the top-level slice for this (sched) slice. -slice_id LONG, --- Previous power state. -previous_power_state LONG, --- Id of the powerup. -powerup_id LONG + -- Timestamp of the resulting slice + ts TIMESTAMP, + -- Duration of the slice. + dur DURATION, + -- The CPU the sched slice ran on. + cpu LONG, + -- Unique thread id for the slice. + utid LONG, + -- 'id' field from the sched_slice table. + sched_id LONG, + -- Id of the top-level slice for this (sched) slice. + slice_id LONG, + -- Previous power state. + previous_power_state LONG, + -- Id of the powerup. + powerup_id LONG ) AS SELECT * FROM _chrome_cpu_power_post_powerup_slice_sj; diff --git a/src/trace_processor/perfetto_sql/stdlib/chrome/event_latency.sql b/src/trace_processor/perfetto_sql/stdlib/chrome/event_latency.sql index c9792c63ef..d2e63306af 100644 --- a/src/trace_processor/perfetto_sql/stdlib/chrome/event_latency.sql +++ b/src/trace_processor/perfetto_sql/stdlib/chrome/event_latency.sql @@ -82,7 +82,7 @@ CREATE PERFETTO TABLE chrome_event_latencies( -- The start timestamp of the scroll. ts TIMESTAMP, -- The duration of the scroll. - dur LONG, + dur DURATION, -- The id of the scroll update event. scroll_update_id LONG, -- Whether this input event was presented. @@ -188,7 +188,7 @@ CREATE PERFETTO TABLE chrome_gesture_scroll_events( -- The start timestamp of the scroll. ts TIMESTAMP, -- The duration of the scroll. - dur LONG, + dur DURATION, -- The id of the scroll update event. scroll_update_id LONG, -- The id of the scroll. diff --git a/src/trace_processor/perfetto_sql/stdlib/chrome/graphics_pipeline.sql b/src/trace_processor/perfetto_sql/stdlib/chrome/graphics_pipeline.sql index 87e0df7b40..3698f8867c 100644 --- a/src/trace_processor/perfetto_sql/stdlib/chrome/graphics_pipeline.sql +++ b/src/trace_processor/perfetto_sql/stdlib/chrome/graphics_pipeline.sql @@ -21,7 +21,7 @@ CREATE PERFETTO TABLE chrome_graphics_pipeline_surface_frame_steps( -- The start timestamp of the slice/step. ts TIMESTAMP, -- The duration of the slice/step. - dur LONG, + dur DURATION, -- Step name of the `Graphics.Pipeline` slice. step STRING, -- Id of the graphics pipeline, pre-surface aggregation. @@ -54,7 +54,7 @@ CREATE PERFETTO TABLE chrome_graphics_pipeline_display_frame_steps( -- The start timestamp of the slice/step. ts TIMESTAMP, -- The duration of the slice/step. - dur LONG, + dur DURATION, -- Step name of the `Graphics.Pipeline` slice. step STRING, -- Id of the graphics pipeline, post-surface aggregation. diff --git a/src/trace_processor/perfetto_sql/stdlib/chrome/input.sql b/src/trace_processor/perfetto_sql/stdlib/chrome/input.sql index 99d872ed27..b99770138e 100644 --- a/src/trace_processor/perfetto_sql/stdlib/chrome/input.sql +++ b/src/trace_processor/perfetto_sql/stdlib/chrome/input.sql @@ -13,7 +13,7 @@ CREATE PERFETTO TABLE _chrome_input_pipeline_steps_no_input_type( -- The step timestamp. ts TIMESTAMP, -- Step duration. - dur LONG, + dur DURATION, -- Utid of the thread. utid LONG, -- Step name (ChromeLatencyInfo.step). @@ -66,7 +66,7 @@ CREATE PERFETTO TABLE chrome_input_pipeline_steps( -- The step timestamp. ts TIMESTAMP, -- Step duration. - dur LONG, + dur DURATION, -- Utid of the thread. utid LONG, -- Step name (ChromeLatencyInfo.step). diff --git a/src/trace_processor/perfetto_sql/stdlib/chrome/interactions.sql b/src/trace_processor/perfetto_sql/stdlib/chrome/interactions.sql index e3df76f6ae..d011864a58 100644 --- a/src/trace_processor/perfetto_sql/stdlib/chrome/interactions.sql +++ b/src/trace_processor/perfetto_sql/stdlib/chrome/interactions.sql @@ -28,7 +28,7 @@ CREATE PERFETTO TABLE chrome_interactions( -- Timestamp of the CUI event. ts TIMESTAMP, -- Duration of the CUI event. - dur LONG + dur DURATION ) AS SELECT id AS scoped_id, diff --git a/src/trace_processor/perfetto_sql/stdlib/chrome/page_loads.sql b/src/trace_processor/perfetto_sql/stdlib/chrome/page_loads.sql index 298db71e64..7fff9f325a 100644 --- a/src/trace_processor/perfetto_sql/stdlib/chrome/page_loads.sql +++ b/src/trace_processor/perfetto_sql/stdlib/chrome/page_loads.sql @@ -22,7 +22,7 @@ WHERE name = 'PageLoadMetrics.NavigationToFirstContentfulPaint'; CREATE PERFETTO FUNCTION _page_load_metrics(event_name STRING) RETURNS TABLE( ts TIMESTAMP, - dur LONG, + dur DURATION, navigation_id LONG, browser_upid LONG ) AS diff --git a/src/trace_processor/perfetto_sql/stdlib/chrome/scroll_interactions.sql b/src/trace_processor/perfetto_sql/stdlib/chrome/scroll_interactions.sql index 0f24de32df..b377ce5167 100644 --- a/src/trace_processor/perfetto_sql/stdlib/chrome/scroll_interactions.sql +++ b/src/trace_processor/perfetto_sql/stdlib/chrome/scroll_interactions.sql @@ -13,7 +13,7 @@ CREATE PERFETTO TABLE chrome_scroll_interactions( -- Start timestamp of the scroll. ts TIMESTAMP, -- Duration of the scroll. - dur LONG, + dur DURATION, -- The total number of frames in the scroll. frame_count LONG, -- The total number of vsyncs in the scroll. diff --git a/src/trace_processor/perfetto_sql/stdlib/chrome/scroll_jank/scroll_jank_intervals.sql b/src/trace_processor/perfetto_sql/stdlib/chrome/scroll_jank/scroll_jank_intervals.sql index 2ae65d8104..e90dc5dea1 100644 --- a/src/trace_processor/perfetto_sql/stdlib/chrome/scroll_jank/scroll_jank_intervals.sql +++ b/src/trace_processor/perfetto_sql/stdlib/chrome/scroll_jank/scroll_jank_intervals.sql @@ -13,7 +13,7 @@ CREATE PERFETTO TABLE chrome_janky_event_latencies_v3( -- The start timestamp of the slice. ts TIMESTAMP, -- The duration of the slice. - dur LONG, + dur DURATION, -- The track_id for the slice. track_id LONG, -- The name of the slice (EventLatency). @@ -55,7 +55,7 @@ CREATE PERFETTO VIEW chrome_janky_frame_presentation_intervals( -- The start timestamp of the slice. ts TIMESTAMP, -- The duration of the slice. - dur LONG, + dur DURATION, -- How many vsyncs this frame missed its deadline by. delayed_frame_count LONG, -- The stage of EventLatency that the caused the jank. @@ -134,7 +134,7 @@ CREATE PERFETTO TABLE chrome_scroll_jank_intervals_v3( -- The start timestamp of the janky interval. ts TIMESTAMP, -- The duration of the janky interval. - dur LONG + dur DURATION ) AS -- Sub-table to retrieve all janky slice timestamps. Ordering calculations are -- based on timestamps rather than durations. diff --git a/src/trace_processor/perfetto_sql/stdlib/chrome/scroll_jank/scroll_jank_v3.sql b/src/trace_processor/perfetto_sql/stdlib/chrome/scroll_jank/scroll_jank_v3.sql index 38fcddf0d7..4be4c2e6a8 100644 --- a/src/trace_processor/perfetto_sql/stdlib/chrome/scroll_jank/scroll_jank_v3.sql +++ b/src/trace_processor/perfetto_sql/stdlib/chrome/scroll_jank/scroll_jank_v3.sql @@ -26,7 +26,7 @@ CREATE PERFETTO TABLE chrome_gesture_scroll_updates( -- The start timestamp of the scroll. ts TIMESTAMP, -- The duration of the scroll. - dur LONG, + dur DURATION, -- Slice id for the scroll. id LONG, -- The id of the scroll update event. @@ -79,7 +79,7 @@ CREATE PERFETTO TABLE chrome_presented_gesture_scrolls( -- The start timestamp for producing the frame. ts TIMESTAMP, -- The duration between producing and presenting the frame. - dur LONG, + dur DURATION, -- The timestamp of the last input that arrived and got presented in the frame. last_presented_input_ts TIMESTAMP, -- The id of the scroll update event, a unique identifier to the gesture. @@ -157,7 +157,7 @@ CREATE PERFETTO TABLE chrome_full_frame_view( -- ID of the associated EventLatency. event_latency_id LONG, -- Duration of the associated EventLatency. - dur LONG, + dur DURATION, -- Frame presentation timestamp. presentation_timestamp LONG ) AS @@ -195,7 +195,7 @@ CREATE PERFETTO TABLE chrome_full_frame_delta_view( -- ID of the associated EventLatency. event_latency_id LONG, -- Duration of the associated EventLatency. - dur LONG, + dur DURATION, -- Frame presentation timestamp. presentation_timestamp LONG ) AS @@ -235,7 +235,7 @@ CREATE PERFETTO TABLE chrome_merged_frame_view( -- ID of the associated EventLatency. event_latency_id LONG, -- Maximum duration of the associated EventLatency. - dur LONG, + dur DURATION, -- Frame presentation timestamp. presentation_timestamp LONG ) AS @@ -278,7 +278,7 @@ CREATE PERFETTO TABLE chrome_frame_info_with_delay( -- Event latency id of the presented frame. event_latency_id LONG, -- Duration of the EventLatency. - dur LONG, + dur DURATION, -- Timestamp at which the frame was shown on the screen. presentation_timestamp LONG, -- Time elapsed since the previous frame was presented, usually equals |VSYNC| diff --git a/src/trace_processor/perfetto_sql/stdlib/chrome/scroll_jank/scroll_jank_v3_cause.sql b/src/trace_processor/perfetto_sql/stdlib/chrome/scroll_jank/scroll_jank_v3_cause.sql index 9e5bc2e92e..2e3e24ba45 100644 --- a/src/trace_processor/perfetto_sql/stdlib/chrome/scroll_jank/scroll_jank_v3_cause.sql +++ b/src/trace_processor/perfetto_sql/stdlib/chrome/scroll_jank/scroll_jank_v3_cause.sql @@ -14,7 +14,7 @@ RETURNS TABLE( -- Alias for `slice.ts`. ts TIMESTAMP, -- Alias for `slice.dur`. - dur LONG, + dur DURATION, -- Alias for `slice.category`. category LONG, -- Alias for `slice.name`. diff --git a/src/trace_processor/perfetto_sql/stdlib/chrome/speedometer.sql b/src/trace_processor/perfetto_sql/stdlib/chrome/speedometer.sql index a84e748dfb..7392ac722e 100644 --- a/src/trace_processor/perfetto_sql/stdlib/chrome/speedometer.sql +++ b/src/trace_processor/perfetto_sql/stdlib/chrome/speedometer.sql @@ -28,7 +28,7 @@ CREATE PERFETTO TABLE chrome_speedometer_measure( -- Start timestamp of the measure slice ts TIMESTAMP, -- Duration of the measure slice - dur LONG, + dur DURATION, -- Full measure name name STRING, -- Speedometer iteration the slice belongs to. @@ -60,7 +60,7 @@ CREATE PERFETTO TABLE chrome_speedometer_iteration( -- Start timestamp of the iteration ts TIMESTAMP, -- Duration of the iteration - dur LONG, + dur DURATION, -- Iteration name name STRING, -- Iteration number diff --git a/src/trace_processor/perfetto_sql/stdlib/chrome/speedometer_2_1.sql b/src/trace_processor/perfetto_sql/stdlib/chrome/speedometer_2_1.sql index 1d118f281a..064128262f 100644 --- a/src/trace_processor/perfetto_sql/stdlib/chrome/speedometer_2_1.sql +++ b/src/trace_processor/perfetto_sql/stdlib/chrome/speedometer_2_1.sql @@ -82,7 +82,7 @@ CREATE PERFETTO TABLE chrome_speedometer_2_1_measure( -- Start timestamp of the measure slice ts TIMESTAMP, -- Duration of the measure slice - dur LONG, + dur DURATION, -- Full measure name name STRING, -- Speedometer iteration the slice belongs to. @@ -176,7 +176,7 @@ CREATE PERFETTO TABLE chrome_speedometer_2_1_iteration( -- Start timestamp of the iteration ts TIMESTAMP, -- Duration of the iteration - dur LONG, + dur DURATION, -- Iteration name name STRING, -- Iteration number diff --git a/src/trace_processor/perfetto_sql/stdlib/chrome/speedometer_3.sql b/src/trace_processor/perfetto_sql/stdlib/chrome/speedometer_3.sql index bddce81517..8778fe06cb 100644 --- a/src/trace_processor/perfetto_sql/stdlib/chrome/speedometer_3.sql +++ b/src/trace_processor/perfetto_sql/stdlib/chrome/speedometer_3.sql @@ -102,7 +102,7 @@ CREATE PERFETTO TABLE chrome_speedometer_3_measure( -- Start timestamp of the measure slice ts TIMESTAMP, -- Duration of the measure slice - dur LONG, + dur DURATION, -- Full measure name name STRING, -- Speedometer iteration the slice belongs to. @@ -135,7 +135,7 @@ CREATE PERFETTO TABLE chrome_speedometer_3_iteration( -- Start timestamp of the iteration ts TIMESTAMP, -- Duration of the iteration - dur LONG, + dur DURATION, -- Iteration name name STRING, -- Iteration number diff --git a/src/trace_processor/perfetto_sql/stdlib/chrome/tasks.sql b/src/trace_processor/perfetto_sql/stdlib/chrome/tasks.sql index 57c09e1e24..e82c1ff4f0 100644 --- a/src/trace_processor/perfetto_sql/stdlib/chrome/tasks.sql +++ b/src/trace_processor/perfetto_sql/stdlib/chrome/tasks.sql @@ -317,7 +317,7 @@ FROM posted_from; -- @column name The name of the slice. CREATE PERFETTO FUNCTION _select_begin_main_frame_java_slices( name STRING) -RETURNS TABLE(id LONG, kind STRING, ts TIMESTAMP, dur LONG, name STRING) AS +RETURNS TABLE(id LONG, kind STRING, ts TIMESTAMP, dur DURATION, name STRING) AS SELECT id, "SingleThreadProxy::BeginMainFrame" AS kind, @@ -382,7 +382,7 @@ CREATE PERFETTO VIEW chrome_scheduler_tasks( -- Timestamp. ts TIMESTAMP, -- Duration. - dur LONG, + dur DURATION, -- Utid of the thread this task run on. utid LONG, -- Name of the thread this task run on. @@ -404,7 +404,7 @@ CREATE PERFETTO VIEW chrome_scheduler_tasks( -- Same as slice.thread_ts. thread_ts TIMESTAMP, -- Same as slice.thread_dur. - thread_dur LONG, + thread_dur DURATION, -- Source location where the PostTask was called. posted_from STRING ) AS @@ -609,7 +609,7 @@ CREATE PERFETTO VIEW chrome_tasks( -- Alias of |slice.ts|. ts TIMESTAMP, -- Alias of |slice.dur|. - dur LONG, + dur DURATION, -- Alias of |slice.track_id|. track_id LONG, -- Alias of |slice.category|. @@ -619,7 +619,7 @@ CREATE PERFETTO VIEW chrome_tasks( -- Alias of |slice.thread_ts|. thread_ts TIMESTAMP, -- Alias of |slice.thread_dur|. - thread_dur LONG, + thread_dur DURATION, -- STRING Legacy alias for |name|. full_name STRING ) AS diff --git a/src/trace_processor/perfetto_sql/stdlib/chrome/vsync_intervals.sql b/src/trace_processor/perfetto_sql/stdlib/chrome/vsync_intervals.sql index 570b50019f..bb830a03de 100644 --- a/src/trace_processor/perfetto_sql/stdlib/chrome/vsync_intervals.sql +++ b/src/trace_processor/perfetto_sql/stdlib/chrome/vsync_intervals.sql @@ -13,7 +13,7 @@ CREATE PERFETTO TABLE chrome_vsync_intervals( -- Timestamp of the vsync slice. ts TIMESTAMP, -- Duration of the vsync slice. - dur LONG, + dur DURATION, -- Track id of the vsync slice. track_id LONG, -- Duration until next vsync arrives. diff --git a/src/trace_processor/perfetto_sql/stdlib/chrome/web_content_interactions.sql b/src/trace_processor/perfetto_sql/stdlib/chrome/web_content_interactions.sql index d63b68f9c7..40d4e9a223 100644 --- a/src/trace_processor/perfetto_sql/stdlib/chrome/web_content_interactions.sql +++ b/src/trace_processor/perfetto_sql/stdlib/chrome/web_content_interactions.sql @@ -22,7 +22,7 @@ CREATE PERFETTO TABLE chrome_web_content_interactions( ts TIMESTAMP, -- Duration of the event. Because multiple events may occur for the same -- interaction, this is the duration of the longest event. - dur LONG, + dur DURATION, -- The interaction type. interaction_type STRING, -- The total duration of all events that occurred for the same interaction. diff --git a/src/trace_processor/perfetto_sql/stdlib/counters/intervals.sql b/src/trace_processor/perfetto_sql/stdlib/counters/intervals.sql index b9bbae08d7..4ae0dcb4d3 100644 --- a/src/trace_processor/perfetto_sql/stdlib/counters/intervals.sql +++ b/src/trace_processor/perfetto_sql/stdlib/counters/intervals.sql @@ -45,7 +45,7 @@ CREATE PERFETTO MACRO counter_leading_intervals( -- This table must have the columns "id" and "ts" and "track_id" and "value" corresponding -- to an id, timestamp, counter track_id and associated counter value. counter_table TableOrSubquery) --- Table with the schema (id LONG, ts TIMESTAMP, dur LONG, track_id LONG, +-- Table with the schema (id LONG, ts TIMESTAMP, dur DURATION, track_id LONG, -- value DOUBLE, next_value DOUBLE, delta_value DOUBLE). RETURNS TableOrSubquery AS ( diff --git a/src/trace_processor/perfetto_sql/stdlib/graphs/critical_path.sql b/src/trace_processor/perfetto_sql/stdlib/graphs/critical_path.sql index bc204336d1..158e5d0c82 100644 --- a/src/trace_processor/perfetto_sql/stdlib/graphs/critical_path.sql +++ b/src/trace_processor/perfetto_sql/stdlib/graphs/critical_path.sql @@ -172,7 +172,7 @@ CREATE PERFETTO MACRO _critical_path_intervals( -- allocated. -- There should be one row for every node id encountered in the |graph_table|. interval_table TableOrSubQuery) --- The returned table has the schema (id LONG, ts TIMESTAMP, dur LONG, idle_dur LONG). +-- The returned table has the schema (id LONG, ts TIMESTAMP, dur DURATION, idle_dur LONG). -- |root_node_id| is the id of the starting node under which this edge was encountered. -- |node_id| is the id of the node from the input graph and |parent_node_id| -- is the id of the node which was the first encountered predecessor in a DFS diff --git a/src/trace_processor/perfetto_sql/stdlib/linux/cpu/frequency.sql b/src/trace_processor/perfetto_sql/stdlib/linux/cpu/frequency.sql index e7f1d49cc7..a965b8e4c1 100644 --- a/src/trace_processor/perfetto_sql/stdlib/linux/cpu/frequency.sql +++ b/src/trace_processor/perfetto_sql/stdlib/linux/cpu/frequency.sql @@ -25,7 +25,7 @@ CREATE PERFETTO TABLE cpu_frequency_counters( -- Starting timestamp of the counter ts TIMESTAMP, -- Duration in which counter is constant and frequency doesn't change. - dur LONG, + dur DURATION, -- Frequency in kHz of the CPU that corresponds to this counter. NULL if not -- found or undefined. freq LONG, diff --git a/src/trace_processor/perfetto_sql/stdlib/linux/cpu/idle.sql b/src/trace_processor/perfetto_sql/stdlib/linux/cpu/idle.sql index 4616b07077..c827f1faad 100644 --- a/src/trace_processor/perfetto_sql/stdlib/linux/cpu/idle.sql +++ b/src/trace_processor/perfetto_sql/stdlib/linux/cpu/idle.sql @@ -25,7 +25,7 @@ CREATE PERFETTO TABLE cpu_idle_counters( -- Starting timestamp of the counter. ts TIMESTAMP, -- Duration in which the counter is contant and idle state doesn't change. - dur LONG, + dur DURATION, -- Idle state of the CPU that corresponds to this counter. An idle state of -1 -- is defined to be active state for the CPU, and the larger the integer, the -- deeper the idle state of the CPU. NULL if not found or undefined. diff --git a/src/trace_processor/perfetto_sql/stdlib/linux/cpu/idle_stats.sql b/src/trace_processor/perfetto_sql/stdlib/linux/cpu/idle_stats.sql index 0ce295894a..423d83da6d 100644 --- a/src/trace_processor/perfetto_sql/stdlib/linux/cpu/idle_stats.sql +++ b/src/trace_processor/perfetto_sql/stdlib/linux/cpu/idle_stats.sql @@ -23,10 +23,10 @@ CREATE PERFETTO TABLE cpu_idle_stats( state LONG, -- The count of entering idle state. count LONG, - -- Total CPU core idle state duration in nanoseconds. - dur LONG, - -- Average CPU core idle state duration in nanoseconds. - avg_dur LONG, + -- Total CPU core idle state duration. + dur DURATION, + -- Average CPU core idle state duration. + avg_dur DURATION, -- Idle state percentage of non suspend time (C-states + P-states). idle_percent DOUBLE ) diff --git a/src/trace_processor/perfetto_sql/stdlib/linux/cpu/utilization/slice.sql b/src/trace_processor/perfetto_sql/stdlib/linux/cpu/utilization/slice.sql index a23b43f6fb..47399e3e70 100644 --- a/src/trace_processor/perfetto_sql/stdlib/linux/cpu/utilization/slice.sql +++ b/src/trace_processor/perfetto_sql/stdlib/linux/cpu/utilization/slice.sql @@ -68,10 +68,10 @@ LEFT JOIN intersected ON slice_id = ts.id AND ts.dur = intersected.dur; -- CPU cycles per each slice in interval. CREATE PERFETTO FUNCTION cpu_cycles_per_thread_slice_in_interval( - -- Start of the interval. - ts TIMESTAMP, - -- Duration of the interval. - dur LONG + -- Start of the interval. + ts TIMESTAMP, + -- Duration of the interval. + dur DURATION ) RETURNS TABLE( -- Id of a slice. Alias of `slice.id`. diff --git a/src/trace_processor/perfetto_sql/stdlib/linux/devfreq.sql b/src/trace_processor/perfetto_sql/stdlib/linux/devfreq.sql index 0e511c96a3..f0515d8a01 100644 --- a/src/trace_processor/perfetto_sql/stdlib/linux/devfreq.sql +++ b/src/trace_processor/perfetto_sql/stdlib/linux/devfreq.sql @@ -27,7 +27,7 @@ RETURNS TABLE( -- Starting timestamp of the counter. ts TIMESTAMP, -- Duration in which counter is constant and frequency doesn't chamge. - dur LONG, + dur DURATION, -- Frequency in kHz of the device that corresponds to the counter. freq LONG ) AS @@ -53,7 +53,7 @@ CREATE PERFETTO TABLE linux_devfreq_dsu_counter( -- Starting timestamp of the counter. ts TIMESTAMP, -- Duration in which counter is constant and frequency doesn't chamge. - dur LONG, + dur DURATION, -- Frequency in kHz of the device that corresponds to the counter. dsu_freq LONG ) AS diff --git a/src/trace_processor/perfetto_sql/stdlib/linux/memory/high_watermark.sql b/src/trace_processor/perfetto_sql/stdlib/linux/memory/high_watermark.sql index a4bedb9150..813f1501b0 100644 --- a/src/trace_processor/perfetto_sql/stdlib/linux/memory/high_watermark.sql +++ b/src/trace_processor/perfetto_sql/stdlib/linux/memory/high_watermark.sql @@ -46,7 +46,7 @@ CREATE PERFETTO VIEW memory_rss_high_watermark_per_process -- Timestamp ts TIMESTAMP, -- Duration - dur LONG, + dur DURATION, -- Upid of the process upid LONG, -- Pid of the process diff --git a/src/trace_processor/perfetto_sql/stdlib/linux/memory/process.sql b/src/trace_processor/perfetto_sql/stdlib/linux/memory/process.sql index 96e84497ef..9f0da8b746 100644 --- a/src/trace_processor/perfetto_sql/stdlib/linux/memory/process.sql +++ b/src/trace_processor/perfetto_sql/stdlib/linux/memory/process.sql @@ -87,7 +87,7 @@ CREATE PERFETTO VIEW memory_rss_and_swap_per_process( -- Timestamp ts TIMESTAMP, -- Duration - dur LONG, + dur DURATION, -- Upid of the process upid LONG, -- Pid of the process diff --git a/src/trace_processor/perfetto_sql/stdlib/pkvm/hypervisor.sql b/src/trace_processor/perfetto_sql/stdlib/pkvm/hypervisor.sql index bdf46315b8..ccc739c7ed 100644 --- a/src/trace_processor/perfetto_sql/stdlib/pkvm/hypervisor.sql +++ b/src/trace_processor/perfetto_sql/stdlib/pkvm/hypervisor.sql @@ -20,10 +20,10 @@ CREATE PERFETTO VIEW pkvm_hypervisor_events( slice_id LONG, -- CPU that entered hypervisor. cpu LONG, - -- Timestamp when CPU entered hypervisor (in nanoseconds). + -- Timestamp when CPU entered hypervisor. ts TIMESTAMP, - -- How much time CPU spent in hypervisor (in nanoseconds). - dur LONG, + -- How much time CPU spent in hypervisor. + dur DURATION, -- Reason for entering hypervisor (e.g. host_hcall, host_mem_abort), or NULL if unknown. reason STRING ) AS diff --git a/src/trace_processor/perfetto_sql/stdlib/prelude/after_eof/tables_views.sql b/src/trace_processor/perfetto_sql/stdlib/prelude/after_eof/tables_views.sql index 98a18a5a96..f688925f01 100644 --- a/src/trace_processor/perfetto_sql/stdlib/prelude/after_eof/tables_views.sql +++ b/src/trace_processor/perfetto_sql/stdlib/prelude/after_eof/tables_views.sql @@ -160,10 +160,10 @@ CREATE PERFETTO VIEW sched_slice ( id LONG, -- The name of the "most-specific" child table containing this row. type STRING, - -- The timestamp at the start of the slice (in nanoseconds). + -- The timestamp at the start of the slice. ts TIMESTAMP, - -- The duration of the slice (in nanoseconds). - dur LONG, + -- The duration of the slice. + dur DURATION, -- The CPU that the slice executed on (meaningful only in single machine -- traces). For multi-machine, join with the `cpu` table on `ucpu` to get the -- CPU identifier of each machine. @@ -206,7 +206,7 @@ CREATE PERFETTO VIEW sched( -- Alias for `sched_slice.ts`. ts TIMESTAMP, -- Alias for `sched_slice.dur`. - dur LONG, + dur DURATION, -- Alias for `sched_slice.cpu`. cpu LONG, -- Alias for `sched_slice.utid`. @@ -233,10 +233,10 @@ CREATE PERFETTO VIEW thread_state ( id LONG, -- The name of the "most-specific" child table containing this row. type STRING, - -- The timestamp at the start of the slice (in nanoseconds). + -- The timestamp at the start of the slice. ts TIMESTAMP, - -- The duration of the slice (in nanoseconds). - dur LONG, + -- The duration of the slice. + dur DURATION, -- The CPU that the thread executed on (meaningful only in single machine -- traces). For multi-machine, join with the `cpu` table on `ucpu` to get the -- CPU identifier of each machine. @@ -362,10 +362,10 @@ CREATE PERFETTO VIEW experimental_sched_upid ( id LONG, -- The name of the "most-specific" child table containing this row. type STRING, - -- The timestamp at the start of the slice (in nanoseconds). + -- The timestamp at the start of the slice. ts TIMESTAMP, - -- The duration of the slice (in nanoseconds). - dur LONG, + -- The duration of the slice. + dur DURATION, -- The CPU that the slice executed on (meaningful only in single machine -- traces). For multi-machine, join with the `cpu` table on `ucpu` to get the -- CPU identifier of each machine. diff --git a/src/trace_processor/perfetto_sql/stdlib/prelude/after_eof/views.sql b/src/trace_processor/perfetto_sql/stdlib/prelude/after_eof/views.sql index c77f3b2729..ee3768b6f5 100644 --- a/src/trace_processor/perfetto_sql/stdlib/prelude/after_eof/views.sql +++ b/src/trace_processor/perfetto_sql/stdlib/prelude/after_eof/views.sql @@ -48,10 +48,10 @@ CREATE PERFETTO VIEW slice( id LONG, -- The name of the "most-specific" child table containing this row. type STRING, - -- The timestamp at the start of the slice (in nanoseconds). + -- The timestamp at the start of the slice. ts TIMESTAMP, - -- The duration of the slice (in nanoseconds). - dur LONG, + -- The duration of the slice. + dur DURATION, -- The id of the track this slice is located on. track_id LONG, -- The "category" of the slice. If this slice originated with track_event, @@ -77,7 +77,7 @@ CREATE PERFETTO VIEW slice( thread_ts TIMESTAMP, -- The thread time used by this slice. This column will only be populated if -- thread timestamp collection is enabled with track_event. - thread_dur LONG, + thread_dur DURATION, -- The value of the CPU instruction counter at the start of the slice. This -- column will only be populated if thread instruction collection is enabled -- with track_event. @@ -97,7 +97,7 @@ FROM __intrinsic_slice; -- Contains instant events from userspace which indicates what happened at a -- single moment in time. CREATE PERFETTO VIEW instant( - -- The timestamp of the instant (in nanoseconds). + -- The timestamp of the instant. ts TIMESTAMP, -- The id of the track this instant is located on. track_id LONG, @@ -120,7 +120,7 @@ CREATE PERFETTO VIEW slices( -- Alias of `slice.ts`. ts TIMESTAMP, -- Alias of `slice.dur`. - dur LONG, + dur DURATION, -- Alias of `slice.track_id`. track_id LONG, -- Alias of `slice.category`. @@ -140,7 +140,7 @@ CREATE PERFETTO VIEW slices( -- Alias of `slice.thread_ts`. thread_ts TIMESTAMP, -- Alias of `slice.thread_dur`. - thread_dur LONG, + thread_dur DURATION, -- Alias of `slice.thread_instruction_count`. thread_instruction_count LONG, -- Alias of `slice.thread_instruction_delta`. diff --git a/src/trace_processor/perfetto_sql/stdlib/prelude/before_eof/trace_bounds.sql b/src/trace_processor/perfetto_sql/stdlib/prelude/before_eof/trace_bounds.sql index ece2ecd946..cc1558abda 100644 --- a/src/trace_processor/perfetto_sql/stdlib/prelude/before_eof/trace_bounds.sql +++ b/src/trace_processor/perfetto_sql/stdlib/prelude/before_eof/trace_bounds.sql @@ -20,18 +20,18 @@ SELECT 0 AS start_ts, 0 AS end_ts; -- Fetch start of the trace. CREATE PERFETTO FUNCTION trace_start() --- Start of the trace in nanoseconds. -RETURNS LONG AS +-- Start of the trace. +RETURNS TIMESTAMP AS SELECT start_ts FROM _trace_bounds; -- Fetch end of the trace. CREATE PERFETTO FUNCTION trace_end() --- End of the trace in nanoseconds. -RETURNS LONG AS +-- End of the trace. +RETURNS TIMESTAMP AS SELECT end_ts FROM _trace_bounds; -- Fetch duration of the trace. CREATE PERFETTO FUNCTION trace_dur() --- Duration of the trace in nanoseconds. -RETURNS LONG AS +-- Duration of the trace. +RETURNS DURATION AS SELECT trace_end() - trace_start(); \ No newline at end of file diff --git a/src/trace_processor/perfetto_sql/stdlib/sched/thread_executing_span.sql b/src/trace_processor/perfetto_sql/stdlib/sched/thread_executing_span.sql index 25d85fa1f8..4161b7f385 100644 --- a/src/trace_processor/perfetto_sql/stdlib/sched/thread_executing_span.sql +++ b/src/trace_processor/perfetto_sql/stdlib/sched/thread_executing_span.sql @@ -518,7 +518,7 @@ CREATE PERFETTO FUNCTION _thread_executing_span_critical_path( -- Timestamp. ts TIMESTAMP, -- Duration. - dur LONG) + dur DURATION) RETURNS TABLE( -- Thread Utid the critical path was filtered to. root_utid LONG, @@ -530,7 +530,7 @@ RETURNS TABLE( -- Timestamp of first thread_state in thread_executing_span. ts TIMESTAMP, -- Duration of thread_executing_span. - dur LONG, + dur DURATION, -- Utid of thread with thread_state. utid LONG ) AS diff --git a/src/trace_processor/perfetto_sql/stdlib/sched/thread_executing_span_with_slice.sql b/src/trace_processor/perfetto_sql/stdlib/sched/thread_executing_span_with_slice.sql index c489f45441..ee543f0c14 100644 --- a/src/trace_processor/perfetto_sql/stdlib/sched/thread_executing_span_with_slice.sql +++ b/src/trace_processor/perfetto_sql/stdlib/sched/thread_executing_span_with_slice.sql @@ -213,12 +213,12 @@ USING -- critical_path slice_stack (enabled with |enable_critical_path_slice|). -- running cpu (if one exists). -- A 'stack' is the group of resulting unpivoted rows sharing the same timestamp. -CREATE PERFETTO FUNCTION _critical_path_stack(root_utid LONG, ts TIMESTAMP, dur LONG, enable_process_name LONG, enable_thread_name LONG, enable_self_slice LONG, enable_critical_path_slice LONG) +CREATE PERFETTO FUNCTION _critical_path_stack(root_utid LONG, ts TIMESTAMP, dur DURATION, enable_process_name LONG, enable_thread_name LONG, enable_self_slice LONG, enable_critical_path_slice LONG) RETURNS TABLE( id LONG, ts TIMESTAMP, - dur LONG, + dur DURATION, utid LONG, stack_depth LONG, name STRING, @@ -557,7 +557,7 @@ CREATE PERFETTO FUNCTION _thread_executing_span_critical_path_stack( -- Timestamp of start of time range to filter critical paths to. ts TIMESTAMP, -- Duration of time range to filter critical paths to. - dur LONG) + dur DURATION) RETURNS TABLE( -- Id of the thread_state or slice in the thread_executing_span. @@ -565,7 +565,7 @@ RETURNS -- Timestamp of slice in the critical path. ts TIMESTAMP, -- Duration of slice in the critical path. - dur LONG, + dur DURATION, -- Utid of thread that emitted the slice. utid LONG, -- Stack depth of the entitity in the debug track. @@ -580,7 +580,7 @@ RETURNS SELECT * FROM _critical_path_stack($root_utid, $ts, $dur, 1, 1, 1, 1); -- Returns a pprof aggregation of the stacks in |_critical_path_stack|. -CREATE PERFETTO FUNCTION _critical_path_graph(graph_title STRING, root_utid LONG, ts TIMESTAMP, dur LONG, enable_process_name LONG, enable_thread_name LONG, enable_self_slice LONG, enable_critical_path_slice LONG) +CREATE PERFETTO FUNCTION _critical_path_graph(graph_title STRING, root_utid LONG, ts TIMESTAMP, dur DURATION, enable_process_name LONG, enable_thread_name LONG, enable_self_slice LONG, enable_critical_path_slice LONG) RETURNS TABLE(pprof BYTES) AS WITH @@ -639,7 +639,7 @@ CREATE PERFETTO FUNCTION _thread_executing_span_critical_path_graph( -- Timestamp of start of time range to filter critical paths to. ts TIMESTAMP, -- Duration of time range to filter critical paths to. - dur LONG) + dur DURATION) RETURNS TABLE( -- Pprof of critical path stacks. pprof BYTES diff --git a/src/trace_processor/perfetto_sql/stdlib/sched/thread_state_flattened.sql b/src/trace_processor/perfetto_sql/stdlib/sched/thread_state_flattened.sql index 5d8313bf19..8f5e1c9488 100644 --- a/src/trace_processor/perfetto_sql/stdlib/sched/thread_state_flattened.sql +++ b/src/trace_processor/perfetto_sql/stdlib/sched/thread_state_flattened.sql @@ -34,7 +34,7 @@ RETURNS -- Timestamp. ts TIMESTAMP, -- Duration. - dur LONG, + dur DURATION, -- Utid. utid LONG, -- Depth. @@ -138,7 +138,7 @@ RETURNS TABLE( -- Time (ns) spent in Idle Idle LONG, -- Total duration of the slice - dur LONG, + dur DURATION, -- Depth of the slice in Perfetto depth LONG) AS diff --git a/src/trace_processor/perfetto_sql/stdlib/sched/time_in_state.sql b/src/trace_processor/perfetto_sql/stdlib/sched/time_in_state.sql index d8854bcd32..f38f4a2b08 100644 --- a/src/trace_processor/perfetto_sql/stdlib/sched/time_in_state.sql +++ b/src/trace_processor/perfetto_sql/stdlib/sched/time_in_state.sql @@ -104,7 +104,7 @@ CREATE PERFETTO FUNCTION sched_time_in_state_for_thread_in_interval( -- The start of the interval. ts TIMESTAMP, -- The duration of the interval. - dur LONG, + dur DURATION, -- The utid of the thread. utid LONG ) @@ -126,7 +126,7 @@ RETURNS TABLE( blocked_function LONG, -- The duration of time the threads slice spent for each -- (state, io_wait, blocked_function) tuple. - dur LONG + dur DURATION ) AS SELECT state, @@ -153,7 +153,7 @@ CREATE PERFETTO FUNCTION sched_time_in_state_and_cpu_for_thread_in_interval( -- The start of the interval. ts TIMESTAMP, -- The duration of the interval. - dur LONG, + dur DURATION, -- The utid of the thread. utid LONG) RETURNS TABLE( @@ -168,7 +168,7 @@ RETURNS TABLE( -- Some states can specify the blocked function. Usually NULL. blocked_function LONG, -- Total time spent with this state, cpu and blocked function. - dur LONG) AS + dur DURATION) AS SELECT state, io_wait, diff --git a/src/trace_processor/perfetto_sql/stdlib/slices/hierarchy.sql b/src/trace_processor/perfetto_sql/stdlib/slices/hierarchy.sql index b2cce9e9c9..c68c549c8e 100644 --- a/src/trace_processor/perfetto_sql/stdlib/slices/hierarchy.sql +++ b/src/trace_processor/perfetto_sql/stdlib/slices/hierarchy.sql @@ -26,7 +26,7 @@ RETURNS TABLE( -- Alias of `slice.ts`. ts TIMESTAMP, -- Alias of `slice.dur`. - dur LONG, + dur DURATION, -- Alias of `slice.track_id`. track_id LONG, -- Alias of `slice.category`. @@ -66,7 +66,7 @@ RETURNS TABLE( -- Alias of `slice.ts`. ts TIMESTAMP, -- Alias of `slice.dur`. - dur LONG, + dur DURATION, -- Alias of `slice.track_id`. track_id LONG, -- Alias of `slice.category`. diff --git a/src/trace_processor/perfetto_sql/stdlib/slices/slices.sql b/src/trace_processor/perfetto_sql/stdlib/slices/slices.sql index 379807d6df..ab653f5d28 100644 --- a/src/trace_processor/perfetto_sql/stdlib/slices/slices.sql +++ b/src/trace_processor/perfetto_sql/stdlib/slices/slices.sql @@ -25,7 +25,7 @@ CREATE PERFETTO VIEW _slice_with_thread_and_process_info( -- Alias for `slice.ts`. ts TIMESTAMP, -- Alias for `slice.dur`. - dur LONG, + dur DURATION, -- Alias for `slice.category`. category STRING, -- Alias for `slice.name`. diff --git a/src/trace_processor/perfetto_sql/stdlib/slices/time_in_state.sql b/src/trace_processor/perfetto_sql/stdlib/slices/time_in_state.sql index 49814aac34..882ea63be0 100644 --- a/src/trace_processor/perfetto_sql/stdlib/slices/time_in_state.sql +++ b/src/trace_processor/perfetto_sql/stdlib/slices/time_in_state.sql @@ -51,7 +51,7 @@ CREATE PERFETTO TABLE thread_slice_time_in_state( blocked_function LONG, -- The duration of time the threads slice spent for each -- (state, io_wait, blocked_function) tuple. - dur LONG + dur DURATION ) AS SELECT ii.id_0 AS id, diff --git a/src/trace_processor/perfetto_sql/stdlib/slices/with_context.sql b/src/trace_processor/perfetto_sql/stdlib/slices/with_context.sql index d3d8bd6e79..cae9f27120 100644 --- a/src/trace_processor/perfetto_sql/stdlib/slices/with_context.sql +++ b/src/trace_processor/perfetto_sql/stdlib/slices/with_context.sql @@ -23,7 +23,7 @@ CREATE PERFETTO VIEW thread_slice( -- Alias for `slice.ts`. ts TIMESTAMP, -- Alias for `slice.dur`. - dur LONG, + dur DURATION, -- Alias for `slice.category`. category STRING, -- Alias for `slice.name`. @@ -93,7 +93,7 @@ CREATE PERFETTO VIEW process_slice( -- Alias for `slice.ts`. ts TIMESTAMP, -- Alias for `slice.dur`. - dur LONG, + dur DURATION, -- Alias for `slice.category`. category STRING, -- Alias for `slice.name`. diff --git a/src/trace_processor/perfetto_sql/stdlib/time/conversion.sql b/src/trace_processor/perfetto_sql/stdlib/time/conversion.sql index 81b5972c58..e39fac4db4 100644 --- a/src/trace_processor/perfetto_sql/stdlib/time/conversion.sql +++ b/src/trace_processor/perfetto_sql/stdlib/time/conversion.sql @@ -21,7 +21,7 @@ CREATE PERFETTO FUNCTION time_from_ns( nanos LONG ) -- Time duration in nanoseconds. -RETURNS LONG AS +RETURNS TIMESTAMP AS SELECT $nanos; -- Converts a duration in microseconds to nanoseconds, which is the default @@ -41,7 +41,7 @@ CREATE PERFETTO FUNCTION time_from_ms( millis LONG ) -- Time duration in nanoseconds. -RETURNS LONG AS +RETURNS TIMESTAMP AS SELECT $millis * 1000 * 1000; -- Converts a duration in seconds to nanoseconds, which is the default @@ -51,7 +51,7 @@ CREATE PERFETTO FUNCTION time_from_s( seconds LONG ) -- Time duration in nanoseconds. -RETURNS LONG AS +RETURNS TIMESTAMP AS SELECT $seconds * 1000 * 1000 * 1000; -- Converts a duration in minutes to nanoseconds, which is the default @@ -61,7 +61,7 @@ CREATE PERFETTO FUNCTION time_from_min( minutes LONG ) -- Time duration in nanoseconds. -RETURNS LONG AS +RETURNS TIMESTAMP AS SELECT $minutes * 60 * 1000 * 1000 * 1000; -- Converts a duration in hours to nanoseconds, which is the default @@ -71,7 +71,7 @@ CREATE PERFETTO FUNCTION time_from_hours( hours LONG ) -- Time duration in nanoseconds. -RETURNS LONG AS +RETURNS TIMESTAMP AS SELECT $hours * 60 * 60 * 1000 * 1000 * 1000; -- Converts a duration in days to nanoseconds, which is the default @@ -89,7 +89,7 @@ SELECT $days * 24 * 60 * 60 * 1000 * 1000 * 1000; -- consistency with other functions. CREATE PERFETTO FUNCTION time_to_ns( -- Time duration in nanoseconds. - nanos LONG + nanos TIMESTAMP ) -- Time duration in nanoseconds. RETURNS LONG AS @@ -99,7 +99,7 @@ SELECT $nanos; -- representation of time durations in trace processor. CREATE PERFETTO FUNCTION time_to_us( -- Time duration in nanoseconds. - nanos LONG + nanos TIMESTAMP ) -- Time duration in microseconds. RETURNS LONG AS @@ -109,7 +109,7 @@ SELECT $nanos / 1000; -- representation of time durations in trace processor. CREATE PERFETTO FUNCTION time_to_ms( -- Time duration in nanoseconds. - nanos LONG + nanos TIMESTAMP ) -- Time duration in milliseconds. RETURNS LONG AS @@ -119,7 +119,7 @@ SELECT $nanos / (1000 * 1000); -- representation of time durations in trace processor. CREATE PERFETTO FUNCTION time_to_s( -- Time duration in nanoseconds. - nanos LONG + nanos TIMESTAMP ) -- Time duration in seconds. RETURNS LONG AS @@ -129,7 +129,7 @@ SELECT $nanos / (1000 * 1000 * 1000); -- representation of time durations in trace processor. CREATE PERFETTO FUNCTION time_to_min( -- Time duration in nanoseconds. - nanos LONG + nanos TIMESTAMP ) -- Time duration in minutes. RETURNS LONG AS @@ -139,7 +139,7 @@ SELECT $nanos / (60 * 1000 * 1000 * 1000); -- representation of time durations in trace processor. CREATE PERFETTO FUNCTION time_to_hours( -- Time duration in nanoseconds. - nanos LONG + nanos TIMESTAMP ) -- Time duration in hours. RETURNS LONG AS @@ -149,7 +149,7 @@ SELECT $nanos / (60 * 60 * 1000 * 1000 * 1000); -- representation of time durations in trace processor. CREATE PERFETTO FUNCTION time_to_days( -- Time duration in nanoseconds. - nanos LONG + nanos TIMESTAMP ) -- Time duration in days. RETURNS LONG AS diff --git a/src/trace_processor/perfetto_sql/stdlib/wattson/arm_dsu.sql b/src/trace_processor/perfetto_sql/stdlib/wattson/arm_dsu.sql index de4fd9b43c..d53c562bb4 100644 --- a/src/trace_processor/perfetto_sql/stdlib/wattson/arm_dsu.sql +++ b/src/trace_processor/perfetto_sql/stdlib/wattson/arm_dsu.sql @@ -15,7 +15,7 @@ -- Converts event counter from count to rate (num of accesses per ns). CREATE PERFETTO FUNCTION _get_rate(event STRING) -RETURNS TABLE(ts TIMESTAMP, dur LONG, access_rate LONG) +RETURNS TABLE(ts TIMESTAMP, dur DURATION, access_rate LONG) AS SELECT ts, diff --git a/src/trace_processor/perfetto_sql/stdlib/wattson/curves/estimates.sql b/src/trace_processor/perfetto_sql/stdlib/wattson/curves/estimates.sql index a1ae11829c..cafda98dd4 100644 --- a/src/trace_processor/perfetto_sql/stdlib/wattson/curves/estimates.sql +++ b/src/trace_processor/perfetto_sql/stdlib/wattson/curves/estimates.sql @@ -23,7 +23,7 @@ INCLUDE PERFETTO MODULE wattson.device_infos; -- dependent on devfreq or a different CPU's frequency CREATE PERFETTO VIEW _curves_w_dependencies( ts TIMESTAMP, - dur LONG, + dur DURATION, freq_0 LONG, idle_0 LONG, freq_1 LONG, diff --git a/src/trace_processor/perfetto_sql/stdlib/wattson/system_state.sql b/src/trace_processor/perfetto_sql/stdlib/wattson/system_state.sql index 0f156606f8..7f02513b92 100644 --- a/src/trace_processor/perfetto_sql/stdlib/wattson/system_state.sql +++ b/src/trace_processor/perfetto_sql/stdlib/wattson/system_state.sql @@ -21,7 +21,7 @@ CREATE PERFETTO TABLE wattson_system_states( -- Starting timestamp of the current counter where system state is constant. ts TIMESTAMP, -- Duration of the current counter where system state is constant. - dur LONG, + dur DURATION, -- Number of L3 hits the current system state. l3_hit_count LONG, -- Number of L3 misses in the current system state. diff --git a/src/trace_processor/util/sql_argument.cc b/src/trace_processor/util/sql_argument.cc index 80eb3531f9..543c018354 100644 --- a/src/trace_processor/util/sql_argument.cc +++ b/src/trace_processor/util/sql_argument.cc @@ -34,30 +34,33 @@ std::optional ParseType(base::StringView str) { if (str.CaseInsensitiveEq("bool")) { return Type::kBool; } - if (str.CaseInsensitiveEq("int") || str.CaseInsensitiveEq("timestamp")) { - return Type::kInt; - } - if (str.CaseInsensitiveEq("uint")) { - return Type::kUint; - } - if (str.CaseInsensitiveEq("long")) { + if (str.CaseInsensitiveOneOf({"long", "timestamp", "duration"})) { return Type::kLong; } - if (str.CaseInsensitiveEq("float")) { - return Type::kFloat; - } if (str.CaseInsensitiveEq("double")) { return Type::kDouble; } if (str.CaseInsensitiveEq("string")) { return Type::kString; } - if (str.CaseInsensitiveEq("proto")) { - return Type::kProto; - } if (str.CaseInsensitiveEq("bytes")) { return Type::kBytes; } + + // Deprecated types. + // TODO(b/380259828): Remove. + if (str.CaseInsensitiveEq("int")) { + return Type::kInt; + } + if (str.CaseInsensitiveEq("uint")) { + return Type::kUint; + } + if (str.CaseInsensitiveEq("float")) { + return Type::kFloat; + } + if (str.CaseInsensitiveEq("proto")) { + return Type::kProto; + } return std::nullopt; } diff --git a/src/trace_processor/util/sql_argument.h b/src/trace_processor/util/sql_argument.h index 3856523ef9..d9188976ef 100644 --- a/src/trace_processor/util/sql_argument.h +++ b/src/trace_processor/util/sql_argument.h @@ -33,13 +33,16 @@ namespace sql_argument { // and, when lots of values are stored, reduced memory usage. enum class Type { kBool, - kInt, - kUint, kLong, - kFloat, kDouble, kString, + + // Deprecated types. + // TODO(b/380259828): Remove. + kInt, + kUint, kProto, + kFloat, kBytes, };