Lines Matching +full:enable +full:- +full:trace
1 # Trace events
3 <!--introduced_in=v7.7.0-->
5 > Stability: 1 - Experimental
7 <!-- source_link=lib/trace_events.js -->
12 Tracing can be enabled with the `--trace-event-categories` command-line flag
13 or by using the `trace_events` module. The `--trace-event-categories` flag
14 accepts a list of comma-separated category names.
19 * `node.async_hooks`: Enables capture of detailed [`async_hooks`][] trace data.
25 * `node.dns.native`: Enables capture of trace data for DNS queries.
27 * `node.fs.sync`: Enables capture of trace data for file system sync methods.
33 * `node.promises.rejections`: Enables capture of trace data tracking the number
34 of unhandled Promise rejections and handled-after-rejections.
35 * `node.vm.script`: Enables capture of trace data for the `vm` module's
42 node --trace-event-categories v8,node,node.async_hooks server.js
45 Prior versions of Node.js required the use of the `--trace-events-enabled`
46 flag to enable trace events. This requirement has been removed. However, the
47 `--trace-events-enabled` flag *may* still be used and will enable the
48 `node`, `node.async_hooks`, and `v8` trace event categories by default.
51 node --trace-events-enabled
55 node --trace-event-categories v8,node,node.async_hooks
58 Alternatively, trace events may be enabled using the `trace_events` module:
63 tracing.enable(); // Enable trace event capture for the 'node.perf' category
67 tracing.disable(); // Disable trace event capture for the 'node.perf' category
71 in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool)
75 `${rotation}` is an incrementing log-rotation id. The filepath pattern can
76 be specified with `--trace-event-file-pattern` that accepts a template
80 node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js
85 However the trace-event timestamps are expressed in microseconds,
91 <!-- YAML
93 -->
96 <!-- YAML
98 -->
100 The `Tracing` object is used to enable or disable tracing for sets of
105 `tracing.enable()` method adds the categories to the set of enabled trace event
107 set of enabled trace event categories.
110 <!-- YAML
112 -->
116 A comma-separated list of the trace event categories covered by this
120 <!-- YAML
122 -->
126 Only trace event categories *not* covered by other enabled `Tracing` objects
127 and *not* specified by the `--trace-event-categories` flag will be disabled.
133 t1.enable();
134 t2.enable();
145 #### `tracing.enable()`
146 <!-- YAML
148 -->
154 <!-- YAML
156 -->
161 <!-- YAML
163 -->
166 * `categories` {string[]} An array of trace category names. Values included
177 tracing.enable();
183 <!-- YAML
185 -->
189 Returns a comma-separated list of all currently-enabled trace event
190 categories. The current set of enabled trace event categories is determined
191 by the *union* of all currently-enabled `Tracing` objects and any categories
192 enabled using the `--trace-event-categories` flag.
195 `node --trace-event-categories node.perf test.js` will print
204 t1.enable();
205 t2.enable();