File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -2358,6 +2358,9 @@ static void WaitForInspectorDisconnect(Environment* env) {
23582358
23592359static void Exit (const FunctionCallbackInfo<Value>& args) {
23602360 WaitForInspectorDisconnect (Environment::GetCurrent (args));
2361+ if (trace_enabled) {
2362+ v8_platform.StopTracingAgent ();
2363+ }
23612364 exit (args[0 ]->Int32Value ());
23622365}
23632366
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+ const common = require ( '../common' ) ;
3+ const assert = require ( 'assert' ) ;
4+ const cp = require ( 'child_process' ) ;
5+ const fs = require ( 'fs' ) ;
6+
7+ const FILE_NAME = 'node_trace.1.log' ;
8+
9+ common . refreshTmpDir ( ) ;
10+ process . chdir ( common . tmpDir ) ;
11+
12+ const proc = cp . spawn ( process . execPath ,
13+ [ '--trace-events-enabled' ,
14+ '-e' , 'process.exit()' ] ) ;
15+
16+ proc . once ( 'exit' , common . mustCall ( ( ) => {
17+ assert ( common . fileExists ( FILE_NAME ) ) ;
18+ fs . readFile ( FILE_NAME , common . mustCall ( ( err , data ) => {
19+ const traces = JSON . parse ( data . toString ( ) ) . traceEvents ;
20+ assert ( traces . length > 0 ) ;
21+ } ) ) ;
22+ } ) ) ;
You can’t perform that action at this time.
0 commit comments