-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expand and organize repo #47
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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; | ||
} | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
Sorry, something went wrong.