Lines Matching refs:writer
63 static void PrintVersionInformation(JSONWriter* writer);
64 static void PrintJavaScriptErrorStack(JSONWriter* writer,
68 static void PrintJavaScriptErrorProperties(JSONWriter* writer,
71 static void PrintNativeStack(JSONWriter* writer);
72 static void PrintResourceUsage(JSONWriter* writer);
73 static void PrintGCStatistics(JSONWriter* writer, Isolate* isolate);
74 static void PrintSystemInformation(JSONWriter* writer);
75 static void PrintLoadedLibraries(JSONWriter* writer);
76 static void PrintComponentVersions(JSONWriter* writer);
77 static void PrintRelease(JSONWriter* writer);
78 static void PrintCpuInfo(JSONWriter* writer);
79 static void PrintNetworkInterfaceInfo(JSONWriter* writer);
199 JSONWriter writer(out, compact); in WriteNodeReport() local
200 writer.json_start(); in WriteNodeReport()
201 writer.json_objectstart("header"); in WriteNodeReport()
202 writer.json_keyvalue("reportVersion", NODE_REPORT_VERSION); in WriteNodeReport()
203 writer.json_keyvalue("event", message); in WriteNodeReport()
204 writer.json_keyvalue("trigger", trigger); in WriteNodeReport()
206 writer.json_keyvalue("filename", filename); in WriteNodeReport()
208 writer.json_keyvalue("filename", JSONWriter::Null{}); in WriteNodeReport()
222 writer.json_keyvalue("dumpEventTime", timebuf); in WriteNodeReport()
233 writer.json_keyvalue("dumpEventTime", timebuf); in WriteNodeReport()
238 writer.json_keyvalue("dumpEventTimeStamp", in WriteNodeReport()
243 writer.json_keyvalue("processId", pid); in WriteNodeReport()
245 writer.json_keyvalue("threadId", env->thread_id()); in WriteNodeReport()
247 writer.json_keyvalue("threadId", JSONWriter::Null{}); in WriteNodeReport()
254 writer.json_keyvalue("cwd", buf); in WriteNodeReport()
259 writer.json_arraystart("commandLine"); in WriteNodeReport()
261 writer.json_element(arg); in WriteNodeReport()
263 writer.json_arrayend(); in WriteNodeReport()
267 PrintVersionInformation(&writer); in WriteNodeReport()
268 writer.json_objectend(); in WriteNodeReport()
271 writer.json_objectstart("javascriptStack"); in WriteNodeReport()
273 PrintJavaScriptErrorStack(&writer, isolate, error, trigger); in WriteNodeReport()
276 PrintJavaScriptErrorProperties(&writer, isolate, error); in WriteNodeReport()
277 writer.json_objectend(); // the end of 'javascriptStack' in WriteNodeReport()
280 PrintGCStatistics(&writer, isolate); in WriteNodeReport()
284 PrintNativeStack(&writer); in WriteNodeReport()
287 PrintResourceUsage(&writer); in WriteNodeReport()
289 writer.json_arraystart("libuv"); in WriteNodeReport()
291 uv_walk(env->event_loop(), WalkHandle, static_cast<void*>(&writer)); in WriteNodeReport()
293 writer.json_start(); in WriteNodeReport()
294 writer.json_keyvalue("type", "loop"); in WriteNodeReport()
295 writer.json_keyvalue("is_active", in WriteNodeReport()
297 writer.json_keyvalue("address", in WriteNodeReport()
302 writer.json_keyvalue("loopIdleTimeSeconds", 1.0 * idle_time / 1e9); in WriteNodeReport()
303 writer.json_end(); in WriteNodeReport()
306 writer.json_arrayend(); in WriteNodeReport()
308 writer.json_arraystart("workers"); in WriteNodeReport()
337 writer.json_element(JSONWriter::ForeignJSON { worker_info }); in WriteNodeReport()
339 writer.json_arrayend(); in WriteNodeReport()
342 PrintSystemInformation(&writer); in WriteNodeReport()
344 writer.json_objectend(); in WriteNodeReport()
351 static void PrintVersionInformation(JSONWriter* writer) { in PrintVersionInformation() argument
355 writer->json_keyvalue("nodejsVersion", buf.str()); in PrintVersionInformation()
364 writer->json_keyvalue("glibcVersionRuntime", (*libc_version)()); in PrintVersionInformation()
369 writer->json_keyvalue("glibcVersionCompiler", buf.str()); in PrintVersionInformation()
374 writer->json_keyvalue("wordSize", sizeof(void*) * 8); in PrintVersionInformation()
375 writer->json_keyvalue("arch", node::per_process::metadata.arch); in PrintVersionInformation()
376 writer->json_keyvalue("platform", node::per_process::metadata.platform); in PrintVersionInformation()
379 PrintComponentVersions(writer); in PrintVersionInformation()
382 PrintRelease(writer); in PrintVersionInformation()
388 writer->json_keyvalue("osName", os_info.sysname); in PrintVersionInformation()
389 writer->json_keyvalue("osRelease", os_info.release); in PrintVersionInformation()
390 writer->json_keyvalue("osVersion", os_info.version); in PrintVersionInformation()
391 writer->json_keyvalue("osMachine", os_info.machine); in PrintVersionInformation()
394 PrintCpuInfo(writer); in PrintVersionInformation()
395 PrintNetworkInterfaceInfo(writer); in PrintVersionInformation()
401 writer->json_keyvalue("host", host); in PrintVersionInformation()
405 static void PrintCpuInfo(JSONWriter* writer) { in PrintCpuInfo() argument
409 writer->json_arraystart("cpus"); in PrintCpuInfo()
411 writer->json_start(); in PrintCpuInfo()
412 writer->json_keyvalue("model", cpu_info[i].model); in PrintCpuInfo()
413 writer->json_keyvalue("speed", cpu_info[i].speed); in PrintCpuInfo()
414 writer->json_keyvalue("user", cpu_info[i].cpu_times.user); in PrintCpuInfo()
415 writer->json_keyvalue("nice", cpu_info[i].cpu_times.nice); in PrintCpuInfo()
416 writer->json_keyvalue("sys", cpu_info[i].cpu_times.sys); in PrintCpuInfo()
417 writer->json_keyvalue("idle", cpu_info[i].cpu_times.idle); in PrintCpuInfo()
418 writer->json_keyvalue("irq", cpu_info[i].cpu_times.irq); in PrintCpuInfo()
419 writer->json_end(); in PrintCpuInfo()
421 writer->json_arrayend(); in PrintCpuInfo()
426 static void PrintNetworkInterfaceInfo(JSONWriter* writer) { in PrintNetworkInterfaceInfo() argument
434 writer->json_arraystart("networkInterfaces"); in PrintNetworkInterfaceInfo()
437 writer->json_start(); in PrintNetworkInterfaceInfo()
438 writer->json_keyvalue("name", interfaces[i].name); in PrintNetworkInterfaceInfo()
439 writer->json_keyvalue("internal", !!interfaces[i].is_internal); in PrintNetworkInterfaceInfo()
449 writer->json_keyvalue("mac", mac); in PrintNetworkInterfaceInfo()
454 writer->json_keyvalue("address", ip); in PrintNetworkInterfaceInfo()
455 writer->json_keyvalue("netmask", netmask); in PrintNetworkInterfaceInfo()
456 writer->json_keyvalue("family", "IPv4"); in PrintNetworkInterfaceInfo()
460 writer->json_keyvalue("address", ip); in PrintNetworkInterfaceInfo()
461 writer->json_keyvalue("netmask", netmask); in PrintNetworkInterfaceInfo()
462 writer->json_keyvalue("family", "IPv6"); in PrintNetworkInterfaceInfo()
463 writer->json_keyvalue("scopeid", in PrintNetworkInterfaceInfo()
466 writer->json_keyvalue("family", "unknown"); in PrintNetworkInterfaceInfo()
469 writer->json_end(); in PrintNetworkInterfaceInfo()
472 writer->json_arrayend(); in PrintNetworkInterfaceInfo()
477 static void PrintJavaScriptErrorProperties(JSONWriter* writer, in PrintJavaScriptErrorProperties() argument
480 writer->json_objectstart("errorProperties"); in PrintJavaScriptErrorProperties()
486 return writer->json_objectend(); // the end of 'errorProperties' in PrintJavaScriptErrorProperties()
503 writer->json_keyvalue(std::string(*k, k.length()), in PrintJavaScriptErrorProperties()
507 writer->json_objectend(); // the end of 'errorProperties' in PrintJavaScriptErrorProperties()
511 static void PrintJavaScriptErrorStack(JSONWriter* writer, in PrintJavaScriptErrorStack() argument
532 writer->json_keyvalue("message", ss); in PrintJavaScriptErrorStack()
535 writer->json_keyvalue("message", l); in PrintJavaScriptErrorStack()
536 writer->json_arraystart("stack"); in PrintJavaScriptErrorStack()
544 writer->json_element(l); in PrintJavaScriptErrorStack()
548 writer->json_arrayend(); in PrintJavaScriptErrorStack()
553 static void PrintNativeStack(JSONWriter* writer) { in PrintNativeStack() argument
557 writer->json_arraystart("nativeStack"); in PrintNativeStack()
561 writer->json_start(); in PrintNativeStack()
562 writer->json_keyvalue("pc", in PrintNativeStack()
564 writer->json_keyvalue("symbol", sym_ctx->LookupSymbol(frame).Display()); in PrintNativeStack()
565 writer->json_end(); in PrintNativeStack()
567 writer->json_arrayend(); in PrintNativeStack()
574 static void PrintGCStatistics(JSONWriter* writer, Isolate* isolate) { in PrintGCStatistics() argument
579 writer->json_objectstart("javascriptHeap"); in PrintGCStatistics()
580 writer->json_keyvalue("totalMemory", v8_heap_stats.total_heap_size()); in PrintGCStatistics()
581 writer->json_keyvalue("totalCommittedMemory", in PrintGCStatistics()
583 writer->json_keyvalue("usedMemory", v8_heap_stats.used_heap_size()); in PrintGCStatistics()
584 writer->json_keyvalue("availableMemory", in PrintGCStatistics()
586 writer->json_keyvalue("memoryLimit", v8_heap_stats.heap_size_limit()); in PrintGCStatistics()
588 writer->json_objectstart("heapSpaces"); in PrintGCStatistics()
592 writer->json_objectstart(v8_heap_space_stats.space_name()); in PrintGCStatistics()
593 writer->json_keyvalue("memorySize", v8_heap_space_stats.space_size()); in PrintGCStatistics()
594 writer->json_keyvalue( in PrintGCStatistics()
597 writer->json_keyvalue( in PrintGCStatistics()
601 writer->json_keyvalue("used", v8_heap_space_stats.space_used_size()); in PrintGCStatistics()
602 writer->json_keyvalue( in PrintGCStatistics()
604 writer->json_objectend(); in PrintGCStatistics()
607 writer->json_objectend(); in PrintGCStatistics()
608 writer->json_objectend(); in PrintGCStatistics()
611 static void PrintResourceUsage(JSONWriter* writer) { in PrintResourceUsage() argument
619 writer->json_objectstart("resourceUsage"); in PrintResourceUsage()
625 writer->json_keyvalue("userCpuSeconds", user_cpu); in PrintResourceUsage()
626 writer->json_keyvalue("kernelCpuSeconds", kernel_cpu); in PrintResourceUsage()
629 writer->json_keyvalue("cpuConsumptionPercent", cpu_percentage); in PrintResourceUsage()
630 writer->json_keyvalue("maxRss", rusage.ru_maxrss * 1024); in PrintResourceUsage()
631 writer->json_objectstart("pageFaults"); in PrintResourceUsage()
632 writer->json_keyvalue("IORequired", rusage.ru_majflt); in PrintResourceUsage()
633 writer->json_keyvalue("IONotRequired", rusage.ru_minflt); in PrintResourceUsage()
634 writer->json_objectend(); in PrintResourceUsage()
635 writer->json_objectstart("fsActivity"); in PrintResourceUsage()
636 writer->json_keyvalue("reads", rusage.ru_inblock); in PrintResourceUsage()
637 writer->json_keyvalue("writes", rusage.ru_oublock); in PrintResourceUsage()
638 writer->json_objectend(); in PrintResourceUsage()
640 writer->json_objectend(); in PrintResourceUsage()
644 writer->json_objectstart("uvthreadResourceUsage"); in PrintResourceUsage()
649 writer->json_keyvalue("userCpuSeconds", user_cpu); in PrintResourceUsage()
650 writer->json_keyvalue("kernelCpuSeconds", kernel_cpu); in PrintResourceUsage()
653 writer->json_keyvalue("cpuConsumptionPercent", cpu_percentage); in PrintResourceUsage()
654 writer->json_objectstart("fsActivity"); in PrintResourceUsage()
655 writer->json_keyvalue("reads", stats.ru_inblock); in PrintResourceUsage()
656 writer->json_keyvalue("writes", stats.ru_oublock); in PrintResourceUsage()
657 writer->json_objectend(); in PrintResourceUsage()
658 writer->json_objectend(); in PrintResourceUsage()
664 static void PrintSystemInformation(JSONWriter* writer) { in PrintSystemInformation() argument
669 writer->json_objectstart("environmentVariables"); in PrintSystemInformation()
678 writer->json_keyvalue(envitems[i].name, envitems[i].value); in PrintSystemInformation()
683 writer->json_objectend(); in PrintSystemInformation()
710 writer->json_objectstart("userLimits"); in PrintSystemInformation()
716 writer->json_objectstart(rlimit_strings[i].description); in PrintSystemInformation()
719 writer->json_keyvalue("soft", "unlimited"); in PrintSystemInformation()
721 writer->json_keyvalue("soft", limit.rlim_cur); in PrintSystemInformation()
724 writer->json_keyvalue("hard", "unlimited"); in PrintSystemInformation()
726 writer->json_keyvalue("hard", limit.rlim_max); in PrintSystemInformation()
728 writer->json_objectend(); in PrintSystemInformation()
731 writer->json_objectend(); in PrintSystemInformation()
734 PrintLoadedLibraries(writer); in PrintSystemInformation()
738 static void PrintLoadedLibraries(JSONWriter* writer) { in PrintLoadedLibraries() argument
739 writer->json_arraystart("sharedObjects"); in PrintLoadedLibraries()
742 for (auto const& module_name : modules) writer->json_element(module_name); in PrintLoadedLibraries()
743 writer->json_arrayend(); in PrintLoadedLibraries()
747 static void PrintComponentVersions(JSONWriter* writer) { in PrintComponentVersions() argument
750 writer->json_objectstart("componentVersions"); in PrintComponentVersions()
753 writer->json_keyvalue(#key, node::per_process::metadata.versions.key); in PrintComponentVersions()
757 writer->json_objectend(); in PrintComponentVersions()
761 static void PrintRelease(JSONWriter* writer) { in PrintRelease() argument
762 writer->json_objectstart("release"); in PrintRelease()
763 writer->json_keyvalue("name", node::per_process::metadata.release.name); in PrintRelease()
765 writer->json_keyvalue("lts", node::per_process::metadata.release.lts); in PrintRelease()
769 writer->json_keyvalue("headersUrl", in PrintRelease()
771 writer->json_keyvalue("sourceUrl", in PrintRelease()
774 writer->json_keyvalue("libUrl", node::per_process::metadata.release.lib_url); in PrintRelease()
778 writer->json_objectend(); in PrintRelease()