correct handshake to end profiling, related to #55675

This commit is contained in:
Johannes Rieken
2018-09-03 14:07:43 +02:00
parent 01ce593e96
commit 1420060f82
2 changed files with 27 additions and 14 deletions
+4 -1
View File
@@ -280,7 +280,7 @@ export async function main(argv: string[]): Promise<any> {
// wait for the renderer to delete the
// marker file
whenDeleted(filenamePrefix);
await whenDeleted(filenamePrefix);
let profileMain = await main.stop();
let profileRenderer = await renderer.stop();
@@ -303,6 +303,9 @@ export async function main(argv: string[]): Promise<any> {
await profiler.writeProfile(profileRenderer, `${filenamePrefix}-renderer.cpuprofile${suffix}`);
await profiler.writeProfile(profileExtHost, `${filenamePrefix}-exthost.cpuprofile${suffix}`);
// re-create the marker file to signal that profiling is done
fs.writeFileSync(filenamePrefix, '');
} catch (e) {
console.error('Failed to profile startup. Make sure to quit Code first.');
}