Skip to content
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

[v12.x backport] v8: implement v8.takeCoverage() and v8.stopCoverage() #36352

Merged
merged 2 commits into from
Mar 17, 2021

Commits on Mar 17, 2021

  1. v8: implement v8.takeCoverage()

    Add an v8.takeCoverage() API that allows the user to write the
    coverage started by NODE_V8_COVERAGE to disk on demand.
    The coverage can be written multiple times during the lifetime
    of the process, each time the execution counter will be reset.
    When the process is about to exit, one last coverage will
    still be written to disk.
    
    Also refactors the internal profiler connection code
    so that we use the inspector response id to identify
    the profile response instead of using an ad-hoc flag in C++.
    
    PR-URL: nodejs#33807
    Backport-PR-URL: nodejs#36352
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
    Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
    Reviewed-By: Ben Coe <bencoe@gmail.com>
    joyeecheung authored and richardlau committed Mar 17, 2021
    Configuration menu
    Copy the full SHA
    8ddea3f View commit details
    Browse the repository at this point in the history
  2. v8: implement v8.stopCoverage()

    Add a v8.stopCoverage() API to stop the coverage collection
    started by NODE_V8_COVERAGE - this would be useful in
    conjunction with v8.takeCoverage() if the user don't want
    to emit the coverage at the process exit but still want
    to collect it on demand at some point.
    
    PR-URL: nodejs#33807
    Backport-PR-URL: nodejs#36352
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
    Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
    Reviewed-By: Ben Coe <bencoe@gmail.com>
    joyeecheung authored and richardlau committed Mar 17, 2021
    Configuration menu
    Copy the full SHA
    86f34ee View commit details
    Browse the repository at this point in the history