1. power键亮屏超时
power键亮屏200ms超时触发
frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
/** If turning screen on takes more than this long, we show a warning on logcat. */
private static final int SCREEN_ON_LATENCY_WARNING_MS = 200;
/**
* Updates the state of all {@link PowerGroup}s asynchronously.
* When the update is finished, the ready state of the {@link PowerGroup} will be updated.
* The display controllers post a message to tell us when the actual display power state
* has been updated so we come back here to double-check and finish up.
*
* This function recalculates the {@link PowerGroup} state each time.
*
* @return {@code true} if all {@link PowerGroup}s became ready; {@code false} otherwise
*/
@GuardedBy("mLock")
private boolean updatePowerGroupsLocked(int dirty) {
...
final boolean displayReadyStateChanged = powerGroup.setReadyLocked(ready);
final boolean poweringOn = powerGroup.isPoweringOnLocked();
if (ready && displayReadyStateChanged && poweringOn
&& wakefulness == WAKEFULNESS_AWAKE) {
powerGroup.setIsPoweringOnLocked(false);
LatencyTracker.getInstance(mContext).onActionEnd(ACTION_TURN_ON_SCREEN);
Trace.asyncTraceEnd(Trace.TRACE_TAG_POWER, TRACE_SCREEN_ON, groupId);
final int latencyMs = (int) (mClock.uptimeMillis()
- powerGroup.getLastPowerOnTimeLocked());
if (latencyMs >= SCREEN_ON_LATENCY_WARNING_MS) {
Slog.w(TAG, "Screen on took " + latencyMs + " ms");
}
}
..
2. Loading/CPU内存使用率统计