From phk at phk.freebsd.dk Tue Oct 13 10:06:36 2026 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Tue, 13 Oct 2026 10:06:36 +0000 Subject: GCOV take 2 preview Message-ID: <6ace02ac.28cee.63794a9d@critter.freebsd.dk> I gave up fixing our current code-coverage setup: Too much have shifted under our feet since that was written. Instead I started over with LLVM's coverage support, and I now have the first preliminary output: https://phk.freebsd.dk/misc/gcov2/ The Vtest2 and Vmod numbers look suspiciously low, but dont panic that, until I have had a chance to make sure everything is counted. LLVM's coverage support counts differently than GCC's coverage support, so the numbers have shifted and changed in and between files, but I trust both to basically get it right - just differently. Sparklines are still TBD. When I see what the jump looks like, I may decide to restart the sparkline history. The bad news is that I need LLVM patches to run this. Somebody hacked "continuous coverage" into LLVM, which is just a strange way to say the counters are mmap(2)'ed so they also saved when processes die in interesting ways. That is only supported on Apple, because it depends on a a weird linker option only they have, and to be honest, because whoever did it, didn't give shit about anybody else. I managed to come up with a small, and circumstances considered, quite elegant patch for FreeBSD[1], but I have no idea if that will ever be upstreamed to FreeBSD, much less LLVM. So to run the "new" gcov, I need a jail or VM with a patched FreeBSD source tree, which is a bit of a bother. Poul-Henning [1] See: https://lists.freebsd.org/archives/freebsd-current/2026-October/010937.html The patch almost certainly also works in Linux, but it may be necessary to get rid of a lot of Linux specific code in that area first. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From phk at phk.freebsd.dk Wed Oct 14 09:16:58 2026 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Wed, 14 Oct 2026 09:16:58 +0000 Subject: GCOV take 2 preview Message-ID: <6acf488a.28cad.4b728ce6@critter.freebsd.dk> Poul-Henning Kamp writes: > I gave up fixing our current code-coverage setup: Too much have > shifted under our feet since that was written. > > Instead I started over with LLVM's coverage support, and I now > have the first preliminary output: > > https://phk.freebsd.dk/misc/gcov2/ Now also with: * sparklines * all executables counted Still missing: * Coverage without root-privs (ie: no jailing) * Whatever else is still missing * Distill the history file (currently 450MB+) -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.