-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge "stdlib: Add sched.latency module" into main
- Loading branch information
Showing
6 changed files
with
88 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
-- | ||
-- Copyright 2024 The Android Open Source Project | ||
-- | ||
-- Licensed under the Apache License, Version 2.0 (the "License"); | ||
-- you may not use this file except in compliance with the License. | ||
-- You may obtain a copy of the License at | ||
-- | ||
-- https://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, software | ||
-- distributed under the License is distributed on an "AS IS" BASIS, | ||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
-- See the License for the specific language governing permissions and | ||
-- limitations under the License. | ||
|
||
INCLUDE PERFETTO MODULE sched.runnable; | ||
|
||
CREATE PERFETTO VIEW _sched_with_thread_state_join AS | ||
SELECT | ||
thread_state.id AS thread_state_id, | ||
sched.id AS sched_id | ||
FROM sched | ||
JOIN thread_state USING (utid, ts, dur); | ||
|
||
-- Scheduling latency of running thread states. | ||
-- For each time the thread was running, returns the duration of the runnable | ||
-- state directly before. | ||
CREATE PERFETTO TABLE sched_latency_for_running_interval( | ||
-- Running state of the thread. Alias of `thread_state.id`. | ||
thread_state_id INT, | ||
-- Id of a corresponding slice in a `sched` table. Alias of `sched.id`. | ||
sched_id INT, | ||
-- Thread with running state. Alias of `thread.id`. | ||
utid INT, | ||
-- Runnable state before thread is "running". Duration of this thread state | ||
-- is `latency_dur`. One of `thread_state.id`. | ||
runnable_latency_id INT, | ||
-- Scheduling latency of thread state. Duration of thread state with | ||
-- `runnable_latency_id`. | ||
latency_dur INT | ||
) AS | ||
SELECT | ||
r.id AS thread_state_id, | ||
sched_id, | ||
utid, | ||
prev_runnable_id AS runnable_latency_id, | ||
dur AS latency_dur | ||
FROM sched_previous_runnable_on_thread r | ||
JOIN thread_state prev_ts ON prev_runnable_id = prev_ts.id | ||
JOIN _sched_with_thread_state_join ON thread_state_id = r.id | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters