Unverified Commit 59f6cc7a authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Add a trace-skia-allowlist flag for filtering Skia trace events (#83507)

parent 6ba37a3d
......@@ -632,7 +632,9 @@ class AndroidDevice extends Device {
if (debuggingOptions.traceSkia)
...<String>['--ez', 'trace-skia', 'true'],
if (debuggingOptions.traceAllowlist != null)
...<String>['--ez', 'trace-allowlist', debuggingOptions.traceAllowlist],
...<String>['--es', 'trace-allowlist', debuggingOptions.traceAllowlist],
if (debuggingOptions.traceSkiaAllowlist != null)
...<String>['--es', 'trace-skia-allowlist', debuggingOptions.traceSkiaAllowlist],
if (debuggingOptions.traceSystrace)
...<String>['--ez', 'trace-systrace', 'true'],
if (debuggingOptions.endlessTraceBuffer)
......
......@@ -127,6 +127,12 @@ abstract class RunCommandBase extends FlutterCommand with DeviceBasedDevelopment
'this comma separated list of allowed prefixes.',
valueHelp: 'foo,bar',
)
..addOption('trace-skia-allowlist',
hide: !verboseHelp,
help: 'Filters out all Skia trace events except those that are specified in '
'this comma separated list of allowed prefixes.',
valueHelp: 'skia.gpu,skia.shaders',
)
..addMultiOption('dart-entrypoint-args',
abbr: 'a',
help: 'Pass a list of arguments to the Dart entrypoint at application '
......@@ -199,6 +205,7 @@ abstract class RunCommandBase extends FlutterCommand with DeviceBasedDevelopment
skiaDeterministicRendering: argParser.options.containsKey('skia-deterministic-rendering') && boolArg('skia-deterministic-rendering'),
traceSkia: boolArg('trace-skia'),
traceAllowlist: traceAllowlist,
traceSkiaAllowlist: stringArg('trace-skia-allowlist'),
traceSystrace: boolArg('trace-systrace'),
endlessTraceBuffer: boolArg('endless-trace-buffer'),
dumpSkpOnShaderCompilation: dumpSkpOnShaderCompilation,
......
......@@ -251,6 +251,9 @@ abstract class DesktopDevice extends Device {
if (debuggingOptions.traceAllowlist != null) {
addFlag('trace-allowlist=${debuggingOptions.traceAllowlist}');
}
if (debuggingOptions.traceSkiaAllowlist != null) {
addFlag('trace-skia-allowlist=${debuggingOptions.traceSkiaAllowlist}');
}
if (debuggingOptions.traceSystrace) {
addFlag('trace-systrace=true');
}
......
......@@ -724,6 +724,7 @@ class DebuggingOptions {
this.skiaDeterministicRendering = false,
this.traceSkia = false,
this.traceAllowlist,
this.traceSkiaAllowlist,
this.traceSystrace = false,
this.endlessTraceBuffer = false,
this.dumpSkpOnShaderCompilation = false,
......@@ -772,6 +773,7 @@ class DebuggingOptions {
enableSoftwareRendering = false,
skiaDeterministicRendering = false,
traceSkia = false,
traceSkiaAllowlist = null,
traceSystrace = false,
endlessTraceBuffer = false,
dumpSkpOnShaderCompilation = false,
......@@ -800,6 +802,7 @@ class DebuggingOptions {
final bool skiaDeterministicRendering;
final bool traceSkia;
final String traceAllowlist;
final String traceSkiaAllowlist;
final bool traceSystrace;
final bool endlessTraceBuffer;
final bool dumpSkpOnShaderCompilation;
......
......@@ -363,6 +363,7 @@ class IOSDevice extends Device {
if (debuggingOptions.skiaDeterministicRendering) '--skia-deterministic-rendering',
if (debuggingOptions.traceSkia) '--trace-skia',
if (debuggingOptions.traceAllowlist != null) '--trace-allowlist="${debuggingOptions.traceAllowlist}"',
if (debuggingOptions.traceSkiaAllowlist != null) '--trace-skia-allowlist="${debuggingOptions.traceSkiaAllowlist}"',
if (debuggingOptions.endlessTraceBuffer) '--endless-trace-buffer',
if (debuggingOptions.dumpSkpOnShaderCompilation) '--dump-skp-on-shader-compilation',
if (debuggingOptions.verboseSystemLogs) '--verbose-logging',
......
......@@ -460,6 +460,7 @@ class IOSSimulator extends Device {
if (debuggingOptions.skiaDeterministicRendering) '--skia-deterministic-rendering',
if (debuggingOptions.useTestFonts) '--use-test-fonts',
if (debuggingOptions.traceAllowlist != null) '--trace-allowlist="${debuggingOptions.traceAllowlist}"',
if (debuggingOptions.traceSkiaAllowlist != null) '--trace-skia-allowlist="${debuggingOptions.traceSkiaAllowlist}"',
if (dartVmFlags.isNotEmpty) '--dart-flags=$dartVmFlags',
'--observatory-port=${debuggingOptions.hostVmServicePort ?? 0}'
],
......
......@@ -355,6 +355,7 @@ class WindowsUWPDevice extends Device {
if (debuggingOptions.skiaDeterministicRendering) '--skia-deterministic-rendering',
if (debuggingOptions.traceSkia) '--trace-skia',
if (debuggingOptions.traceAllowlist != null) '--trace-allowlist="${debuggingOptions.traceAllowlist}"',
if (debuggingOptions.traceSkiaAllowlist != null) '--trace-skia-allowlist="${debuggingOptions.traceSkiaAllowlist}"',
if (debuggingOptions.endlessTraceBuffer) '--endless-trace-buffer',
if (debuggingOptions.dumpSkpOnShaderCompilation) '--dump-skp-on-shader-compilation',
if (debuggingOptions.verboseSystemLogs) '--verbose-logging',
......
......@@ -240,7 +240,8 @@ void main() {
'--ez', 'enable-software-rendering', 'true',
'--ez', 'skia-deterministic-rendering', 'true',
'--ez', 'trace-skia', 'true',
'--ez', 'trace-allowlist', 'bar,baz',
'--es', 'trace-allowlist', 'bar,baz',
'--es', 'trace-skia-allowlist', 'skia.a,skia.b',
'--ez', 'trace-systrace', 'true',
'--ez', 'endless-trace-buffer', 'true',
'--ez', 'dump-skp-on-shader-compilation', 'true',
......@@ -270,6 +271,7 @@ void main() {
skiaDeterministicRendering: true,
traceSkia: true,
traceAllowlist: 'bar,baz',
traceSkiaAllowlist: 'skia.a,skia.b',
traceSystrace: true,
endlessTraceBuffer: true,
dumpSkpOnShaderCompilation: true,
......
......@@ -153,19 +153,20 @@ void main() {
'FLUTTER_ENGINE_SWITCH_5': 'skia-deterministic-rendering=true',
'FLUTTER_ENGINE_SWITCH_6': 'trace-skia=true',
'FLUTTER_ENGINE_SWITCH_7': 'trace-allowlist=foo,bar',
'FLUTTER_ENGINE_SWITCH_8': 'trace-systrace=true',
'FLUTTER_ENGINE_SWITCH_9': 'endless-trace-buffer=true',
'FLUTTER_ENGINE_SWITCH_10': 'dump-skp-on-shader-compilation=true',
'FLUTTER_ENGINE_SWITCH_11': 'cache-sksl=true',
'FLUTTER_ENGINE_SWITCH_12': 'purge-persistent-cache=true',
'FLUTTER_ENGINE_SWITCH_13': 'enable-checked-mode=true',
'FLUTTER_ENGINE_SWITCH_14': 'verify-entry-points=true',
'FLUTTER_ENGINE_SWITCH_15': 'start-paused=true',
'FLUTTER_ENGINE_SWITCH_16': 'disable-service-auth-codes=true',
'FLUTTER_ENGINE_SWITCH_17': 'dart-flags=--null_assertions',
'FLUTTER_ENGINE_SWITCH_18': 'use-test-fonts=true',
'FLUTTER_ENGINE_SWITCH_19': 'verbose-logging=true',
'FLUTTER_ENGINE_SWITCHES': '19'
'FLUTTER_ENGINE_SWITCH_8': 'trace-skia-allowlist=skia.a,skia.b',
'FLUTTER_ENGINE_SWITCH_9': 'trace-systrace=true',
'FLUTTER_ENGINE_SWITCH_10': 'endless-trace-buffer=true',
'FLUTTER_ENGINE_SWITCH_11': 'dump-skp-on-shader-compilation=true',
'FLUTTER_ENGINE_SWITCH_12': 'cache-sksl=true',
'FLUTTER_ENGINE_SWITCH_13': 'purge-persistent-cache=true',
'FLUTTER_ENGINE_SWITCH_14': 'enable-checked-mode=true',
'FLUTTER_ENGINE_SWITCH_15': 'verify-entry-points=true',
'FLUTTER_ENGINE_SWITCH_16': 'start-paused=true',
'FLUTTER_ENGINE_SWITCH_17': 'disable-service-auth-codes=true',
'FLUTTER_ENGINE_SWITCH_18': 'dart-flags=--null_assertions',
'FLUTTER_ENGINE_SWITCH_19': 'use-test-fonts=true',
'FLUTTER_ENGINE_SWITCH_20': 'verbose-logging=true',
'FLUTTER_ENGINE_SWITCHES': '20'
}
),
]);
......@@ -186,6 +187,7 @@ void main() {
skiaDeterministicRendering: true,
traceSkia: true,
traceAllowlist: 'foo,bar',
traceSkiaAllowlist: 'skia.a,skia.b',
traceSystrace: true,
endlessTraceBuffer: true,
dumpSkpOnShaderCompilation: true,
......
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