Unverified Commit 54ac7bc9 authored by Yuqian Li's avatar Yuqian Li Committed by GitHub

Reland "Default measureCpuGpu to true (#66386)" (#66604)

This reverts commit 2d9e5005.

In addition, this fixes broken Android tests of the original PR.
parent 65159afb
...@@ -15,7 +15,7 @@ import 'package:flutter_devicelab/framework/framework.dart'; ...@@ -15,7 +15,7 @@ import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/framework/utils.dart'; import 'package:flutter_devicelab/framework/utils.dart';
import 'package:flutter_devicelab/tasks/track_widget_creation_enabled_task.dart'; import 'package:flutter_devicelab/tasks/track_widget_creation_enabled_task.dart';
TaskFunction createComplexLayoutScrollPerfTest({bool measureCpuGpu = false}) { TaskFunction createComplexLayoutScrollPerfTest({bool measureCpuGpu = true}) {
return PerfTest( return PerfTest(
'${flutterDirectory.path}/dev/benchmarks/complex_layout', '${flutterDirectory.path}/dev/benchmarks/complex_layout',
'test_driver/scroll_perf.dart', 'test_driver/scroll_perf.dart',
...@@ -131,7 +131,7 @@ TaskFunction createFlutterGalleryTransitionsPerfSkSLWarmupE2ETest() { ...@@ -131,7 +131,7 @@ TaskFunction createFlutterGalleryTransitionsPerfSkSLWarmupE2ETest() {
).run; ).run;
} }
TaskFunction createBackdropFilterPerfTest({bool measureCpuGpu = false}) { TaskFunction createBackdropFilterPerfTest({bool measureCpuGpu = true}) {
return PerfTest( return PerfTest(
'${flutterDirectory.path}/dev/benchmarks/macrobenchmarks', '${flutterDirectory.path}/dev/benchmarks/macrobenchmarks',
'test_driver/run_app.dart', 'test_driver/run_app.dart',
...@@ -149,7 +149,7 @@ TaskFunction createBackdropFilterPerfE2ETest() { ...@@ -149,7 +149,7 @@ TaskFunction createBackdropFilterPerfE2ETest() {
).run; ).run;
} }
TaskFunction createPostBackdropFilterPerfTest({bool measureCpuGpu = false}) { TaskFunction createPostBackdropFilterPerfTest({bool measureCpuGpu = true}) {
return PerfTest( return PerfTest(
'${flutterDirectory.path}/dev/benchmarks/macrobenchmarks', '${flutterDirectory.path}/dev/benchmarks/macrobenchmarks',
'test_driver/run_app.dart', 'test_driver/run_app.dart',
...@@ -160,7 +160,7 @@ TaskFunction createPostBackdropFilterPerfTest({bool measureCpuGpu = false}) { ...@@ -160,7 +160,7 @@ TaskFunction createPostBackdropFilterPerfTest({bool measureCpuGpu = false}) {
).run; ).run;
} }
TaskFunction createSimpleAnimationPerfTest({bool measureCpuGpu = false}) { TaskFunction createSimpleAnimationPerfTest({bool measureCpuGpu = true}) {
return PerfTest( return PerfTest(
'${flutterDirectory.path}/dev/benchmarks/macrobenchmarks', '${flutterDirectory.path}/dev/benchmarks/macrobenchmarks',
'test_driver/run_app.dart', 'test_driver/run_app.dart',
...@@ -171,7 +171,7 @@ TaskFunction createSimpleAnimationPerfTest({bool measureCpuGpu = false}) { ...@@ -171,7 +171,7 @@ TaskFunction createSimpleAnimationPerfTest({bool measureCpuGpu = false}) {
).run; ).run;
} }
TaskFunction createAnimatedPlaceholderPerfTest({bool measureCpuGpu = false}) { TaskFunction createAnimatedPlaceholderPerfTest({bool measureCpuGpu = true}) {
return PerfTest( return PerfTest(
'${flutterDirectory.path}/dev/benchmarks/macrobenchmarks', '${flutterDirectory.path}/dev/benchmarks/macrobenchmarks',
'test_driver/run_app.dart', 'test_driver/run_app.dart',
...@@ -482,7 +482,7 @@ class PerfTest { ...@@ -482,7 +482,7 @@ class PerfTest {
this.testDirectory, this.testDirectory,
this.testTarget, this.testTarget,
this.timelineFileName, { this.timelineFileName, {
this.measureCpuGpu = false, this.measureCpuGpu = true,
this.measureMemory = false, this.measureMemory = false,
this.saveTraceFile = false, this.saveTraceFile = false,
this.testDriver, this.testDriver,
...@@ -495,7 +495,7 @@ class PerfTest { ...@@ -495,7 +495,7 @@ class PerfTest {
const PerfTest.e2e( const PerfTest.e2e(
this.testDirectory, this.testDirectory,
this.testTarget, { this.testTarget, {
this.measureCpuGpu = false, this.measureCpuGpu = true,
this.measureMemory = false, this.measureMemory = false,
this.testDriver = 'test_driver/e2e_test.dart', this.testDriver = 'test_driver/e2e_test.dart',
this.needsFullTimeline = false, this.needsFullTimeline = false,
...@@ -601,6 +601,9 @@ class PerfTest { ...@@ -601,6 +601,9 @@ class PerfTest {
); );
} }
// TODO(liyuqian): Remove isAndroid restriction once
// https://github.com/flutter/flutter/issues/61567 is fixed.
final bool isAndroid = deviceOperatingSystem == DeviceOperatingSystem.android;
return TaskResult.success( return TaskResult.success(
data, data,
detailFiles: detailFiles.isNotEmpty ? detailFiles : null, detailFiles: detailFiles.isNotEmpty ? detailFiles : null,
...@@ -609,9 +612,15 @@ class PerfTest { ...@@ -609,9 +612,15 @@ class PerfTest {
'average_vsync_transitions_missed', 'average_vsync_transitions_missed',
'90th_percentile_vsync_transitions_missed', '90th_percentile_vsync_transitions_missed',
'99th_percentile_vsync_transitions_missed', '99th_percentile_vsync_transitions_missed',
if (measureCpuGpu) 'average_cpu_usage', if (measureCpuGpu && !isAndroid) ...<String>[
if (measureCpuGpu) 'average_gpu_usage', 'average_cpu_usage',
if (measureMemory) ...<String>['average_memory_usage', '90th_percentile_memory_usage', '99th_percentile_memory_usage'], 'average_gpu_usage',
],
if (measureMemory && !isAndroid) ...<String>[
'average_memory_usage',
'90th_percentile_memory_usage',
'99th_percentile_memory_usage',
],
], ],
); );
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment