• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

xd009642 / llvm-profparser / #248
74%

Build:
DEFAULT BRANCH: master
Ran 07 Oct 2026 09:07PM UTC
Jobs 1
Files 14
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

07 Oct 2026 09:03PM UTC coverage: 73.978% (+0.5%) from 73.507%
#248

push

web-flow
Use compiled function names to track coverage (#85)

* Use compiled function names to track coverage

When a macro is used to generate implementations of the same function for different types LLVM generates separate counters for different implementations. For example, in Rust standard library's `core/src/num` a macro `uint_impl!` is used for generating versions of `abs_diff` function for `u8`, `u16`, etc. When the tests run for one of the types, say, `u8`, the counters for a corresponding compiled function `abs_diff` get updated.

However, since `llvm_profparser::CoverageResult` tracked coverage by source line-column it does not disambiguate counters for different versions of the same function. When aggregating counters for a specific line or line fragment if an unrelated version of the function was not covered we would get 0 in one of the counters.

Also, while the source for all these versions is the same, when compiling LLVM can use different transformations for different paths. The resulting shape of functions can be different, and the borders of coverage regions don't always match.

To disambiguate counters correctly we need to track coverage over compiled versions of functions. I use their mangled names for them, referred as `linkage_name` in code. This gets slightly complicated because the mangled names of functions have randomized segments that get different values between compilation runs. When a tests binary is compiled, Cargo can decide to reuse a version of binary-under-test from a previous compilation run. If we run `cargo build` followed by `cargo test` the later will reuse the results of the former. Unfortunately, metadata in prof files will have both versions of a mangle name present. For that reason I clean up random segments from mangled names to unify counters.

*Technically*, a truly generic function may not have exact implementations and monomorphized versions. In that case I keep the value for `linkage_name` as empty string. And ... (continued)

40 of 44 new or added lines in 2 files covered. (90.91%)

1194 of 1614 relevant lines covered (73.98%)

2097.28 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
77.87
0.38% src/coverage/coverage_mapping.rs
Jobs
ID Job ID Ran Files Coverage
1 #248.1 07 Oct 2026 09:07PM UTC 14
73.98
Source Files on build #248
  • Tree
  • List 14
  • Changed 6
  • Source Changed 5
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 6889d9bd on github
  • Prev Build on master
  • Next Build on master
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc