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
V8 allows to take precise coverage via the Chrome DevTools Protocol, but for some reason unknown to me, workerd prevents the standard CPU profiler to work, intercepting calls to Profiler.enable, Profiler.start and Profiler.stop.
Started digging, and from the V8 sources I saw that Profile.startPreciseCoverage is tied behind a flag (m_enabled) here.
Digging through the sources, I noticed that workerd intercepts most of the Profiler calls here.
I tried a simple patch (inspired by @jasnell's #329) to restore the full Profile set of calls, and, to my amazement, it worked perfectly and was able to capture the full precise coverage.
Not knowing the rationale behind intercepting these calls, I'm unsure as to whether to create a PR, but all tests are passing, and having code coverage in tests is fantastic.
(For the records, I'm the author of a tool that analyzes code coverage from V8, so, obviously, I'm biased and would love to have this working)
Attached is a simple patch to showcase the feature: profile.patch
The text was updated successfully, but these errors were encountered:
V8 allows to take precise coverage via the Chrome DevTools Protocol, but for some reason unknown to me,
workerd
prevents the standard CPU profiler to work, intercepting calls toProfiler.enable
,Profiler.start
andProfiler.stop
.Started digging, and from the V8 sources I saw that
Profile.startPreciseCoverage
is tied behind a flag (m_enabled
) here.Digging through the sources, I noticed that
workerd
intercepts most of theProfiler
calls here.I tried a simple patch (inspired by @jasnell's #329) to restore the full
Profile
set of calls, and, to my amazement, it worked perfectly and was able to capture the full precise coverage.Not knowing the rationale behind intercepting these calls, I'm unsure as to whether to create a PR, but all tests are passing, and having code coverage in tests is fantastic.
(For the records, I'm the author of a tool that analyzes code coverage from V8, so, obviously, I'm biased and would love to have this working)
Attached is a simple patch to showcase the feature: profile.patch
The text was updated successfully, but these errors were encountered: