File tree 2 files changed +25
-0
lines changed
2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -2029,6 +2029,9 @@ static void WaitForInspectorDisconnect(Environment* env) {
2029
2029
2030
2030
static void Exit (const FunctionCallbackInfo<Value>& args) {
2031
2031
WaitForInspectorDisconnect (Environment::GetCurrent (args));
2032
+ if (trace_enabled) {
2033
+ v8_platform.StopTracingAgent ();
2034
+ }
2032
2035
exit (args[0 ]->Int32Value ());
2033
2036
}
2034
2037
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