diff --git a/src/node.cc b/src/node.cc index 5c22b2962f6a0f..4d8464b9f53751 100644 --- a/src/node.cc +++ b/src/node.cc @@ -4322,6 +4322,7 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data, Environment env(isolate_data, context, v8_platform.GetTracingAgent()); env.Start(argc, argv, exec_argc, exec_argv, v8_is_profiling); + TRACE_EVENT_METADATA1("__metadata", "version", "node", NODE_VERSION_STRING); TRACE_EVENT_METADATA1("__metadata", "thread_name", "name", "JavaScriptMainThread"); diff --git a/test/parallel/test-trace-events-metadata.js b/test/parallel/test-trace-events-metadata.js index eccec1ecf0f1a2..8b6e97ce35ff3c 100644 --- a/test/parallel/test-trace-events-metadata.js +++ b/test/parallel/test-trace-events-metadata.js @@ -13,7 +13,8 @@ tmpdir.refresh(); process.chdir(tmpdir.path); const proc = cp.spawn(process.execPath, - [ '--trace-events-enabled', '-e', CODE ]); + [ '--trace-event-categories', 'node.perf.usertiming', + '-e', CODE ]); proc.once('exit', common.mustCall(() => { assert(common.fileExists(FILE_NAME)); fs.readFile(FILE_NAME, common.mustCall((err, data) => { @@ -25,5 +26,8 @@ proc.once('exit', common.mustCall(() => { assert(traces.some((trace) => trace.cat === '__metadata' && trace.name === 'thread_name' && trace.args.name === 'BackgroundTaskRunner')); + assert(traces.some((trace) => + trace.cat === '__metadata' && trace.name === 'version' && + trace.args.node === process.versions.node)); })); }));