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 @@ -2464,6 +2464,9 @@ static void WaitForInspectorDisconnect(Environment* env) {
2464
2464
2465
2465
static void Exit (const FunctionCallbackInfo<Value>& args) {
2466
2466
WaitForInspectorDisconnect (Environment::GetCurrent (args));
2467
+ if (trace_enabled) {
2468
+ v8_platform.StopTracingAgent ();
2469
+ }
2467
2470
exit (args[0 ]->Int32Value ());
2468
2471
}
2469
2472
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