Skip to content

Allow llvm-coverage to write file on webdriver exit#41141

Merged
jschwe merged 3 commits intoservo:mainfrom
Narfinger:coverage-test
Feb 4, 2026
Merged

Allow llvm-coverage to write file on webdriver exit#41141
jschwe merged 3 commits intoservo:mainfrom
Narfinger:coverage-test

Conversation

@Narfinger
Copy link
Copy Markdown
Contributor

@Narfinger Narfinger commented Dec 8, 2025

This adds a cfg to servo that uses the llvm profile-runtime function for writing the coverage file to disk.

When the webdriver shuts down we should make sure to write the llvm_coverage file. This is only required on platforms like android or ohos, where there is no real exiting of the process, so we need to manually dump the profile to disk.

See also https://clang.llvm.org/docs/SourceBasedCodeCoverage.html

Testing: Tested '/mach build -r --coverage && ./mach test-wpt -r --coverage' and there do not seem any parsing errors anymore.
Fixes: #40942

Signed-off-by: Narfinger <[email protected]>
@Narfinger Narfinger marked this pull request as ready for review January 5, 2026 13:04
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jan 5, 2026
Signed-off-by: Narfinger <[email protected]>
@Narfinger
Copy link
Copy Markdown
Contributor Author

@jschwe Should be ready now.

Signed-off-by: Narfinger <[email protected]>
@Narfinger Narfinger requested a review from jschwe January 16, 2026 12:14
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Feb 4, 2026
@jschwe jschwe added this pull request to the merge queue Feb 4, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Feb 4, 2026
Merged via the queue into servo:main with commit fd4198d Feb 4, 2026
30 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Feb 4, 2026
@Narfinger Narfinger deleted the coverage-test branch February 4, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

code coverage / pgo on android / ohos: Add manual profile write on "shutdown"

3 participants