-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src: trace threadpool event #44458
src: trace threadpool event #44458
Conversation
6f35dbf
to
245ef10
Compare
b87e591
to
39bd5b5
Compare
39bd5b5
to
39f400b
Compare
39f400b
to
ef94baa
Compare
40c49ab
to
672d9ad
Compare
e077266
to
24d32ce
Compare
@legendecas @RaisinTen Hi, can we just trace the total time of work. the code is as follows.
Or trace all the time by two different event type.
|
I'd still find that tracing the synchronous event is important. So the latter alternative is LGTM. |
1703fd4
to
05cbb9c
Compare
It seems we can not use |
a8b5f8f
to
b1128a1
Compare
@legendecas Hi, it seems the |
b1128a1
to
1f402fc
Compare
@theanarkh The macros are declared to be thread-safe. If there is any problem related to thread safety, it should be fixed. I'd find the problem here is related to the incomplete shutdown -- e.g. the global state of the tracing controller is not reset after the platform is shut down https://github.com/nodejs/node/blob/main/src/tracing/trace_event.cc#L8. This global state is used in the macro expansion: https://github.com/nodejs/node/blob/main/src/tracing/trace_event.h#L474. We should properly shut down the platform with the tracing global state. |
Do you mean this test case |
@theanarkh yeah, IIUC that test case is exactly testing a premature exit while the async work is still in progress. |
Landed in 8fb282e |
When the process exits, there may be tasks in the thread pool that need to access data in the platform, such as trace agent. So make sure the thread pool exits first. see #44458 PR-URL: #45226 Refs: #44458 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
PR-URL: #44458 Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
PR-URL: nodejs#44458 Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
When the process exits, there may be tasks in the thread pool that need to access data in the platform, such as trace agent. So make sure the thread pool exits first. see #44458 PR-URL: #45226 Refs: #44458 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
PR-URL: #44458 Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
PR-URL: nodejs#45266 Refs: nodejs#45092 Refs: nodejs#44458 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
When the process exits, there may be tasks in the thread pool that need to access data in the platform, such as trace agent. So make sure the thread pool exits first. see #44458 PR-URL: #45226 Refs: #44458 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
PR-URL: #44458 Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
When the process exits, there may be tasks in the thread pool that need to access data in the platform, such as trace agent. So make sure the thread pool exits first. see #44458 PR-URL: #45226 Refs: #44458 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
PR-URL: #44458 Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
When the process exits, there may be tasks in the thread pool that need to access data in the platform, such as trace agent. So make sure the thread pool exits first. see #44458 PR-URL: #45226 Refs: #44458 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
PR-URL: #44458 Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
trace threadpool events, such as APIs of
Blob
,zlib
,crypto
andnode_api
.make -j4 test
(UNIX), orvcbuild test
(Windows) passes