-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
async-hooks: add trace events to AsyncWrap #15538
Conversation
The CI is segfaulting as well. I can try to reproduce it again. |
I suspect this is a breakage inside the trace event macros. It has been a few versions of V8 since they were updated so we will probably have to do something like #12127 again. As soon as this change lands, we'll be able to test for such breakages inside node to ensure the macros are updated when new versions of V8 are picked up. |
Actually it looks like the macros haven't changed much. There were some changes to how the tracing controller is maintained with the new platform implementation. Does this patch help? diff --git a/src/node.cc b/src/node.cc
index d6678dd967..c14d5229dd 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -268,7 +268,7 @@ static struct {
trace_enabled ? tracing_agent_->GetTracingController() : nullptr);
V8::InitializePlatform(platform_);
tracing::TraceEventHelper::SetTracingController(
- trace_enabled ? tracing_agent_->GetTracingController() : nullptr);
+ trace_enabled ? tracing_agent_->GetTracingController() : new v8::TracingController());
}
void Dispose() { |
@matthewloring it appears too. Running a new CI: https://ci.nodejs.org/job/node-test-pull-request/10190/ |
I've added a simple There appears to be a bug with categories. Running the code below with If 'use strict';
const http = require('http');
const fs = require('fs');
const trace_events = process.binding('trace_events');
const sleeptime = parseInt(process.argv[2], 10) || 0;
console.log(`sleeping ${sleeptime} ms at each request`);
console.log(trace_events.categoryGroupEnabled('v8'));
console.log(trace_events.categoryGroupEnabled('custom'));
function sleep (msec) {
var start = Date.now();
while (Date.now() - start < msec) {}
}
const server = http.createServer(function (req, res) {
sleep(sleeptime);
fs.createReadStream(__filename).pipe(res);
});
server.listen(8080, '127.0.0.1', function () {
let left = 100;
for (let i = 0; i < 100; i++) {
trace_events.emit('S'.charCodeAt(0), 'custom', 'request-time', i + 1, 'triggerId', 10)
http.get('http://127.0.0.1:8080', function (res) {
res.resume();
res.on('end', function () {
trace_events.emit('F'.charCodeAt(0), 'custom', 'request-time', i + 1, 'triggerId', 20)
left -= 1;
if (left === 0) server.close();
});
});
}
}); |
This needs a rebase |
src/node_trace_events.cc
Outdated
num_args = 1; | ||
Local<Context> context = env->isolate()->GetCurrentContext(); | ||
printf("name [A]: %s\n", name); // REQUEST | ||
arg_names[0] = Utf8Value(env->isolate(), args[4]).out(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@addaleax could you take a look? I don't understand why fetching the c-string of args[4]
changes the value of name
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AndreasMadsen The memory associated with Utf8Value.out()
is tied to the lifetime of the Utf8Value
itself – you can’t really use GetName
like this, sorry.
(It sounds like what happens here is that when name = GetName()
is called, the name string is converted to utf8, that memory is returned by GetName()
, then freed because the Utf8Value
goes out of scope; when you try to update arg_names[0]
here, the same thing happens, and this just re-uses the memory allocated for name
.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this does make sense to me. However, I'm not sure how to appropriately fix it. Can you help me?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The easiest way would be to just keep the Utf8Value
around while you use the string (basically what you do here – this is also what we do in most of the codebase, so grepping around should show enough examples).
The second-easiest thing would probably be to create std::string
s from those Utf8Values
and use them instead, e.g. GetName()
could return a std::string
and should start working :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I was worried if the if
-block scoping would cause some issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh – right, the block scope is an issue here. I think you can actually move the Utf8Value
declaration to outside of the diff … if that doesn’t work, std::string
is probably the way to go
src/node_trace_events.cc
Outdated
extern tracing::Agent* tracing_agent; | ||
|
||
// The tracing APIs require category groups to be pointers to long-lived | ||
// strings. Those strings are stored here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the V8 source code, this doesn’t seem to be true? (https://github.com/nodejs/node/blob/master/deps/v8/src/libplatform/tracing/tracing-controller.cc#L168 & related places use string comparisons, not pointer comparisons)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm confused too. This is where it is documented: https://github.com/nodejs/node/blob/master/src/tracing/trace_event_common.h#L123
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, okay … /cc @matthewloring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really can’t make out a code path where this is actually needed … but it would be really good to have that verified by somebody who is familiar with the tracing code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. It is very confusing. I think trace_events
runs in a separate thread, can that affect it somehow?
src/async-wrap.cc
Outdated
|
||
if (env->destroy_async_id_list()->empty()) | ||
uv_timer_start(env->destroy_async_ids_timer_handle(), | ||
DestroyAsyncIdsCallback, 0, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to ignore, but common code style is to use braces if the body of an if
statement longer than one line
src/node_trace_events.cc
Outdated
if (args.Length() < 6 || (args[4]->IsUndefined() && args[5]->IsUndefined())) { | ||
num_args = 0; | ||
} | ||
else if (args[4]->IsString() && args[5]->IsNumber()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(feel free to also ignore: common code style is to have }
and else (if)
on the same line
src/node_trace_events.cc
Outdated
} | ||
else if (args[4]->IsString() && args[5]->IsNumber()) { | ||
num_args = 1; | ||
Local<Context> context = env->isolate()->GetCurrentContext(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just use env->context()
, and if you want to have context
be a local variable I’d put it somewhere near the top (where env
is declared as well)
I have fixed all issues, added more tests, fixed lint issues and squashed all commits. This is now ready for review :) |
/cc @nodejs/diagnostics |
src/node_trace_events.cc
Outdated
using v8::Object; | ||
using v8::Value; | ||
|
||
extern tracing::Agent* tracing_agent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this used somewhere?
src/node_trace_events.cc
Outdated
extern tracing::Agent* tracing_agent; | ||
|
||
// The tracing APIs require category groups to be pointers to long-lived | ||
// strings. Those strings are stored here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really can’t make out a code path where this is actually needed … but it would be really good to have that verified by somebody who is familiar with the tracing code
src/node_trace_events.cc
Outdated
return insertion.first->c_str(); | ||
} | ||
|
||
static inline char GetPhase(Environment* env, const Local<Value>& arg) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: You can pass Local
s as Local<Value>
, they are basically just pointers so copying them is effectively free
@matthewloring so it turns out benchmark server tested using 10 'use strict';
const http = require('http');
const fs = require('fs');
const server = http.createServer(function (req, res) {
fs.createReadStream(__filename).pipe(res);
});
server.listen(8080, '127.0.0.1', function () {
console.log('http://127.0.0.1:8080');
}); |
@AndreasMadsen I'm sorry but I don't fully understand the graph. Are you comparing throughput with trace event active (and trace points inside async wrap) vs. throughput with fs.write calls inside the JS async wrap code? |
Hmm, I'm not sure if throughput is the right word. It is the requests per second. The 4 runs are:
log.js'use strict';
const async_hooks = require('async_hooks');
const fs = require('fs');
const whitelistProviders = new Set(Object.keys(process.binding('async_wrap').Providers));
const providerMap = new Map();
const tick = process.hrtime();
const fd = fs.openSync('naive_async_hooks_event_logger.log', 'w');
let skip = false;
function ts() {
const tock = process.hrtime(tick);
return Math.floor(tock[0] * 1e6 + tock[1] * 1e-3);
}
function checkError(err) {
if (err) throw err;
}
async_hooks.createHook({
init(asyncId, provider, triggerAsyncId, resource) {
if (skip) return;
if (!whitelistProviders.has(provider)) return;
providerMap.set(asyncId, provider);
skip = true;
fs.write(fd, `{"pid":${process.pid},"tid":775,"ts":${ts()},"ph":"b","cat":"node","name":"${provider}","dur":0,"tdur":0,"id":0x"${asyncId.toString(16)}","args":{}}\n`, checkError);
skip = false;
},
before(asyncId) {
if (!providerMap.has(asyncId)) return;
const provider = providerMap.get(asyncId);
skip = true;
fs.write(fd, `{"pid":${process.pid},"tid":775,"ts":${ts()},"ph":"b","cat":"node","name":"${provider}_CALLBACK","dur":0,"tdur":0,"id":0x"${asyncId.toString(16)}","args":{}}\n`, checkError);
skip = false;
},
after(asyncId) {
if (!providerMap.has(asyncId)) return;
const provider = providerMap.get(asyncId);
skip = true;
fs.write(fd, `{"pid":${process.pid},"tid":775,"ts":${ts()},"ph":"e","cat":"node","name":"${provider}_CALLBACK","dur":0,"tdur":0,"id":0x"${asyncId.toString(16)}","args":{}}\n`, checkError);
skip = false;
},
destroy(asyncId) {
if (!providerMap.has(asyncId)) return;
const provider = providerMap.get(asyncId);
providerMap.delete(asyncId);
skip = true;
fs.write(fd, `{"pid":${process.pid},"tid":775,"ts":${ts()},"ph":"e","cat":"node","name":"${provider}","dur":0,"tdur":0,"id":0x"${asyncId.toString(16)}","args":{}}\n`, checkError);
skip = false;
}
}).enable();
process.on('exit', function () {
fs.closeSync(fd);
}); edit: oh, I guess that comparison isn't fair since |
Fixed the benchmark. The results are more reasonable now. The comment is collapsed, but could you also look at #15538 (comment) |
I agree that not logging next ticks would skew the results. I would expect trace events to do substantially better than any logging done from JS but would have to do some profiling to have a more detailed picture. |
The CI is almost green, I'm getting this error on
I'm not sure what could have caused that :/ |
running windows CI again: https://ci.nodejs.org/job/node-test-commit-windows-fanned/12263/ |
Ouch, looks like the error is legit. But I'm totally lost how this error could have any relation to this PR. It is also oddly specific to the Windows version and VS version, so I'm not sure there are any good reasons. I'm clueless. |
/cc @nodejs/platform-windows - Please help :/ |
|
||
} // namespace node | ||
|
||
NODE_MODULE_CONTEXT_AWARE_BUILTIN(trace_events, node::InitializeTraceEvents) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have been NODE_BUILTIN_MODULE_CONTEXT_AWARE(...)
and probably breaks the shared/static library build. I'll open a PR to rectify and remove NODE_MODULE_CONTEXT_AWARE_BUILTIN()
while I'm at it.
edit: #17071
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 😂
This will allow trace event to record timing information for all asynchronous operations that are observed by async_hooks. PR-URL: #15538 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Notable changes: * async\_hooks: - add trace events to async_hooks (Andreas Madsen) #15538 - add provider types for net server (Andreas Madsen) #17157 * console: - console.debug can now be used outside of the inspector (Benjamin Zaslavsky) #17033 * deps: - upgrade libuv to 1.18.0 (cjihrig) #17282 - patch V8 to 6.2.414.46 (Myles Borins) #17206 * module: - module.builtinModules will return a list of built in modules (Jon Moss) #16386 * n-api: - add helper for addons to get the event loop (Anna Henningsen) #17109 * process: - process.setUncaughtExceptionCaptureCallback can now be used to customize behavior for `--abort-on-uncaught-exception` (Anna Henningsen) #17159 - A signal handler is now able to receive the signal code that triggered the handler. (Robert Rossmann) #15606 * src: - embedders can now use Node::CreatePlatform to create an instance of NodePlatform (Cheng Zhao) #16981 * stream: - writable.writableHighWaterMark and readable.readableHighWaterMark will return the values the stream object was instantiated with (Calvin Metcalf) #12860 * **Added new collaborators** * [maclover7](https://github.com/maclover7) Jon Moss * [guybedford](https://github.com/guybedford) Guy Bedford * [hashseed](https://github.com/hashseed) Yang Guo PR-URL: Coming Soon
Notable changes: * async\_hooks: - add trace events to async_hooks (Andreas Madsen) #15538 - add provider types for net server (Andreas Madsen) #17157 * console: - console.debug can now be used outside of the inspector (Benjamin Zaslavsky) #17033 * deps: - upgrade libuv to 1.18.0 (cjihrig) #17282 - patch V8 to 6.2.414.46 (Myles Borins) #17206 * module: - module.builtinModules will return a list of built in modules (Jon Moss) #16386 * n-api: - add helper for addons to get the event loop (Anna Henningsen) #17109 * process: - process.setUncaughtExceptionCaptureCallback can now be used to customize behavior for `--abort-on-uncaught-exception` (Anna Henningsen) #17159 - A signal handler is now able to receive the signal code that triggered the handler. (Robert Rossmann) #15606 * src: - embedders can now use Node::CreatePlatform to create an instance of NodePlatform (Cheng Zhao) #16981 * stream: - writable.writableHighWaterMark and readable.readableHighWaterMark will return the values the stream object was instantiated with (Calvin Metcalf) #12860 * **Added new collaborators** * [maclover7](https://github.com/maclover7) Jon Moss * [guybedford](https://github.com/guybedford) Guy Bedford * [hashseed](https://github.com/hashseed) Yang Guo PR-URL: #17631
Notable changes: * async\_hooks: - add trace events to async_hooks (Andreas Madsen) #15538 - add provider types for net server (Andreas Madsen) #17157 * console: - console.debug can now be used outside of the inspector (Benjamin Zaslavsky) #17033 * deps: - upgrade libuv to 1.18.0 (cjihrig) #17282 - patch V8 to 6.2.414.46 (Myles Borins) #17206 * module: - module.builtinModules will return a list of built in modules (Jon Moss) #16386 * n-api: - add helper for addons to get the event loop (Anna Henningsen) #17109 * process: - process.setUncaughtExceptionCaptureCallback can now be used to customize behavior for `--abort-on-uncaught-exception` (Anna Henningsen) #17159 - A signal handler is now able to receive the signal code that triggered the handler. (Robert Rossmann) #15606 * src: - embedders can now use Node::CreatePlatform to create an instance of NodePlatform (Cheng Zhao) #16981 * stream: - writable.writableHighWaterMark and readable.readableHighWaterMark will return the values the stream object was instantiated with (Calvin Metcalf) #12860 * **Added new collaborators** * [maclover7](https://github.com/maclover7) Jon Moss * [guybedford](https://github.com/guybedford) Guy Bedford * [hashseed](https://github.com/hashseed) Yang Guo PR-URL: #17631
- Always start the inspector agent for nodejs/node#17085 - Set the tracing controller for node nodejs/node#15538 - Isolate data creation now requires plaform nodejs/node#16700
- Always start the inspector agent for nodejs/node#17085 - Set the tracing controller for node nodejs/node#15538 - Isolate data creation now requires plaform nodejs/node#16700
* update submodule refs for node v9.3.0 * Define "llvm_version" for Node.js build * NODE_MODULE_CONTEXT_AWARE_BUILTIN -> NODE_BUILTIN_MODULE_CONTEXT_AWARE * update NodePlatform to MultiIsolatePlatform * fix linting error * update node ref * REVIEW: Explicitly register builtin modules nodejs/node#16565 * update libcc ref * switch libcc to c62 * REVIEW: Address node api changes - Always start the inspector agent for nodejs/node#17085 - Set the tracing controller for node nodejs/node#15538 - Isolate data creation now requires plaform nodejs/node#16700
This will allow trace event to record timing information for all asynchronous operations that are observed by async_hooks. PR-URL: nodejs#15538 Backport-PR-URL: nodejs#18179 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
This will allow trace event to record timing information for all asynchronous operations that are observed by async_hooks. Backport-PR-URL: #18179 PR-URL: #15538 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
* update submodule refs for node v9.3.0 * Define "llvm_version" for Node.js build * NODE_MODULE_CONTEXT_AWARE_BUILTIN -> NODE_BUILTIN_MODULE_CONTEXT_AWARE * update NodePlatform to MultiIsolatePlatform * fix linting error * update node ref * REVIEW: Explicitly register builtin modules nodejs/node#16565 * update libcc ref * switch libcc to c62 * REVIEW: Address node api changes - Always start the inspector agent for nodejs/node#17085 - Set the tracing controller for node nodejs/node#15538 - Isolate data creation now requires plaform nodejs/node#16700
* update submodule refs for node v9.3.0 * Define "llvm_version" for Node.js build * NODE_MODULE_CONTEXT_AWARE_BUILTIN -> NODE_BUILTIN_MODULE_CONTEXT_AWARE * update NodePlatform to MultiIsolatePlatform * fix linting error * update node ref * REVIEW: Explicitly register builtin modules nodejs/node#16565 * update libcc ref * switch libcc to c62 * REVIEW: Address node api changes - Always start the inspector agent for nodejs/node#17085 - Set the tracing controller for node nodejs/node#15538 - Isolate data creation now requires plaform nodejs/node#16700
* update submodule refs for node v9.3.0 * Define "llvm_version" for Node.js build * NODE_MODULE_CONTEXT_AWARE_BUILTIN -> NODE_BUILTIN_MODULE_CONTEXT_AWARE * update NodePlatform to MultiIsolatePlatform * fix linting error * update node ref * REVIEW: Explicitly register builtin modules nodejs/node#16565 * update libcc ref * switch libcc to c62 * REVIEW: Address node api changes - Always start the inspector agent for nodejs/node#17085 - Set the tracing controller for node nodejs/node#15538 - Isolate data creation now requires plaform nodejs/node#16700
* update submodule refs for node v9.3.0 * Define "llvm_version" for Node.js build * NODE_MODULE_CONTEXT_AWARE_BUILTIN -> NODE_BUILTIN_MODULE_CONTEXT_AWARE * update NodePlatform to MultiIsolatePlatform * fix linting error * update node ref * REVIEW: Explicitly register builtin modules nodejs/node#16565 * update libcc ref * switch libcc to c62 * REVIEW: Address node api changes - Always start the inspector agent for nodejs/node#17085 - Set the tracing controller for node nodejs/node#15538 - Isolate data creation now requires plaform nodejs/node#16700
* update submodule refs for node v9.3.0 * Define "llvm_version" for Node.js build * NODE_MODULE_CONTEXT_AWARE_BUILTIN -> NODE_BUILTIN_MODULE_CONTEXT_AWARE * update NodePlatform to MultiIsolatePlatform * fix linting error * update node ref * REVIEW: Explicitly register builtin modules nodejs/node#16565 * update libcc ref * switch libcc to c62 * REVIEW: Address node api changes - Always start the inspector agent for nodejs/node#17085 - Set the tracing controller for node nodejs/node#15538 - Isolate data creation now requires plaform nodejs/node#16700
Notable changes: * deps: * update V8 to 6.2.414.46 (Michaël Zasso) [#16413](#16413) * revert ABI breaking changes in V8 6.2 (Anna Henningsen) [#16413](#16413) * upgrade libuv to 1.19.1 (cjihrig) [#18260](#18260) * re land npm 5.6.0 (Myles Borins) [#18625](#18625) * ICU 60 bump (Steven R. Loomis) [#16876](#16876) * crypto: * Support both OpenSSL 1.1.0 and 1.0.2 (David Benjamin) [#16130](#16130) * warn on invalid authentication tag length (Tobias Nießen) [#17566](#17566) * async_hooks: * update defaultTriggerAsyncIdScope for perf (Anatoli Papirovski) [#18004](#18004) * use typed array stack as fast path (Anna Henningsen) [#17780](#17780) * use scope for defaultTriggerAsyncId (Andreas Madsen) [#17273](#17273) * separate missing from default context (Andreas Madsen) [#17273](#17273) * rename initTriggerId (Andreas Madsen) [#17273](#17273) * deprecate undocumented API (Andreas Madsen) [#16972](#16972) * add destroy event for gced AsyncResources (Sebastian Mayr) [#16998](#16998) * add trace events to async_hooks (Andreas Madsen) [#15538](#15538) * set HTTPParser trigger to socket (Andreas Madsen) [#18003](#18003) * add provider types for net server (Andreas Madsen) [#17157](#17157) * n-api: * add helper for addons to get the event loop (Anna Henningsen) [#17109](#17109) * cli: * add --stack-trace-limit to NODE_OPTIONS (Anna Henningsen) [#16495](#16495) * console: * add support for console.debug (Benjamin Zaslavsky) [#17033](#17033) * module: * add builtinModules (Jon Moss) [#16386](#16386) * replace default paths in require.resolve() (cjihrig) [#17113](#17113) * src: * add helper for addons to get the event loop (Anna Henningsen) [#17109](#17109) * add process.ppid (cjihrig) [#16839](#16839) * http: * support generic `Duplex` streams (Anna Henningsen) [#16267](#16267) * add rawPacket in err of `clientError` event (XadillaX) [#17672](#17672) * better support for IPv6 addresses (Mattias Holmlund) [#14772](#14772) * net: * remove ADDRCONFIG DNS hint on Windows (Bartosz Sosnowski) [#17662](#17662) * process: * fix reading zero-length env vars on win32 (Anna Henningsen) [#18463](#18463) * tls: * unconsume stream on destroy (Anna Henningsen) [#17478](#17478) * process: * improve unhandled rejection message (Madara Uchiha) [#17158](#17158) * stream: * remove usage of *State.highWaterMark (Calvin Metcalf) [#12860](#12860) * trace_events: * add executionAsyncId to init events (Andreas Madsen) [#17196](#17196) PR-URL: #18336
Notable changes: * deps: * update V8 to 6.2.414.46 (Michaël Zasso) [#16413](#16413) * revert ABI breaking changes in V8 6.2 (Anna Henningsen) [#16413](#16413) * upgrade libuv to 1.19.1 (cjihrig) [#18260](#18260) * re land npm 5.6.0 (Myles Borins) [#18625](#18625) * ICU 60 bump (Steven R. Loomis) [#16876](#16876) * crypto: * Support both OpenSSL 1.1.0 and 1.0.2 (David Benjamin) [#16130](#16130) * warn on invalid authentication tag length (Tobias Nießen) [#17566](#17566) * async_hooks: * update defaultTriggerAsyncIdScope for perf (Anatoli Papirovski) [#18004](#18004) * use typed array stack as fast path (Anna Henningsen) [#17780](#17780) * use scope for defaultTriggerAsyncId (Andreas Madsen) [#17273](#17273) * separate missing from default context (Andreas Madsen) [#17273](#17273) * rename initTriggerId (Andreas Madsen) [#17273](#17273) * deprecate undocumented API (Andreas Madsen) [#16972](#16972) * add destroy event for gced AsyncResources (Sebastian Mayr) [#16998](#16998) * add trace events to async_hooks (Andreas Madsen) [#15538](#15538) * set HTTPParser trigger to socket (Andreas Madsen) [#18003](#18003) * add provider types for net server (Andreas Madsen) [#17157](#17157) * n-api: * add helper for addons to get the event loop (Anna Henningsen) [#17109](#17109) * cli: * add --stack-trace-limit to NODE_OPTIONS (Anna Henningsen) [#16495](#16495) * console: * add support for console.debug (Benjamin Zaslavsky) [#17033](#17033) * module: * add builtinModules (Jon Moss) [#16386](#16386) * replace default paths in require.resolve() (cjihrig) [#17113](#17113) * src: * add helper for addons to get the event loop (Anna Henningsen) [#17109](#17109) * add process.ppid (cjihrig) [#16839](#16839) * http: * support generic `Duplex` streams (Anna Henningsen) [#16267](#16267) * add rawPacket in err of `clientError` event (XadillaX) [#17672](#17672) * better support for IPv6 addresses (Mattias Holmlund) [#14772](#14772) * net: * remove ADDRCONFIG DNS hint on Windows (Bartosz Sosnowski) [#17662](#17662) * process: * fix reading zero-length env vars on win32 (Anna Henningsen) [#18463](#18463) * tls: * unconsume stream on destroy (Anna Henningsen) [#17478](#17478) * process: * improve unhandled rejection message (Madara Uchiha) [#17158](#17158) * stream: * remove usage of *State.highWaterMark (Calvin Metcalf) [#12860](#12860) * trace_events: * add executionAsyncId to init events (Andreas Madsen) [#17196](#17196) PR-URL: #18336
* update submodule refs for node v9.3.0 * Define "llvm_version" for Node.js build * NODE_MODULE_CONTEXT_AWARE_BUILTIN -> NODE_BUILTIN_MODULE_CONTEXT_AWARE * update NodePlatform to MultiIsolatePlatform * fix linting error * update node ref * REVIEW: Explicitly register builtin modules nodejs/node#16565 * update libcc ref * switch libcc to c62 * REVIEW: Address node api changes - Always start the inspector agent for nodejs/node#17085 - Set the tracing controller for node nodejs/node#15538 - Isolate data creation now requires plaform nodejs/node#16700
Notable changes: * deps: * update V8 to 6.2.414.46 (Michaël Zasso) [nodejs#16413](nodejs#16413) * revert ABI breaking changes in V8 6.2 (Anna Henningsen) [nodejs#16413](nodejs#16413) * upgrade libuv to 1.19.1 (cjihrig) [nodejs#18260](nodejs#18260) * re land npm 5.6.0 (Myles Borins) [nodejs#18625](nodejs#18625) * ICU 60 bump (Steven R. Loomis) [nodejs#16876](nodejs#16876) * crypto: * Support both OpenSSL 1.1.0 and 1.0.2 (David Benjamin) [nodejs#16130](nodejs#16130) * warn on invalid authentication tag length (Tobias Nießen) [nodejs#17566](nodejs#17566) * async_hooks: * update defaultTriggerAsyncIdScope for perf (Anatoli Papirovski) [nodejs#18004](nodejs#18004) * use typed array stack as fast path (Anna Henningsen) [nodejs#17780](nodejs#17780) * use scope for defaultTriggerAsyncId (Andreas Madsen) [nodejs#17273](nodejs#17273) * separate missing from default context (Andreas Madsen) [nodejs#17273](nodejs#17273) * rename initTriggerId (Andreas Madsen) [nodejs#17273](nodejs#17273) * deprecate undocumented API (Andreas Madsen) [nodejs#16972](nodejs#16972) * add destroy event for gced AsyncResources (Sebastian Mayr) [nodejs#16998](nodejs#16998) * add trace events to async_hooks (Andreas Madsen) [nodejs#15538](nodejs#15538) * set HTTPParser trigger to socket (Andreas Madsen) [nodejs#18003](nodejs#18003) * add provider types for net server (Andreas Madsen) [nodejs#17157](nodejs#17157) * n-api: * add helper for addons to get the event loop (Anna Henningsen) [nodejs#17109](nodejs#17109) * cli: * add --stack-trace-limit to NODE_OPTIONS (Anna Henningsen) [nodejs#16495](nodejs#16495) * console: * add support for console.debug (Benjamin Zaslavsky) [nodejs#17033](nodejs#17033) * module: * add builtinModules (Jon Moss) [nodejs#16386](nodejs#16386) * replace default paths in require.resolve() (cjihrig) [nodejs#17113](nodejs#17113) * src: * add helper for addons to get the event loop (Anna Henningsen) [nodejs#17109](nodejs#17109) * add process.ppid (cjihrig) [nodejs#16839](nodejs#16839) * http: * support generic `Duplex` streams (Anna Henningsen) [nodejs#16267](nodejs#16267) * add rawPacket in err of `clientError` event (XadillaX) [nodejs#17672](nodejs#17672) * better support for IPv6 addresses (Mattias Holmlund) [nodejs#14772](nodejs#14772) * net: * remove ADDRCONFIG DNS hint on Windows (Bartosz Sosnowski) [nodejs#17662](nodejs#17662) * process: * fix reading zero-length env vars on win32 (Anna Henningsen) [nodejs#18463](nodejs#18463) * tls: * unconsume stream on destroy (Anna Henningsen) [nodejs#17478](nodejs#17478) * process: * improve unhandled rejection message (Madara Uchiha) [nodejs#17158](nodejs#17158) * stream: * remove usage of *State.highWaterMark (Calvin Metcalf) [nodejs#12860](nodejs#12860) * trace_events: * add executionAsyncId to init events (Andreas Madsen) [nodejs#17196](nodejs#17196) PR-URL: nodejs#18336
rebase of #14347
This is for debugging purposes, I'm getting a segmentation fault when running justnode
, but withtrace_events
enables it works. @matthewloring doesn't get the segmentation fault, so I'm running the CI on this PR to check it out.This will allow trace event to record timing information for all
asynchronous operations that are observed by AsyncWrap.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
async_hooks, trace_events