{
  "source": "doc/api/tracing.md",
  "modules": [
    {
      "textRaw": "Tracing",
      "name": "tracing",
      "introduced_in": "v7.7.0",
      "desc": "<p>Trace Event provides a mechanism to centralize tracing information generated by\nV8, Node.js core, and userspace code.</p>\n<p>Tracing can be enabled by passing the <code>--trace-events-enabled</code> flag when\nstarting a Node.js application.</p>\n<p>The set of categories for which traces are recorded can be specified using the\n<code>--trace-event-categories</code> flag followed by a list of comma separated category\nnames.</p>\n<p>The available categories are:</p>\n<ul>\n<li><code>node</code></li>\n<li><code>node.async_hooks</code> - Enables capture of detailed async_hooks trace data.</li>\n<li><code>node.bootstrap</code> - Enables capture of Node.js bootstrap milestones.</li>\n<li><code>node.perf</code> - Enables capture of <a href=\"perf_hooks.html\">Performance API</a> measurements.<ul>\n<li><code>node.perf.usertiming</code> - Enables capture of only Performance API User Timing\nmeasures and marks.</li>\n<li><code>node.perf.timerify</code> - Enables capture of only Performance API timerify\nmeasurements.</li>\n</ul>\n</li>\n<li><code>v8</code></li>\n</ul>\n<p>By default the <code>node</code>, <code>node.async_hooks</code>, and <code>v8</code> categories are enabled.</p>\n<pre><code class=\"lang-txt\">node --trace-events-enabled --trace-event-categories v8,node,node.async_hooks server.js\n</code></pre>\n<p>Running Node.js with tracing enabled will produce log files that can be opened\nin the <a href=\"https://www.chromium.org/developers/how-tos/trace-event-profiling-tool\"><code>chrome://tracing</code></a>\ntab of Chrome.</p>\n<p>The logging file is by default called <code>node_trace.${rotation}.log</code>, where\n<code>${rotation}</code> is an incrementing log-rotation id. The filepath pattern can\nbe specified with <code>--trace-event-file-pattern</code> that accepts a template\nstring that supports <code>${rotation}</code> and <code>${pid}</code>. For example:</p>\n<pre><code class=\"lang-txt\">node --trace-events-enabled --trace-event-file-pattern &#39;${pid}-${rotation}.log&#39; server.js\n</code></pre>\n<p>Starting with Node.js 10.0.0, the tracing system uses the same time source\nas the one used by <code>process.hrtime()</code>\nhowever the trace-event timestamps are expressed in microseconds,\nunlike <code>process.hrtime()</code> which returns nanoseconds.</p>\n",
      "type": "module",
      "displayName": "Tracing"
    }
  ]
}
