node/doc/api/_toc.md
James M Snell 5c27e44488 trace_events: adds a new trace_events api
Removes the requirement to use `--trace-events-enabled` to enable
trace events. Tracing is enabled automatically if there are any
enabled categories.

Adds a new `trace_events` module with an API for enabling/disabling
trace events at runtime without a command line flag.

```js
const trace_events = require('trace_events');
const categories = [ 'node.perf', 'node.async_hooks' ];
const tracing = trace_events.createTracing({ categories });
tracing.enable();
// do stuff
tracing.disable();
```

Multiple `Tracing` objects may exist and be enabled at any point
in time. The enabled trace event categories is the union of all
enabled `Tracing` objects and the `--trace-event-categories`
flag.

PR-URL: https://github.com/nodejs/node/pull/19803
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2018-04-17 08:30:20 -07:00

62 lines
1.6 KiB
Markdown

@// NB(chrisdickinson): if you move this file, be sure to update
@// tools/doc/html.js to point at the new location.
<!--introduced_in=v0.10.0-->
* [About these Docs](documentation.html)
* [Usage & Example](synopsis.html)
<div class="line"></div>
* [Assertion Testing](assert.html)
* [Async Hooks](async_hooks.html)
* [Buffer](buffer.html)
* [C++ Addons](addons.html)
* [C/C++ Addons - N-API](n-api.html)
* [Child Processes](child_process.html)
* [Cluster](cluster.html)
* [Command Line Options](cli.html)
* [Console](console.html)
* [Crypto](crypto.html)
* [Debugger](debugger.html)
* [Deprecated APIs](deprecations.html)
* [DNS](dns.html)
* [Domain](domain.html)
* [ECMAScript Modules](esm.html)
* [Errors](errors.html)
* [Events](events.html)
* [File System](fs.html)
* [Globals](globals.html)
* [HTTP](http.html)
* [HTTP/2](http2.html)
* [HTTPS](https.html)
* [Inspector](inspector.html)
* [Internationalization](intl.html)
* [Modules](modules.html)
* [Net](net.html)
* [OS](os.html)
* [Path](path.html)
* [Performance Hooks](perf_hooks.html)
* [Process](process.html)
* [Punycode](punycode.html)
* [Query Strings](querystring.html)
* [Readline](readline.html)
* [REPL](repl.html)
* [Stream](stream.html)
* [String Decoder](string_decoder.html)
* [Timers](timers.html)
* [TLS/SSL](tls.html)
* [Trace Events](tracing.html)
* [TTY](tty.html)
* [UDP/Datagram](dgram.html)
* [URL](url.html)
* [Utilities](util.html)
* [V8](v8.html)
* [VM](vm.html)
* [ZLIB](zlib.html)
<div class="line"></div>
* [GitHub Repo & Issue Tracker](https://github.com/nodejs/node)
* [Mailing List](https://groups.google.com/group/nodejs)