• Returns: {string}

    Returns a comma-separated list of all currently-enabled trace event categories. The current set of enabled trace event categories is determined by the union of all currently-enabled Tracing objects and any categories enabled using the --trace-event-categories flag.

    Given the file test.js below, the command node --trace-event-categories node.perf test.js will print 'node.async_hooks,node.perf' to the console.

    1. const trace_events = require('trace_events');
    2. const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] });
    3. const t2 = trace_events.createTracing({ categories: ['node.perf'] });
    4. const t3 = trace_events.createTracing({ categories: ['v8'] });
    5. t1.enable();
    6. t2.enable();
    7. console.log(trace_events.getEnabledCategories());