Re: LLVM "continuous" coverage profiling hack^Wpatch

From: Enji Cooper (yaneurabeya) <yaneurabeya_at_gmail.com>
Date: Mon, 19 Oct 2026 03:29:13 UTC
> On Oct 12, 2026, at 12:45 PM, Poul-Henning Kamp <phk@phk.freebsd.dk> wrote:
> 
> --------
> Adrian Chadd writes:
> 
>> On Mon, 12 Oct 2026 at 12:16, Poul-Henning Kamp <phk@phk.freebsd.dk> wrote:
>> 
>>> INTRO:
>>> ======
>>> 
>>>   Coverage profiling is where the compiler adds counters in the code so
>>>   one can tell which bits got executed how many times.
>>> 
>>> 
>>> 
>> oh this is neat! I wonder how we should run this up the flagpole at LLVM
>> land?
> 
> By all means!
> 
> Maybe point out to them that the mmap(2) would work on any OS with
> a working mmap(2) ?

I’m a bit puzzled how this is different from the already documented/implemented --coverage option in compiler_rt, when combined with gcov and lcov. compiler_rt support has been working for almost a decade now on FreeBSD — it’s just not integrated into the build. I tried doing it back in 2017 and ran into brick walls around generated objects, naming schemes, etc. I could dig up the work if requested.
Thanks,
-Enji