You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I create a data collector on Windows for the NodeJS-ETW-provider and run my program under NodeJS, the only ETW events I see are for NODE_GC_START and NODE_GC_DONE. I was hoping to use ETW to profile my program on Windows, but it doesn't provide any information as to the functions executed, as might be the case when using dtrace.
Am I missing something, or is there something missing in NodeJS to get this to work? ETW events have been in NodeJS since 2012, so I'm not certain what could be wrong here.
I think I figured out what's wrong here. I am attempting to profile a console application running in node. When node initializes ETW, it sets up a callback to be executed via uv_async_send in a later turn. Unfortunately, node never gives that callback a chance to execute before it proceeds to loading and executing the main module, so the process exits before the callback can ever be fired.
I added a call to etw_events_change_async(NULL); immediately after the call to event_register in init_etw and saw the events I was looking for.
@rbuckton Any idea if this is still an issue on current Node.js 6.2.1? If so, any chance you might submit your fix as a patch (assuming you believe it is an appropriate solution to the problem)?
@nodejs/platform-windows Looking at the code, I suspect this is still an issue. If I had to venture a guess, it's that init_etw() should call v8::Isolate:SetJitCodeEventHandler(v8::kJitCodeEventEnumExisting).
Activity
rvagg commentedon Oct 30, 2015
/cc @nodejs/platform-windows
rbuckton commentedon Nov 3, 2015
I think I figured out what's wrong here. I am attempting to profile a console application running in node. When node initializes ETW, it sets up a callback to be executed via
uv_async_sendin a later turn. Unfortunately, node never gives that callback a chance to execute before it proceeds to loading and executing the main module, so the process exits before the callback can ever be fired.I added a call to
etw_events_change_async(NULL);immediately after the call toevent_registerininit_etwand saw the events I was looking for.Trott commentedon Jun 5, 2016
@rbuckton Any idea if this is still an issue on current Node.js 6.2.1? If so, any chance you might submit your fix as a patch (assuming you believe it is an appropriate solution to the problem)?
bnoordhuis commentedon Feb 7, 2017
@nodejs/platform-windows Looking at the code, I suspect this is still an issue. If I had to venture a guess, it's that init_etw() should call
v8::Isolate:SetJitCodeEventHandler(v8::kJitCodeEventEnumExisting).Trott commentedon Jul 16, 2017
/ping @nodejs/platform-windows Anyone want to take this up? If not, shall we add a
help wantedlabel?jasnell commentedon Jun 19, 2020
There's been zero activity on this in a couple years. It's not likely to see activity. Closing
benjamingr commentedon Jun 21, 2020
@rbuckton just making it explicit that if this is something you are still interested in pursuing and is still an issue a PR is welcome.