Page MenuHomeFreeBSD

gcov support

Authored by mmacy on Feb 19 2019, 10:54 PM.



add gcov support and export results as files in debugfs

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

1 ↗(On Diff #54101)

Color me ignorant... is this code obtained from a GPL project by chance?

60 ↗(On Diff #54101)

Is this defined in libkern?

119 ↗(On Diff #54101)

I disagree with this assertion.

If someone is intentionally calling __gcov_flush, it means that they anticipate the coverage information to have been flushed out to disk.

In particular, if the kernel panics and this is treated as a no-op, the coverage data could be corrupted, rendering the data useless.

1 ↗(On Diff #54101)

It's tightly coupled with gcc internals. There's no way around it. And frankly it's not a useful concern as one would never ship a profiling kernel.

119 ↗(On Diff #54101)

The data isn't being written synchronously. It's being exported by way of pseudofs for the user to collect. If you care about not losing data, collect after every test. The coverage of a kernel test that panics would be lost when using anything other than battery backed RAM.

This is currently a direct port of what Linux does.

60 ↗(On Diff #54101)

No. It's copied from libc. Otherwise I wouldn't add a private copy.

Make sure you have a license header for all new files and $FreeBSD$

This revision is now accepted and ready to land.Feb 20 2019, 8:10 AM
This revision was automatically updated to reflect the committed changes.