-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge "Add android_boot metric" into main
- Loading branch information
Showing
11 changed files
with
144 additions
and
6 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,32 @@ | ||
/* | ||
* Copyright (C) 2023 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 | ||
* | ||
* http://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. | ||
*/ | ||
|
||
syntax = "proto2"; | ||
|
||
package perfetto.protos; | ||
|
||
// This metric computes how much time processes spend in UNINTERRUPTIBLE_SLEEP state | ||
message ProcessStateDurations { | ||
optional int64 total_dur = 2; | ||
optional int64 uninterruptible_sleep_dur = 3; | ||
} | ||
|
||
message AndroidBootMetric { | ||
optional ProcessStateDurations system_server_durations = 1; | ||
optional ProcessStateDurations systemui_durations = 2; | ||
optional ProcessStateDurations launcher_durations = 3; | ||
optional ProcessStateDurations gms_durations = 4; | ||
} |
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
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 2023 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 android.process_metadata; | ||
|
||
CREATE PERFETTO FUNCTION get_durations(process_name STRING) | ||
RETURNS TABLE(uint_sleep_dur LONG, total_dur LONG) AS | ||
SELECT | ||
SUM(CASE WHEN thread_state.state="D" then thread_state.dur ELSE 0 END) AS uint_sleep_dur, | ||
SUM(thread_state.dur) as total_dur | ||
FROM android_process_metadata | ||
INNER JOIN thread ON thread.upid=android_process_metadata.upid | ||
INNER JOIN thread_state ON thread.utid=thread_state.utid WHERE android_process_metadata.process_name=$process_name; | ||
|
||
DROP VIEW IF EXISTS android_boot_output; | ||
CREATE VIEW android_boot_output AS | ||
SELECT AndroidBootMetric( | ||
'system_server_durations', ( | ||
SELECT NULL_IF_EMPTY(ProcessStateDurations( | ||
'total_dur', total_dur, | ||
'uninterruptible_sleep_dur', uint_sleep_dur)) | ||
FROM get_durations('system_server')), | ||
'systemui_durations', ( | ||
SELECT NULL_IF_EMPTY(ProcessStateDurations( | ||
'total_dur', total_dur, | ||
'uninterruptible_sleep_dur', uint_sleep_dur)) | ||
FROM get_durations('com.android.systemui')), | ||
'launcher_durations', ( | ||
SELECT NULL_IF_EMPTY(ProcessStateDurations( | ||
'total_dur', total_dur, | ||
'uninterruptible_sleep_dur', uint_sleep_dur)) | ||
FROM get_durations('com.google.android.apps.nexuslauncher')), | ||
'gms_durations', ( | ||
SELECT NULL_IF_EMPTY(ProcessStateDurations( | ||
'total_dur', total_dur, | ||
'uninterruptible_sleep_dur', uint_sleep_dur)) | ||
FROM get_durations('com.google.android.gms.persistent')) | ||
); |
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 @@ | ||
660231895e7c1816bcbd02771fdf825917ba0540124c3fdd174c1a91470b9448 |
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