glibc build with gcov support

Carlos O'Donell carlos@redhat.com
Tue Nov 19 20:25:00 GMT 2013


On 11/19/2013 03:55 AM, Tatiana Udalova wrote:
> I wanna check Glibc test coverage to be able to find untested functions.
> 
> As far as I understand oprofile isn't suitable for it:
> It'll give me information about running code only.

It is currently not possible to build glibc with coverage support.
The circular dependencies from the code coverage system to the C 
library make it impossible to compile glibc.

I would be happy to review patches to add support for building
glibc with code coverage (gcov support), but it would take some
effort to implement and is not a small weekend project.

The alternative as Ondrej suggests is to use oprofile. Using
oprofile is suitable for coverage measurement of glibc.

Your statement "It'll give me information about running code only"
is true for all coverage testing, both gcov and oprofile require
you run code in order to get coverage data. There is no other way
to determine if a code path is taken without running code and
analysing the resulting data (except for static analysis).

So you have two options:
* Implement gcov support for glibc.
* Use oprofile.

If you use oprofile I would be interested in seeing a published
report of how you used it and what kind of coverage you had?

I'm sure the community would be interested in maintaining
oprofile scripts to get coverage data on the project e.g. 
Use oprofile in conjunction with the entire testsuite run
to gather coverage information.

Keep us updated.

Cheers,
Carlos.



More information about the Libc-help mailing list