Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
406c4dbf
Unverified
Commit
406c4dbf
authored
Oct 12, 2023
by
Derek Xu
Committed by
GitHub
Oct 12, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add `--trace-to-file` option to `flutter run` (#135713)
parent
9751fe64
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
51 additions
and
13 deletions
+51
-13
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+3
-0
run.dart
packages/flutter_tools/lib/src/commands/run.dart
+7
-0
custom_device.dart
...s/flutter_tools/lib/src/custom_devices/custom_device.dart
+2
-0
desktop_device.dart
packages/flutter_tools/lib/src/desktop_device.dart
+3
-0
device.dart
packages/flutter_tools/lib/src/device.dart
+7
-0
drive_test.dart
...lutter_tools/test/commands.shard/hermetic/drive_test.dart
+2
-0
run_test.dart
.../flutter_tools/test/commands.shard/hermetic/run_test.dart
+2
-0
android_device_start_test.dart
...test/general.shard/android/android_device_start_test.dart
+2
-0
desktop_device_test.dart
...flutter_tools/test/general.shard/desktop_device_test.dart
+15
-13
device_test.dart
packages/flutter_tools/test/general.shard/device_test.dart
+4
-0
ios_device_start_prebuilt_test.dart
...est/general.shard/ios/ios_device_start_prebuilt_test.dart
+2
-0
simulators_test.dart
...flutter_tools/test/general.shard/ios/simulators_test.dart
+2
-0
No files found.
packages/flutter_tools/lib/src/android/android_device.dart
View file @
406c4dbf
...
...
@@ -625,6 +625,7 @@ class AndroidDevice extends Device {
final
String
dartVmFlags
=
computeDartVmFlags
(
debuggingOptions
);
final
String
?
traceAllowlist
=
debuggingOptions
.
traceAllowlist
;
final
String
?
traceSkiaAllowlist
=
debuggingOptions
.
traceSkiaAllowlist
;
final
String
?
traceToFile
=
debuggingOptions
.
traceToFile
;
final
List
<
String
>
cmd
=
<
String
>[
'shell'
,
'am'
,
'start'
,
'-a'
,
'android.intent.action.MAIN'
,
...
...
@@ -648,6 +649,8 @@ class AndroidDevice extends Device {
...<
String
>[
'--es'
,
'trace-skia-allowlist'
,
traceSkiaAllowlist
],
if
(
debuggingOptions
.
traceSystrace
)
...<
String
>[
'--ez'
,
'trace-systrace'
,
'true'
],
if
(
traceToFile
!=
null
)
...<
String
>[
'--es'
,
'trace-to-file'
,
traceToFile
],
if
(
debuggingOptions
.
endlessTraceBuffer
)
...<
String
>[
'--ez'
,
'endless-trace-buffer'
,
'true'
],
if
(
debuggingOptions
.
dumpSkpOnShaderCompilation
)
...
...
packages/flutter_tools/lib/src/commands/run.dart
View file @
406c4dbf
...
...
@@ -119,6 +119,12 @@ abstract class RunCommandBase extends FlutterCommand with DeviceBasedDevelopment
'platforms where such a tracer is available (Android, iOS, '
'macOS and Fuchsia).'
,
)
..
addOption
(
'trace-to-file'
,
help:
'Write the timeline trace to a file at the specified path. The '
"file will be in Perfetto's proto format; it will be possible to "
"load the file into Perfetto's trace viewer."
,
valueHelp:
'path/to/trace.binpb'
,
)
..
addFlag
(
'trace-skia'
,
negatable:
false
,
help:
'Enable tracing of Skia code. This is useful when debugging '
...
...
@@ -270,6 +276,7 @@ abstract class RunCommandBase extends FlutterCommand with DeviceBasedDevelopment
traceAllowlist:
traceAllowlist
,
traceSkiaAllowlist:
stringArg
(
'trace-skia-allowlist'
),
traceSystrace:
boolArg
(
'trace-systrace'
),
traceToFile:
stringArg
(
'trace-to-file'
),
endlessTraceBuffer:
boolArg
(
'endless-trace-buffer'
),
dumpSkpOnShaderCompilation:
dumpSkpOnShaderCompilation
,
cacheSkSL:
cacheSkSL
,
...
...
packages/flutter_tools/lib/src/custom_devices/custom_device.dart
View file @
406c4dbf
...
...
@@ -300,6 +300,8 @@ class CustomDeviceAppSession {
'trace-allowlist=
${debuggingOptions.traceAllowlist}
'
,
if
(
debuggingOptions
.
traceSystrace
)
'trace-systrace=true'
,
if
(
debuggingOptions
.
traceToFile
!=
null
)
'trace-to-file=
${debuggingOptions.traceToFile}
'
,
if
(
debuggingOptions
.
endlessTraceBuffer
)
'endless-trace-buffer=true'
,
if
(
debuggingOptions
.
dumpSkpOnShaderCompilation
)
...
...
packages/flutter_tools/lib/src/desktop_device.dart
View file @
406c4dbf
...
...
@@ -254,6 +254,9 @@ abstract class DesktopDevice extends Device {
if
(
debuggingOptions
.
traceSystrace
)
{
addFlag
(
'trace-systrace=true'
);
}
if
(
debuggingOptions
.
traceToFile
!=
null
)
{
addFlag
(
'trace-to-file=
${debuggingOptions.traceToFile}
'
);
}
if
(
debuggingOptions
.
endlessTraceBuffer
)
{
addFlag
(
'endless-trace-buffer=true'
);
}
...
...
packages/flutter_tools/lib/src/device.dart
View file @
406c4dbf
...
...
@@ -937,6 +937,7 @@ class DebuggingOptions {
this
.
traceAllowlist
,
this
.
traceSkiaAllowlist
,
this
.
traceSystrace
=
false
,
this
.
traceToFile
,
this
.
endlessTraceBuffer
=
false
,
this
.
dumpSkpOnShaderCompilation
=
false
,
this
.
cacheSkSL
=
false
,
...
...
@@ -1006,6 +1007,7 @@ class DebuggingOptions {
traceSkia
=
false
,
traceSkiaAllowlist
=
null
,
traceSystrace
=
false
,
traceToFile
=
null
,
endlessTraceBuffer
=
false
,
dumpSkpOnShaderCompilation
=
false
,
purgePersistentCache
=
false
,
...
...
@@ -1037,6 +1039,7 @@ class DebuggingOptions {
required
this
.
traceAllowlist
,
required
this
.
traceSkiaAllowlist
,
required
this
.
traceSystrace
,
required
this
.
traceToFile
,
required
this
.
endlessTraceBuffer
,
required
this
.
dumpSkpOnShaderCompilation
,
required
this
.
cacheSkSL
,
...
...
@@ -1088,6 +1091,7 @@ class DebuggingOptions {
final
String
?
traceAllowlist
;
final
String
?
traceSkiaAllowlist
;
final
bool
traceSystrace
;
final
String
?
traceToFile
;
final
bool
endlessTraceBuffer
;
final
bool
dumpSkpOnShaderCompilation
;
final
bool
cacheSkSL
;
...
...
@@ -1178,6 +1182,7 @@ class DebuggingOptions {
],
if
(
enableSoftwareRendering
)
'--enable-software-rendering'
,
if
(
traceSystrace
)
'--trace-systrace'
,
if
(
traceToFile
!=
null
)
'--trace-to-file="
$traceToFile
"'
,
if
(
skiaDeterministicRendering
)
'--skia-deterministic-rendering'
,
if
(
traceSkia
)
'--trace-skia'
,
if
(
traceAllowlist
!=
null
)
'--trace-allowlist="
$traceAllowlist
"'
,
...
...
@@ -1218,6 +1223,7 @@ class DebuggingOptions {
'traceAllowlist'
:
traceAllowlist
,
'traceSkiaAllowlist'
:
traceSkiaAllowlist
,
'traceSystrace'
:
traceSystrace
,
'traceToFile'
:
traceToFile
,
'endlessTraceBuffer'
:
endlessTraceBuffer
,
'dumpSkpOnShaderCompilation'
:
dumpSkpOnShaderCompilation
,
'cacheSkSL'
:
cacheSkSL
,
...
...
@@ -1269,6 +1275,7 @@ class DebuggingOptions {
traceAllowlist:
json
[
'traceAllowlist'
]
as
String
?,
traceSkiaAllowlist:
json
[
'traceSkiaAllowlist'
]
as
String
?,
traceSystrace:
json
[
'traceSystrace'
]!
as
bool
,
traceToFile:
json
[
'traceToFile'
]
as
String
?,
endlessTraceBuffer:
json
[
'endlessTraceBuffer'
]!
as
bool
,
dumpSkpOnShaderCompilation:
json
[
'dumpSkpOnShaderCompilation'
]!
as
bool
,
cacheSkSL:
json
[
'cacheSkSL'
]!
as
bool
,
...
...
packages/flutter_tools/test/commands.shard/hermetic/drive_test.dart
View file @
406c4dbf
...
...
@@ -417,6 +417,7 @@ void main() {
'--disable-service-auth-codes'
,
'--trace-skia'
,
'--trace-systrace'
,
'--trace-to-file=path/to/trace.binpb'
,
'--verbose-system-logs'
,
'--null-assertions'
,
'--native-null-assertions'
,
...
...
@@ -434,6 +435,7 @@ void main() {
expect
(
options
.
disableServiceAuthCodes
,
true
);
expect
(
options
.
traceSkia
,
true
);
expect
(
options
.
traceSystrace
,
true
);
expect
(
options
.
traceToFile
,
'path/to/trace.binpb'
);
expect
(
options
.
verboseSystemLogs
,
true
);
expect
(
options
.
nullAssertions
,
true
);
expect
(
options
.
nativeNullAssertions
,
true
);
...
...
packages/flutter_tools/test/commands.shard/hermetic/run_test.dart
View file @
406c4dbf
...
...
@@ -1086,6 +1086,7 @@ void main() {
'--use-test-fonts'
,
'--trace-skia'
,
'--trace-systrace'
,
'--trace-to-file=path/to/trace.binpb'
,
'--verbose-system-logs'
,
'--null-assertions'
,
'--native-null-assertions'
,
...
...
@@ -1106,6 +1107,7 @@ void main() {
expect
(
options
.
useTestFonts
,
true
);
expect
(
options
.
traceSkia
,
true
);
expect
(
options
.
traceSystrace
,
true
);
expect
(
options
.
traceToFile
,
'path/to/trace.binpb'
);
expect
(
options
.
verboseSystemLogs
,
true
);
expect
(
options
.
nullAssertions
,
true
);
expect
(
options
.
nativeNullAssertions
,
true
);
...
...
packages/flutter_tools/test/general.shard/android/android_device_start_test.dart
View file @
406c4dbf
...
...
@@ -240,6 +240,7 @@ void main() {
'--es'
,
'trace-allowlist'
,
'bar,baz'
,
'--es'
,
'trace-skia-allowlist'
,
'skia.a,skia.b'
,
'--ez'
,
'trace-systrace'
,
'true'
,
'--es'
,
'trace-to-file'
,
'path/to/trace.binpb'
,
'--ez'
,
'endless-trace-buffer'
,
'true'
,
'--ez'
,
'dump-skp-on-shader-compilation'
,
'true'
,
'--ez'
,
'cache-sksl'
,
'true'
,
...
...
@@ -271,6 +272,7 @@ void main() {
traceAllowlist:
'bar,baz'
,
traceSkiaAllowlist:
'skia.a,skia.b'
,
traceSystrace:
true
,
traceToFile:
'path/to/trace.binpb'
,
endlessTraceBuffer:
true
,
dumpSkpOnShaderCompilation:
true
,
cacheSkSL:
true
,
...
...
packages/flutter_tools/test/general.shard/desktop_device_test.dart
View file @
406c4dbf
...
...
@@ -151,19 +151,20 @@ void main() {
'FLUTTER_ENGINE_SWITCH_6'
:
'trace-allowlist=foo,bar'
,
'FLUTTER_ENGINE_SWITCH_7'
:
'trace-skia-allowlist=skia.a,skia.b'
,
'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-impeller=false'
,
'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'
,
'FLUTTER_ENGINE_SWITCH_9'
:
'trace-to-file=path/to/trace.binpb'
,
'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-impeller=false'
,
'FLUTTER_ENGINE_SWITCH_15'
:
'enable-checked-mode=true'
,
'FLUTTER_ENGINE_SWITCH_16'
:
'verify-entry-points=true'
,
'FLUTTER_ENGINE_SWITCH_17'
:
'start-paused=true'
,
'FLUTTER_ENGINE_SWITCH_18'
:
'disable-service-auth-codes=true'
,
'FLUTTER_ENGINE_SWITCH_19'
:
'dart-flags=--null_assertions'
,
'FLUTTER_ENGINE_SWITCH_20'
:
'use-test-fonts=true'
,
'FLUTTER_ENGINE_SWITCH_21'
:
'verbose-logging=true'
,
'FLUTTER_ENGINE_SWITCHES'
:
'21'
,
}
),
]);
...
...
@@ -185,6 +186,7 @@ void main() {
traceAllowlist:
'foo,bar'
,
traceSkiaAllowlist:
'skia.a,skia.b'
,
traceSystrace:
true
,
traceToFile:
'path/to/trace.binpb'
,
endlessTraceBuffer:
true
,
dumpSkpOnShaderCompilation:
true
,
cacheSkSL:
true
,
...
...
packages/flutter_tools/test/general.shard/device_test.dart
View file @
406c4dbf
...
...
@@ -814,6 +814,7 @@ void main() {
traceAllowlist:
'foo'
,
traceSkiaAllowlist:
'skia.a,skia.b'
,
traceSystrace:
true
,
traceToFile:
'path/to/trace.binpb'
,
endlessTraceBuffer:
true
,
dumpSkpOnShaderCompilation:
true
,
cacheSkSL:
true
,
...
...
@@ -846,6 +847,7 @@ void main() {
'--verify-entry-points'
,
'--enable-software-rendering'
,
'--trace-systrace'
,
'--trace-to-file="path/to/trace.binpb"'
,
'--skia-deterministic-rendering'
,
'--trace-skia'
,
'--trace-allowlist="foo"'
,
...
...
@@ -994,6 +996,7 @@ void main() {
traceAllowlist:
'foo'
,
traceSkiaAllowlist:
'skia.a,skia.b'
,
traceSystrace:
true
,
traceToFile:
'path/to/trace.binpb'
,
endlessTraceBuffer:
true
,
dumpSkpOnShaderCompilation:
true
,
cacheSkSL:
true
,
...
...
@@ -1026,6 +1029,7 @@ void main() {
'--verify-entry-points'
,
'--enable-software-rendering'
,
'--trace-systrace'
,
'--trace-to-file="path/to/trace.binpb"'
,
'--skia-deterministic-rendering'
,
'--trace-skia'
,
'--trace-allowlist="foo"'
,
...
...
packages/flutter_tools/test/general.shard/ios/ios_device_start_prebuilt_test.dart
View file @
406c4dbf
...
...
@@ -485,6 +485,7 @@ void main() {
'--verify-entry-points'
,
'--enable-software-rendering'
,
'--trace-systrace'
,
'--trace-to-file="path/to/trace.binpb"'
,
'--skia-deterministic-rendering'
,
'--trace-skia'
,
'--trace-allowlist="foo"'
,
...
...
@@ -541,6 +542,7 @@ void main() {
traceAllowlist:
'foo'
,
traceSkiaAllowlist:
'skia.a,skia.b'
,
traceSystrace:
true
,
traceToFile:
'path/to/trace.binpb'
,
endlessTraceBuffer:
true
,
dumpSkpOnShaderCompilation:
true
,
cacheSkSL:
true
,
...
...
packages/flutter_tools/test/general.shard/ios/simulators_test.dart
View file @
406c4dbf
...
...
@@ -1184,6 +1184,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
mockInfo
,
enableSoftwareRendering:
true
,
traceSystrace:
true
,
traceToFile:
'path/to/trace.binpb'
,
startPaused:
true
,
disableServiceAuthCodes:
true
,
skiaDeterministicRendering:
true
,
...
...
@@ -1209,6 +1210,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
'--verify-entry-points'
,
'--enable-software-rendering'
,
'--trace-systrace'
,
'--trace-to-file="path/to/trace.binpb"'
,
'--start-paused'
,
'--disable-service-auth-codes'
,
'--skia-deterministic-rendering'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment