Merge "App freezer stat logs"

This commit is contained in:
TreeHugger Robot
2020-02-10 15:43:42 +00:00
committed by Android (Google) Code Review
2 changed files with 45 additions and 0 deletions

View File

@@ -391,6 +391,7 @@ message Atom {
WifiHealthStatReported wifi_health_stat_reported = 251 [(module) = "wifi"];
WifiFailureStatReported wifi_failure_stat_reported = 252 [(module) = "wifi"];
WifiConnectionResultReported wifi_connection_result_reported = 253 [(module) = "wifi"];
AppFreezeChanged app_freeze_changed = 254 [(module) = "framework"];
SdkExtensionStatus sdk_extension_status = 354;
}
@@ -8366,3 +8367,28 @@ message SdkExtensionStatus {
// "Failed" here can mean a symbol that wasn't meant to be visible was, or the other way around.
optional int32 failed_call_symbol = 3;
}
/**
* Logs when an app is frozen or unfrozen.
*
* Logged from:
* frameworks/base/services/core/java/com/android/server/am/CachedAppOptimizer.java
*/
message AppFreezeChanged {
// The type of event.
enum Action {
UNKNOWN = 0;
FREEZE_APP = 1;
UNFREEZE_APP = 2;
}
optional Action action = 1;
// Pid of the process being frozen.
optional int32 pid = 2;
// Name of the process being frozen.
optional string process_name = 3;
// Time since last unfrozen.
optional int64 time_unfrozen_millis = 4;
}

View File

@@ -946,6 +946,15 @@ public final class CachedAppOptimizer {
}
EventLog.writeEvent(EventLogTags.AM_FREEZE, pid, name);
// See above for why we're not taking mPhenotypeFlagLock here
if (mRandom.nextFloat() < mFreezerStatsdSampleRate) {
FrameworkStatsLog.write(FrameworkStatsLog.APP_FREEZE_CHANGED,
FrameworkStatsLog.APP_FREEZE_CHANGED__ACTION__FREEZE_APP,
pid,
name,
unfrozenDuration);
}
}
}
@@ -994,6 +1003,16 @@ public final class CachedAppOptimizer {
}
EventLog.writeEvent(EventLogTags.AM_UNFREEZE, pid, name);
// See above for why we're not taking mPhenotypeFlagLock here
if (mRandom.nextFloat() < mFreezerStatsdSampleRate) {
FrameworkStatsLog.write(
FrameworkStatsLog.APP_FREEZE_CHANGED,
FrameworkStatsLog.APP_FREEZE_CHANGED__ACTION__UNFREEZE_APP,
pid,
name,
frozenDuration);
}
}
}
}