-
Notifications
You must be signed in to change notification settings - Fork 30k
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: refactor coverage connection #26513
Conversation
"Sending Profiler.startPreciseCoverage\n"); | ||
Isolate* isolate = this->env()->isolate(); | ||
Local<String> enable = FIXED_ONE_BYTE_STRING( | ||
isolate, "{\"id\": 1, \"method\": \"Profiler.enable\"}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use raw string here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks reasonable to me 👍 It's nice to be able to remove the confusing disableAllAsyncHooks
methods.
Let's just make sure we run the coverage CI against this before we land? @mhdawson how far did we get on making this run as part of the smoke testing process?
- Refactor the C++ class to be resuable for other types of profiles - Move the try-catch block around coverage collection callback to be inside the callback to silence potential JSON or write errors. - Use Function::Call instead of MakeCallback to call the coverage message callback since it does not actually need async hook handling. This way we no longer needs to disable the async hooks when writing the coverage results. - Renames `lib/internal/coverage-gen/with_profiler.js` to `lib/internal/profiler.js` because it is now the only way to generate coverage.
92ffa3b
to
a709987
Compare
Rebased and addressed reviews. CI: https://ci.nodejs.org/job/node-test-pull-request/21434/ @gengjiawen Regarding raw strings: I have no idea why but it looks like neither we nor non-test V8 code use those, so I'd prefer leaving that out of this PR, in case there's any weird compiler support oddities. Feel free to open a separate PR to update those. |
Landed in 963ee0b...eb0bf8d |
- Refactor the C++ class to be resuable for other types of profiles - Move the try-catch block around coverage collection callback to be inside the callback to silence potential JSON or write errors. - Use Function::Call instead of MakeCallback to call the coverage message callback since it does not actually need async hook handling. This way we no longer needs to disable the async hooks when writing the coverage results. - Renames `lib/internal/coverage-gen/with_profiler.js` to `lib/internal/profiler.js` because it is now the only way to generate coverage. PR-URL: #26513 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Coe <bencoe@gmail.com>
PR-URL: #26513 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Coe <bencoe@gmail.com>
This does not land cleanly on v11. It seems to rely on other commits that should be backported first. Please open a manual backport for it or change the labels accordingly. |
- Refactor the C++ class to be resuable for other types of profiles - Move the try-catch block around coverage collection callback to be inside the callback to silence potential JSON or write errors. - Use Function::Call instead of MakeCallback to call the coverage message callback since it does not actually need async hook handling. This way we no longer needs to disable the async hooks when writing the coverage results. - Renames `lib/internal/coverage-gen/with_profiler.js` to `lib/internal/profiler.js` because it is now the only way to generate coverage. PR-URL: #26513 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Coe <bencoe@gmail.com>
PR-URL: #26513 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Coe <bencoe@gmail.com>
- Refactor the C++ class to be resuable for other types of profiles - Move the try-catch block around coverage collection callback to be inside the callback to silence potential JSON or write errors. - Use Function::Call instead of MakeCallback to call the coverage message callback since it does not actually need async hook handling. This way we no longer needs to disable the async hooks when writing the coverage results. - Renames `lib/internal/coverage-gen/with_profiler.js` to `lib/internal/profiler.js` because it is now the only way to generate coverage. PR-URL: #26513 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Coe <bencoe@gmail.com>
PR-URL: #26513 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Coe <bencoe@gmail.com>
src: refactor coverage connection
to be inside the callback to silence potential JSON or write
errors.
message callback since it does not actually need async hook
handling. This way we no longer needs to disable the async
hooks when writing the coverage results.
lib/internal/coverage-gen/with_profiler.js
tolib/internal/profiler.js
because it is now the only wayto generate coverage.
test: show stderr on v8 coverage test failures
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes