Re: Having problems generating a code coverage report

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Aleksander Alekseev <aleksander(at)timescale(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Having problems generating a code coverage report
Date: 2025-01-16 00:51:39
Message-ID: CAH2-Wz=bc9VdC5yxXnLcTm6CVsoNH1Qxd_JgcFbCPRGqAdY_Ag@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 15, 2025 at 4:44 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> With this, I got plausible-looking html output (I didn't vet it
> in detail, but a couple of spot checks looked sane).
>
> I'm curious whether a similar workaround will help with the
> Debian toolchain.

Looks like it will.

I was able to get the lcov git master branch's tip to produce a
Postgres coverage report (same compiler version and OS as before).
Unfortunately, I had to use an even grottier incantation to get this
to work:

make -s coverage-html GENHTML_FLAGS="-q --legend --ignore-errors
unmapped,unmapped,empty,empty,inconsistent,inconsistent,corrupt,corrupt,range,range"
LCOVFLAGS="--ignore-errors
empty,empty,negative,negative,inconsistent,inconsistent"

(As you can imagine, I came up with this through pure trial and error.)

The final report seems fine, though -- at least on a quick look. The
number of times that we actually relied on the suppressions seems to
have been fairly limited, in the end:

Message summary:
11 ignore messages:
empty: 1
inconsistent: 3
negative: 7
Overall coverage rate:
source files: 1527
lines.......: 78.7% (396815 of 504471 lines)
functions...: 86.3% (23710 of 27474 functions)

Note also: I had to install gcov to /usr/local this time. I couldn't
get away with installing it to my home directory (something about Perl
not being able to see lcovutil.pm in @INC).

--
Peter Geoghegan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-01-16 00:55:10 Re: per backend I/O statistics
Previous Message Peter Smith 2025-01-16 00:43:28 Re: Skip collecting decoded changes of already-aborted transactions