feat(wasm): support tracing-chrome in wasm#10246
Conversation
✅ Deploy Preview for rspack canceled.
|
CodSpeed Performance ReportMerging #10246 will not alter performanceComparing Summary
|
I'm confused of what kind of problem you're resolving. What is wasm tracing cleanup related to? Does it mean that cleanup function should be invoked before workers are destroyed? EDIT: I checked out the |
I think so. Just now I realize that |
c97564e to
8258e44
Compare
|
Thanks! |
Summary
Debugging wasm is very painful. So I hope this pr could help us find where the wasm crushes or get stuck. There are two things to do:
tracing-chromesend the writer to a isolated thread to write the traces. However, threads in wasm are actually node workers. They can't share file descriptors with each other Passing fd between threads causes VM to crash, or EBADF nodejs/node#30507. The solution is passing a writer creator instead of a writer when building chrome tracer.cleanupfunction is called byexit-hookand sends an flush message to the tracing thread. This meanscleanupfunction is called when there's no active handlers (workers) running, which means the chrome tracing thread is not running. So we may choose another way to callcleanup. @hardfist @h-a-n-a Do you have any suggestion?This pr can be holding on until there is a good solution.
Checklist