node
node copied to clipboard
src: collect sync api call stack
Adds an option to support writing call stack of sync api to file. The format is as follows.
a -> b -> c
d -> e -> f
- [x]
make -j4 test
(UNIX), orvcbuild test
(Windows) passes - [x] tests and/or benchmarks are included
- [x] documentation is changed or added
- [x] commit message follows commit guidelines
@legendecas Hi, can you help review this PR ? Thanks !
I'm confused by the file format. Would you mind elaborating on the reasoning why we need a dedicated file for this instead of inspecting the conventional stack trace output to stout/stderr?
I think if the call stack information is output to stdout / stderr.
- it will be mixed with other information and not easy to see because there may be a lot of other log output.
- it can not be collected and analyzed.
If this PR is ok, I plan to submit another PR that we can control the flag at runtime.
As for the file format, currently a synchronous API call corresponds to one line in the file, and each line is separated by ->
which is easier to parse.
I think if the call stack information is output to stdout / stderr.
- it will be mixed with other information and not easy to see because there may be a lot of other log output.
- it can not be collected and analyzed.
In this case, I'd find that it can be more extensible if we can emit diagnostic events in the case, e.g., through diagnostic channels. This allows userland modules to monitor the sync calls and output with arbitrary formats of stack traces.