gcov coverage data not full with immediate stop - Mailing list pgsql-hackers

From Alexander Lakhin
Subject gcov coverage data not full with immediate stop
Date
Msg-id 816a4de5-3f15-4d66-1ec1-791cab2ca6df@gmail.com
Whole thread Raw
Responses Re: gcov coverage data not full with immediate stop
List pgsql-hackers
Hello hackers,

I've found that gcov coverage data miss some information when a postgres
node stopped in 'immediate' mode.
For example, on the master branch:
make coverage-clean; time make check -C src/test/recovery/; make
coverage-html
generates a coverage report with 106193 lines/6318 functions for me
(`make check` takes 1m34s).
But with the attached simple patch I get a coverage report with 106540
lines/6332 functions (and `make check` takes 2m5s).
(IMO, the slowdown of the test is significant.)

So if we want to make the coverage reports more precise, I see the three
ways:
1. Change the stop mode in teardown_node to fast (probably only when
configured with --enable-coverage);
2. Explicitly stop nodes in TAP tests (where it's important) -- seems
too tedious and troublesome;
3. Explicitly call __gcov_flush in SIGQUIT handler (quickdie)?

Best regards,
Alexander

Attachment

pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: should INSERT SELECT use a BulkInsertState?
Next
From: Dmitry Dolgov
Date:
Subject: Re: Index Skip Scan