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 {
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']);
......
......@@ -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,
);
}
......
......@@ -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;
......
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