Unverified Commit e38efc89 authored by Chinmay Garde's avatar Chinmay Garde Committed by GitHub

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

parent d2a2a5cf
...@@ -428,6 +428,8 @@ class AndroidDevice extends Device { ...@@ -428,6 +428,8 @@ class AndroidDevice extends Device {
cmd.addAll(<String>['--ez', 'skia-deterministic-rendering', 'true']); cmd.addAll(<String>['--ez', 'skia-deterministic-rendering', 'true']);
if (debuggingOptions.traceSkia) if (debuggingOptions.traceSkia)
cmd.addAll(<String>['--ez', 'trace-skia', 'true']); cmd.addAll(<String>['--ez', 'trace-skia', 'true']);
if (debuggingOptions.traceSystrace)
cmd.addAll(<String>['--ez', 'trace-systrace', 'true']);
if (debuggingOptions.debuggingEnabled) { if (debuggingOptions.debuggingEnabled) {
if (debuggingOptions.buildInfo.isDebug) if (debuggingOptions.buildInfo.isDebug)
cmd.addAll(<String>['--ez', 'enable-checked-mode', 'true']); cmd.addAll(<String>['--ez', 'enable-checked-mode', 'true']);
......
...@@ -90,6 +90,11 @@ class RunCommand extends RunCommandBase { ...@@ -90,6 +90,11 @@ class RunCommand extends RunCommandBase {
help: 'Enable tracing of Skia code. This is useful when debugging ' help: 'Enable tracing of Skia code. This is useful when debugging '
'the GPU thread. By default, Flutter will not log skia code.', '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', ..addFlag('await-first-frame-when-tracing',
defaultsTo: true, defaultsTo: true,
help: 'Whether to wait for the first frame when tracing startup ("--trace-startup"), ' help: 'Whether to wait for the first frame when tracing startup ("--trace-startup"), '
...@@ -249,6 +254,7 @@ class RunCommand extends RunCommandBase { ...@@ -249,6 +254,7 @@ class RunCommand extends RunCommandBase {
enableSoftwareRendering: argResults['enable-software-rendering'], enableSoftwareRendering: argResults['enable-software-rendering'],
skiaDeterministicRendering: argResults['skia-deterministic-rendering'], skiaDeterministicRendering: argResults['skia-deterministic-rendering'],
traceSkia: argResults['trace-skia'], traceSkia: argResults['trace-skia'],
traceSystrace: argResults['trace-systrace'],
observatoryPort: observatoryPort, observatoryPort: observatoryPort,
); );
} }
......
...@@ -356,6 +356,7 @@ class DebuggingOptions { ...@@ -356,6 +356,7 @@ class DebuggingOptions {
this.enableSoftwareRendering = false, this.enableSoftwareRendering = false,
this.skiaDeterministicRendering = false, this.skiaDeterministicRendering = false,
this.traceSkia = false, this.traceSkia = false,
this.traceSystrace = false,
this.useTestFonts = false, this.useTestFonts = false,
this.observatoryPort, this.observatoryPort,
}) : debuggingEnabled = true; }) : debuggingEnabled = true;
...@@ -367,6 +368,7 @@ class DebuggingOptions { ...@@ -367,6 +368,7 @@ class DebuggingOptions {
enableSoftwareRendering = false, enableSoftwareRendering = false,
skiaDeterministicRendering = false, skiaDeterministicRendering = false,
traceSkia = false, traceSkia = false,
traceSystrace = false,
observatoryPort = null; observatoryPort = null;
final bool debuggingEnabled; final bool debuggingEnabled;
...@@ -376,6 +378,7 @@ class DebuggingOptions { ...@@ -376,6 +378,7 @@ class DebuggingOptions {
final bool enableSoftwareRendering; final bool enableSoftwareRendering;
final bool skiaDeterministicRendering; final bool skiaDeterministicRendering;
final bool traceSkia; final bool traceSkia;
final bool traceSystrace;
final bool useTestFonts; final bool useTestFonts;
final int observatoryPort; final int observatoryPort;
......
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