Skip to content

src: report idle time correctly

With this change, the V8 profiler will attribute any time between prepare and check cycles, except any entrances to InternalCallbackScope, to be "idle" time. All callbacks, microtasks, and timers will be marked as not idle. The one exception is native modules which don't use the MakeCallback helper, but those are already broken anyway for async context tracking so we should just encourage broken modules to be fixed.

This functionality previously existed, but was removed in #34010 due to not correctly attributing callbacks in the I/O phase of the event loop. This change restores that code and with some additional changes to InternalCallbackScope to correctly report idle status during callback scopes. Also relevant is #33138.

cc @nodejs/diagnostics

Merge request reports

Loading