Skip to content

src: add tracing category macros

Adds TRACING_CATEGORY_NODE, TRACING_CATEGORY_NODE1 and TRACING_CATEGORY_NODE2 helper macros for consistently building trace event category strings. For instance,

TRACING_CATEGORY_NODE2(foo, bar) would generate the category string node,node.foo,node.foo.bar, such that...

TRACE_EVENT_NESTABLE_ASYNC_BEGIN0(
    TRACING_CATEGORY_NODE2(foo, bar),
    "baz", 1);

Would emit if trace events are enabled for categories: node, node.foo, or node.foo.bar.

This allows a natural scoping down of what trace events a user may want to receive. Enabling the node category would receive everything Node.js produces.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading