-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand working group and repo to all diagnostics.
Add additional top level to repo with subfolders for diagnostic domains. Add initial README.md for each domain. Add some initial docs and samples for domains beyond tracing. Move and minor cleanup of AsyncWrap docs and background info on TRACE_EVENT.
- Loading branch information
Showing
14 changed files
with
176 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
## Debugging API | ||
- [Chrome Debugging Protocol](https://chromedevtools.github.io/debugger-protocol-viewer/) | ||
- [V8 Debugging Protocol](https://github.com/v8/v8/wiki/Debugging-Protocol) | ||
|
||
Node currently relies on V8's internal Debug API and associated commands and events. The Debug API is published at [v8/include/v8-debug.h](https://github.com/v8/v8/blob/master/include/v8-debug.h), and the message protocol is documented in prose in [the V8 wiki](https://github.com/v8/v8/wiki/Debugging-Protocol) and in code in [v8/src/debug/debug.js#L2341-2372](https://github.com/v8/v8/blob/master/src/debug/debug.js#L2341-L2372). | ||
|
||
Node also provides an agent [node/src/debug-agent.h](https://github.com/blob/master/src/debug-agent.h) which relays requests, responses, and events through a TCP socket, and a command-line debugger [node/lib/_debugger.js](https://github.com/blob/master/lib/_debugger.js). | ||
|
||
The Chrome/V8 team has deprecated the internal V8 API and command set and proposed replacing it with a subset of the Chrome Debugging Protocol (CrDP), see https://github.com/nodejs/node/issues/2546. CrDP is documented at [https://chromedevtools.github.io/debugger-protocol-viewer/]() and the backing GitHub repo. | ||
|
||
The [cyrus-and/chrome-remote-interface](https://github.com/cyrus-and/chrome-remote-interface) library provides a JS proxy for CrDP. | ||
|
||
## Step Debugging Tools | ||
Name | Sponsor | ||
-----|-------- | ||
[node-inspector][] | StrongLoop | ||
[JetBrains WebStorm][] | JetBrains | ||
[Visual Studio Code][] | Microsoft | ||
[Node CLI Debugger][] | Node Foundation | ||
[Chrome DevTools][] | Google | ||
[Theseus][] | Adobe Research | ||
|
||
[node-inspector]: https://github.com/node-inspector/node-inspector | ||
[JetBrains WebStorm]: https://www.jetbrains.com/help/webstorm/2016.1/running-and-debugging-node-js.html | ||
[Visual Studio Code]: https://github.com/Microsoft/vscode | ||
[Node CLI Debugger]: https://nodejs.org/api/debugger.html | ||
[Chrome DevTools]: https://github.com/ChromeDevTools/devtools-frontend | ||
[Theseus]: https://github.com/adobe-research/theseus | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
## Heap and Memory Analysis | ||
The [nodejs/post-mortem](https://github.com/nodejs/post-mortem) WG is responsible for this domain. | ||
|
||
### Heap Analysis | ||
- [mdb_v8](https://github.com/joyent/mdb_v8) | ||
- [node-heapdump](https://github.com/bnoordhuis/node-heapdump) | ||
- [llnode](https://github.com/indutny/llnode) | ||
- [IBM IDDE](https://www.ibm.com/developerworks/java/jdk/tools/idde/) | ||
- [Snapshot Utils](https://github.com/bmeck/snapshot-utils) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
## Profiling for Node | ||
- CPU Profiling | ||
- V8 CPU Profiler: [v8/include/v8-profiler.h](https://github.com/v8/blob/master/include/v8-profiler.h) | ||
- Accessible globally through `--prof` runtime flag, basic processing and display through `--prof-processor` runtime flag | ||
- Intel vTune profiler. Accessible through `--enable-vtune-profiling` compile-time flag. | ||
|
||
- Heap Profiling | ||
- V8 Heap Profiler: [v8/include/v8-profiler.h](https://github.com/v8/blob/master/include/v8-profiler.h) | ||
- Heap memory usage stats are available through built-in 'v8' module. | ||
|
||
Name | Sponsor | ||
-----|-------- | ||
[v8-profiler][] | StrongLoop | ||
[Chrome DevTools][] | Google | ||
|
||
[v8-profiler]: https://github.com/node-inspector/v8-profiler | ||
[Chrome DevTools]: https://github.com/ChromeDevTools/devtools-frontend | ||
|
||
### Stack Analysis | ||
- [0x](https://github.com/davidmarkclements/0x) | ||
- [StackVis](https://github.com/joyent/node-stackvis) | ||
|
||
## Docs | ||
[guides/simple-profiling](https://nodejs.org/en/docs/guides/simple-profiling/) | ||
[paulirish/automated-chrome-profiling](https://github.com/paulirish/automated-chrome-profiling) | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## Tracing | ||
- [AsyncWrap](./AsyncWrap/README.md) - Most native objects are represented indirectly by the [AsyncWrap class](https://github.com/nodejs/node/blob/master/src/async-wrap.h), so hooks have been added to that class to trace lifecycle (init/destroy) and callback activity (pre/post) related to these objects. | ||
|
||
- [OS Tracing](./os-tracing/README.md) - LTTng (Linux), SystemTap (Linux), DTrace (OSX), ETW (Windows) | ||
|
||
- [VM Tracing](./vm-tracing/README.md) - Tracing native to JS VMs, such as V8's TRACE_EVENT. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
## OS Tracing | ||
|
||
* [DTrace](http://dtrace.org/) | ||
Available on IllumOS, Solaris, Mac | ||
|
||
- The [DTrace blog](http://dtrace.org/blogs/blog/category/node-js/) has some articles on using DTrace with Node.js | ||
|
||
* [LTTng](http://lttng.org/) | ||
Linux only. | ||
|
||
- [Tracing Node on Linux with LTTNG](http://nearform.github.io/tracing-node-lttng-nodejsdublin/) | ||
- [thekemkid/magic-tracing](https://github.com/thekemkid/magic-tracing) is an example of a Node.js application which implements LTTng tracepoints. A demo is available [here](https://asciicinema.org/a/16785). | ||
|
||
* [ETW](https://msdn.microsoft.com/en-us/library/windows/desktop/aa363668.aspx) | ||
Windows only. | ||
|
||
- Some information was provided by Bill Ticehurst (@billti) in [issue #10](https://github.com/nodejs/tracing-wg/issues/10#issuecomment-137145822) about how he integrated ETW into Node.js for Windows | ||
|
||
* [Perf](https://perf.wiki.kernel.org/) | ||
Linux only. | ||
|
||
- Can be enabled with `--perf_basic_prof` v8 run-time flag. | ||
|
||
* [SystemTap](https://sourceware.org/systemtap/) | ||
Linux only. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
## V8/Chromium Tracing | ||
Generic macro definitions intended to be shared by many projects are in `trace_event_common.h`. | ||
Source of truth for `trace_event_common.h` is in `chromium:src/base/trace_event/trace_event_common.h`. | ||
This file is in Chromium but not in V8. @ofrobots copied it into `nodejs:deps/v8`. Perhaps it should be moved to `nodejs:deps/v8/include` or `nodejs:deps/v8/src/trace_event`. | ||
|
||
Implementation-specific ("INTERNAL_*") macro definitions are in `v8:src/trace_event.h` and `chromium:src/base/trace_event.h`. | ||
Chromium: `trace_event.h` macros utilize `v8::base::TraceLog::AddTraceEvent` to write traces. | ||
V8: `trace_event.h` macros utilize `v8::Platform::AddTraceEvent` to write traces. | ||
Node uses `DefaultPlatform` from `v8:src/libplatform/default-platform.h` which currently simply returns 0. | ||
A simplistic implementation which logs all trace events to stdout illustrates the basics: | ||
|
||
``` | ||
// from v8:src/libplatform/default-platform.cc | ||
// add `#include <iostream>` to includes | ||
uint64_t DefaultPlatform::AddTraceEvent( | ||
char phase, const uint8_t* category_enabled_flag, const char* name, | ||
/* const char* scope, */ uint64_t id, uint64_t bind_id, int num_args, | ||
const char** arg_names, const uint8_t* arg_types, | ||
const uint64_t* arg_values, unsigned int flags) { | ||
time_t timestamp = std::time(nullptr); | ||
std::cout << "phase: " << phase << std::endl; | ||
std::cout << "category_enabled_flag: " << category_enabled_flag << std::endl; | ||
std::cout << "name: " << name << std::endl; | ||
std::cout << "id: " << id << std::endl; | ||
std::cout << "epoch_timestamp: " << timestamp << std::endl; | ||
std::cout << "human_timestamp: " << std::asctime(std::localtime(×tamp)) << std::endl; | ||
return 0; | ||
} | ||
const uint8_t* DefaultPlatform::GetCategoryGroupEnabled(const char* name) { | ||
static uint8_t yes = CategoryGroupEnabledFlags::kEnabledForRecording_CategoryGroupEnabledFlags | | ||
CategoryGroupEnabledFlags::kEnabledForEventCallback_CategoryGroupEnabledFlags; | ||
return &yes; | ||
} | ||
``` |