-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This polls the suspend control service at a configurable interval and records what we get back. We intern wakelock metadata (name and type) and delta-ify the change to get smaller integers. Bug: 389077525 Change-Id: I10558d3a5de6bb5a2e5f8a69cea58eebaa4a88aa
- Loading branch information
Simon MacMullen
committed
Jan 14, 2025
1 parent
804e1cd
commit 1a22d53
Showing
19 changed files
with
667 additions
and
5 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
25 changes: 25 additions & 0 deletions
25
protos/perfetto/config/android/kernel_wakelocks_config.proto
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,25 @@ | ||
/* | ||
* Copyright (C) 2025 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; | ||
|
||
// Data source that records kernel (and native) wakelock data. | ||
message KernelWakelocksConfig { | ||
// Record at this frequency. | ||
optional uint32 poll_ms = 1; | ||
} |
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 2025 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; | ||
|
||
message KernelWakelockData { | ||
message Wakelock { | ||
enum Type { | ||
WAKELOCK_TYPE_UNKNOWN = 0; | ||
WAKELOCK_TYPE_KERNEL = 1; | ||
WAKELOCK_TYPE_NATIVE = 2; | ||
} | ||
|
||
// Interning id. | ||
optional uint32 wakelock_id = 1; | ||
|
||
// Name of the wakelock. | ||
optional string wakelock_name = 2; | ||
|
||
// Type of the wakelock. We record data about both true kernel wakelocks | ||
// and "native" wakelocks which are taken in userspace but are more | ||
// conceptually similar to kernel wakelocks than normal userspace ones. | ||
optional Type wakelock_type = 3; | ||
} | ||
|
||
// This is only emitted when we encounter new wakelocks. | ||
repeated Wakelock wakelock = 1; | ||
|
||
// Interning id. | ||
repeated uint32 wakelock_id = 2 [packed = true]; | ||
|
||
// If we interned the wakelock name in this packet, this is the total time | ||
// the wakelock has been held. | ||
// If not, it's a delta from the last time we saw it. | ||
repeated uint64 time_held_millis = 3 [packed = true]; | ||
} |
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 |
---|---|---|
|
@@ -34,6 +34,7 @@ if (perfetto_build_with_android) { | |
"power_stats.cc", | ||
"statsd.cc", | ||
"statsd_logging.cc", | ||
"suspend_control_service.cc", | ||
"tracing_service_proxy.cc", | ||
] | ||
libs = [ | ||
|
@@ -42,6 +43,7 @@ if (perfetto_build_with_android) { | |
"[email protected]", | ||
"android.hardware.power.stats-V1-cpp", | ||
"[email protected]", | ||
"android.system.suspend.control.internal-cpp", | ||
"statslog_perfetto", | ||
"statssocket", | ||
"cutils", | ||
|
@@ -79,6 +81,7 @@ source_set("headers") { | |
"power_stats.h", | ||
"statsd.h", | ||
"statsd_logging.h", | ||
"suspend_control_service.h", | ||
"tracing_service_proxy.h", | ||
] | ||
} | ||
|
Oops, something went wrong.