Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b5b7459

Browse filesBrowse files
jasnelladdaleax
authored andcommitted
trace_events: add version metadata
Use `TRACE_EVENT_METADATA1` to include just the node.js version for now. Later this can be expanded to include more version and platform details. PR-URL: #20852 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
1 parent bb8d341 commit b5b7459
Copy full SHA for b5b7459

File tree

Expand file treeCollapse file tree

2 files changed

+6
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-1
lines changed
Open diff view settings
Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4340,6 +4340,7 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data,
43404340
Environment env(isolate_data, context, v8_platform.GetTracingAgent());
43414341
env.Start(argc, argv, exec_argc, exec_argv, v8_is_profiling);
43424342

4343+
TRACE_EVENT_METADATA1("__metadata", "version", "node", NODE_VERSION_STRING);
43434344
TRACE_EVENT_METADATA1("__metadata", "thread_name", "name",
43444345
"JavaScriptMainThread");
43454346

Collapse file

‎test/parallel/test-trace-events-metadata.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-trace-events-metadata.js
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ tmpdir.refresh();
1313
process.chdir(tmpdir.path);
1414

1515
const proc = cp.spawn(process.execPath,
16-
[ '--trace-events-enabled', '-e', CODE ]);
16+
[ '--trace-event-categories', 'node.perf.usertiming',
17+
'-e', CODE ]);
1718
proc.once('exit', common.mustCall(() => {
1819
assert(common.fileExists(FILE_NAME));
1920
fs.readFile(FILE_NAME, common.mustCall((err, data) => {
@@ -25,5 +26,8 @@ proc.once('exit', common.mustCall(() => {
2526
assert(traces.some((trace) =>
2627
trace.cat === '__metadata' && trace.name === 'thread_name' &&
2728
trace.args.name === 'BackgroundTaskRunner'));
29+
assert(traces.some((trace) =>
30+
trace.cat === '__metadata' && trace.name === 'version' &&
31+
trace.args.node === process.versions.node));
2832
}));
2933
}));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.