Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
report: include information about event loop itself
  • Loading branch information
addaleax committed Feb 5, 2019
commit 307e2309e06b6c1fbc59dbc26e69df2ba9fc3866
5 changes: 5 additions & 0 deletions doc/api/report.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ is provided below for reference.
"is_referenced": false,
"address": "0x000000010188f2e0",
"details": ""
},
{
"type": "loop",
"is_active": true,
"address": "140696384399248"
}
],
"environmentVariables": {
Expand Down
11 changes: 10 additions & 1 deletion src/node_report.cc
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,18 @@ static void WriteNodeReport(Isolate* isolate,
#endif

writer.json_arraystart("libuv");
if (env != nullptr)
if (env != nullptr) {
uv_walk(env->event_loop(), WalkHandle, static_cast<void*>(&writer));

writer.json_start();
writer.json_keyvalue("type", "loop");
writer.json_keyvalue("is_active",
static_cast<bool>(uv_loop_alive(env->event_loop())));
writer.json_keyvalue("address",
std::to_string(reinterpret_cast<int64_t>(env->event_loop())));
writer.json_end();
}

writer.json_arrayend();

// Report operating system information
Expand Down