V8 和 Node.js 提供了 trace_event 机制,但是因为稳定性原因,Node.js 目前没有支持用户自定义 trace event 能力,所以写了一个 addon 支持该能力(npm i v8_trace_event)。更多信息可以参考。
- https://github.com/nodejs/node/pull/42462
- https://nodejs.org/dist/latest-v18.x/docs/api/tracing.html
- https://zhuanlan.zhihu.com/p/463029094
- https://zhuanlan.zhihu.com/p/480072663