diff options
author | James M Snell <jasnell@gmail.com> | 2018-03-05 14:46:19 -0800 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2018-03-09 08:09:41 -0800 |
commit | 1dd9c9787bcf08db022ee63ce633fc9d497720e6 (patch) | |
tree | a10c638dfd43b2ef784cc8431ecd68a58c3aeb1e /test/parallel/test-trace-events-async-hooks.js | |
parent | 45277e23d5488dc11d705b850d310b4afb5085bb (diff) | |
download | android-node-v8-1dd9c9787bcf08db022ee63ce633fc9d497720e6.tar.gz android-node-v8-1dd9c9787bcf08db022ee63ce633fc9d497720e6.tar.bz2 android-node-v8-1dd9c9787bcf08db022ee63ce633fc9d497720e6.zip |
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.
PR-URL: https://github.com/nodejs/node/pull/19155
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
Diffstat (limited to 'test/parallel/test-trace-events-async-hooks.js')
-rw-r--r-- | test/parallel/test-trace-events-async-hooks.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/parallel/test-trace-events-async-hooks.js b/test/parallel/test-trace-events-async-hooks.js index b15d83b07a..7fb11223c3 100644 --- a/test/parallel/test-trace-events-async-hooks.js +++ b/test/parallel/test-trace-events-async-hooks.js @@ -37,7 +37,7 @@ proc.once('exit', common.mustCall(() => { assert(traces.some((trace) => { if (trace.pid !== proc.pid) return false; - if (trace.cat !== 'node.async_hooks') + if (trace.cat !== 'node,node.async_hooks') return false; if (trace.name !== 'TIMERWRAP') return false; @@ -48,7 +48,7 @@ proc.once('exit', common.mustCall(() => { assert(traces.some((trace) => { if (trace.pid !== proc.pid) return false; - if (trace.cat !== 'node.async_hooks') + if (trace.cat !== 'node,node.async_hooks') return false; if (trace.name !== 'Timeout') return false; |