Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiroslav Bajtoš <mbajtoss@gmail.com>2017-07-17 17:51:26 +0300
committerMyles Borins <mylesborins@google.com>2017-09-12 04:18:31 +0300
commit8c61b72f90a71d5c9f05b0bcf4f84fad31b212f7 (patch)
tree2a9aae72914aa90ec4c4889856a71a1f303770b6 /node.gyp
parent77bc72ad542afd2cf3a005586c3d6a39fdc3f8e6 (diff)
inspector: enable async stack traces
Implement a special async_hooks listener that forwards information about async tasks to V8Inspector asyncTask* API, thus enabling DevTools feature "async stack traces". The feature is enabled only on 64bit platforms due to a technical limitation of V8 Inspector: inspector uses a pointer as a task id, while async_hooks use 64bit numbers as ids. To avoid performance penalty of async_hooks when not debugging, the new listener is enabled only when the process enters a debug mode: - When the process is started with `--inspect` or `--inspect-brk`, the listener is enabled immediately and async stack traces lead all the way to the first tick of the event loop. - When the debug mode is enabled via SIGUSR1 or `_debugProcess()`, the listener is enabled together with the debugger. As a result, only async operations started after the signal was received will be correctly observed and reported to V8 Inspector. For example, a `setInterval()` called in the first tick of the event will not be shown in the async stack trace when the callback is invoked. This behaviour is consistent with Chrome DevTools. Last but not least, this commit fixes handling of InspectorAgent's internal property `enabled_` to ensure it's set back to `false` after the debugger is deactivated (typically via `process._debugEnd()`). Fixes: https://github.com/nodejs/node/issues/11370 PR-URL: https://github.com/nodejs/node/pull/13870 Reviewed-by: Timothy Gu <timothygu99@gmail.com> Reviewed-by: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'node.gyp')
-rw-r--r--node.gyp1
1 files changed, 1 insertions, 0 deletions
diff --git a/node.gyp b/node.gyp
index 5bec65caddc..6ff0cb02cca 100644
--- a/node.gyp
+++ b/node.gyp
@@ -88,6 +88,7 @@
'lib/internal/freelist.js',
'lib/internal/fs.js',
'lib/internal/http.js',
+ 'lib/internal/inspector_async_hook.js',
'lib/internal/linkedlist.js',
'lib/internal/net.js',
'lib/internal/module.js',