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
a0aa0edf
Commit
a0aa0edf
authored
Aug 09, 2016
by
Yegor
Committed by
GitHub
Aug 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--trace-startup: non-zero exit code when fails; enable in iOS runtime (#5309)
parent
a8198122
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
7 deletions
+17
-7
run.dart
packages/flutter_tools/lib/src/commands/run.dart
+1
-1
trace.dart
packages/flutter_tools/lib/src/commands/trace.dart
+7
-5
devices.dart
packages/flutter_tools/lib/src/ios/devices.dart
+3
-0
run.dart
packages/flutter_tools/lib/src/run.dart
+6
-1
No files found.
packages/flutter_tools/lib/src/commands/run.dart
View file @
a0aa0edf
...
...
@@ -275,7 +275,7 @@ Future<int> startApp(
Observatory
observatory
=
await
Observatory
.
connect
(
result
.
observatoryPort
);
await
downloadStartupTrace
(
observatory
);
}
catch
(
error
)
{
printError
(
'Error
connecting to
observatory:
$error
'
);
printError
(
'Error
downloading trace from
observatory:
$error
'
);
return
1
;
}
}
...
...
packages/flutter_tools/lib/src/commands/trace.dart
View file @
a0aa0edf
...
...
@@ -154,6 +154,11 @@ class Tracing {
/// Download the startup trace information from the given observatory client and
/// store it to build/start_up_info.json.
Future
<
Null
>
downloadStartupTrace
(
Observatory
observatory
)
async
{
File
traceInfoFile
=
new
File
(
'build/start_up_info.json'
);
if
(
await
traceInfoFile
.
exists
())
await
traceInfoFile
.
delete
();
Tracing
tracing
=
new
Tracing
(
observatory
);
Map
<
String
,
dynamic
>
timeline
=
await
tracing
.
stopTracingAndDownloadTimeline
(
...
...
@@ -173,16 +178,13 @@ Future<Null> downloadStartupTrace(Observatory observatory) async {
int
firstFrameTimestampMicros
=
extractInstantEventTimestamp
(
kFirstUsefulFrameEventName
);
if
(
engineEnterTimestampMicros
==
null
)
{
printError
(
'Engine start event is missing in the timeline. Cannot compute startup time.'
);
return
null
;
throw
'Engine start event is missing in the timeline. Cannot compute startup time.'
;
}
if
(
firstFrameTimestampMicros
==
null
)
{
printError
(
'First frame event is missing in the timeline. Cannot compute startup time.'
);
return
null
;
throw
'First frame event is missing in the timeline. Cannot compute startup time.'
;
}
File
traceInfoFile
=
new
File
(
'build/start_up_info.json'
);
int
timeToFirstFrameMicros
=
firstFrameTimestampMicros
-
engineEnterTimestampMicros
;
Map
<
String
,
dynamic
>
traceInfo
=
<
String
,
dynamic
>{
'engineEnterTimestampMicros'
:
engineEnterTimestampMicros
,
...
...
packages/flutter_tools/lib/src/ios/devices.dart
View file @
a0aa0edf
...
...
@@ -216,6 +216,9 @@ class IOSDevice extends Device {
// the port picked and scrape that later.
}
if
(
platformArgs
[
'trace-startup'
]
??
false
)
launchArguments
.
add
(
'--trace-startup'
);
List
<
String
>
launchCommand
=
<
String
>[
'/usr/bin/env'
,
'ios-deploy'
,
...
...
packages/flutter_tools/lib/src/run.dart
View file @
a0aa0edf
...
...
@@ -188,7 +188,12 @@ class RunAndStayResident extends ResidentRunner {
if
(
serviceProtocol
!=
null
&&
traceStartup
)
{
printStatus
(
'Downloading startup trace info...'
);
await
downloadStartupTrace
(
serviceProtocol
);
try
{
await
downloadStartupTrace
(
serviceProtocol
);
}
catch
(
error
)
{
printError
(
error
);
return
2
;
}
appFinished
();
}
else
{
setupTerminal
();
...
...
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