Add a flag to enable tracing to systrace. (#27208)

This commit is contained in:
Chinmay Garde
2019-01-28 19:55:01 -08:00
committed by GitHub
parent d2a2a5cfe2
commit e38efc890b
3 changed files with 11 additions and 0 deletions

View File

@@ -428,6 +428,8 @@ class AndroidDevice extends Device {
cmd.addAll(<String>['--ez', 'skia-deterministic-rendering', 'true']);
if (debuggingOptions.traceSkia)
cmd.addAll(<String>['--ez', 'trace-skia', 'true']);
if (debuggingOptions.traceSystrace)
cmd.addAll(<String>['--ez', 'trace-systrace', 'true']);
if (debuggingOptions.debuggingEnabled) {
if (debuggingOptions.buildInfo.isDebug)
cmd.addAll(<String>['--ez', 'enable-checked-mode', 'true']);

View File

@@ -90,6 +90,11 @@ class RunCommand extends RunCommandBase {
help: 'Enable tracing of Skia code. This is useful when debugging '
'the GPU thread. By default, Flutter will not log skia code.',
)
..addFlag('trace-systrace',
negatable: false,
help: 'Enable tracing to the system tracer. This is only useful on '
'platforms where such a tracer is available (Android and Fuchsia).',
)
..addFlag('await-first-frame-when-tracing',
defaultsTo: true,
help: 'Whether to wait for the first frame when tracing startup ("--trace-startup"), '
@@ -249,6 +254,7 @@ class RunCommand extends RunCommandBase {
enableSoftwareRendering: argResults['enable-software-rendering'],
skiaDeterministicRendering: argResults['skia-deterministic-rendering'],
traceSkia: argResults['trace-skia'],
traceSystrace: argResults['trace-systrace'],
observatoryPort: observatoryPort,
);
}

View File

@@ -356,6 +356,7 @@ class DebuggingOptions {
this.enableSoftwareRendering = false,
this.skiaDeterministicRendering = false,
this.traceSkia = false,
this.traceSystrace = false,
this.useTestFonts = false,
this.observatoryPort,
}) : debuggingEnabled = true;
@@ -367,6 +368,7 @@ class DebuggingOptions {
enableSoftwareRendering = false,
skiaDeterministicRendering = false,
traceSkia = false,
traceSystrace = false,
observatoryPort = null;
final bool debuggingEnabled;
@@ -376,6 +378,7 @@ class DebuggingOptions {
final bool enableSoftwareRendering;
final bool skiaDeterministicRendering;
final bool traceSkia;
final bool traceSystrace;
final bool useTestFonts;
final int observatoryPort;