Merge "Add ART optimization dimension to reportFullyDrawn" into rvc-qpr-dev

This commit is contained in:
TreeHugger Robot
2020-12-04 16:01:50 +00:00
committed by Android (Google) Code Review
2 changed files with 19 additions and 8 deletions

View File

@@ -3661,6 +3661,12 @@ message AppStartFullyDrawn {
// App startup time (until call to Activity#reportFullyDrawn()). // App startup time (until call to Activity#reportFullyDrawn()).
optional int64 app_startup_time_millis = 6; optional int64 app_startup_time_millis = 6;
// The compiler filter used when when the package was optimized.
optional int32 package_optimization_compilation_filter = 7;
// The reason why the package was optimized.
optional int32 package_optimization_compilation_reason = 8;
} }
/** /**

View File

@@ -372,6 +372,13 @@ class ActivityMetricsLogger {
return -1; return -1;
} }
} }
PackageOptimizationInfo getPackageOptimizationInfo(ArtManagerInternal artManagerInternal) {
return artManagerInternal == null || launchedActivityAppRecordRequiredAbi == null
? PackageOptimizationInfo.createWithNoInfo()
: artManagerInternal.getPackageOptimizationInfo(applicationInfo,
launchedActivityAppRecordRequiredAbi, launchedActivityName);
}
} }
ActivityMetricsLogger(ActivityStackSupervisor supervisor, Looper looper) { ActivityMetricsLogger(ActivityStackSupervisor supervisor, Looper looper) {
@@ -832,14 +839,8 @@ class ActivityMetricsLogger {
info.bindApplicationDelayMs); info.bindApplicationDelayMs);
} }
builder.addTaggedData(APP_TRANSITION_WINDOWS_DRAWN_DELAY_MS, info.windowsDrawnDelayMs); builder.addTaggedData(APP_TRANSITION_WINDOWS_DRAWN_DELAY_MS, info.windowsDrawnDelayMs);
final ArtManagerInternal artManagerInternal = getArtManagerInternal();
final PackageOptimizationInfo packageOptimizationInfo = final PackageOptimizationInfo packageOptimizationInfo =
(artManagerInternal == null) || (info.launchedActivityAppRecordRequiredAbi == null) info.getPackageOptimizationInfo(getArtManagerInternal());
? PackageOptimizationInfo.createWithNoInfo()
: artManagerInternal.getPackageOptimizationInfo(
info.applicationInfo,
info.launchedActivityAppRecordRequiredAbi,
info.launchedActivityName);
builder.addTaggedData(PACKAGE_OPTIMIZATION_COMPILATION_REASON, builder.addTaggedData(PACKAGE_OPTIMIZATION_COMPILATION_REASON,
packageOptimizationInfo.getCompilationReason()); packageOptimizationInfo.getCompilationReason());
builder.addTaggedData(PACKAGE_OPTIMIZATION_COMPILATION_FILTER, builder.addTaggedData(PACKAGE_OPTIMIZATION_COMPILATION_FILTER,
@@ -958,6 +959,8 @@ class ActivityMetricsLogger {
builder.addTaggedData(APP_TRANSITION_PROCESS_RUNNING, builder.addTaggedData(APP_TRANSITION_PROCESS_RUNNING,
info.mProcessRunning ? 1 : 0); info.mProcessRunning ? 1 : 0);
mMetricsLogger.write(builder); mMetricsLogger.write(builder);
final PackageOptimizationInfo packageOptimizationInfo =
infoSnapshot.getPackageOptimizationInfo(getArtManagerInternal());
FrameworkStatsLog.write( FrameworkStatsLog.write(
FrameworkStatsLog.APP_START_FULLY_DRAWN, FrameworkStatsLog.APP_START_FULLY_DRAWN,
info.mLastLaunchedActivity.info.applicationInfo.uid, info.mLastLaunchedActivity.info.applicationInfo.uid,
@@ -967,7 +970,9 @@ class ActivityMetricsLogger {
: FrameworkStatsLog.APP_START_FULLY_DRAWN__TYPE__WITHOUT_BUNDLE, : FrameworkStatsLog.APP_START_FULLY_DRAWN__TYPE__WITHOUT_BUNDLE,
info.mLastLaunchedActivity.info.name, info.mLastLaunchedActivity.info.name,
info.mProcessRunning, info.mProcessRunning,
startupTimeMs); startupTimeMs,
packageOptimizationInfo.getCompilationReason(),
packageOptimizationInfo.getCompilationFilter());
// Ends the trace started at the beginning of this function. This is located here to allow // Ends the trace started at the beginning of this function. This is located here to allow
// the trace slice to have a noticable duration. // the trace slice to have a noticable duration.