Page MenuHomeFreeBSD

Extract the coverage sanitizer KPI to a new file.
ClosedPublic

Authored by andrew on Jan 25 2019, 4:47 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Aug 17, 2:06 AM
Unknown Object (File)
Fri, Aug 16, 6:17 AM
Unknown Object (File)
Mon, Aug 12, 6:29 PM
Unknown Object (File)
Thu, Aug 8, 2:53 AM
Unknown Object (File)
Wed, Aug 7, 8:12 AM
Unknown Object (File)
Wed, Aug 7, 6:17 AM
Unknown Object (File)
Mon, Jul 29, 1:28 PM
Unknown Object (File)
Jun 28 2024, 9:47 PM
Subscribers

Details

Summary

This will allow multiple consumers of the coverage data to be compiled
into the kernel together. The only requirement is only one can be
registered at a given point in time, however it is expected they will
only register when the coverage data is needed.

A new kernel conflig option COVERAGE is added. This will allow kcov to
become a module that can be loaded as needed, or compiled into the
kernel.

While here clean up the #include style a little.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/amd64/conf/GENERIC
104–106 ↗(On Diff #53199)

OK for review/test but if the default changes it should be a separate commit

sys/conf/kern.pre.mk
116 ↗(On Diff #53199)

If modules are built as part of the 'make kernel', could you do this evaluation once and pass the result down to modules makes with a var ? You add several hundreds of fork/execs to each build.

sys/kern/kern_kcov.c
337 ↗(On Diff #53199)

This does not work.

Without D_TRACKCLOSE cdevsw flags, d_close() is only called on very last close. With D_TRACKCLOSE, d_close() calls are not synced with d_open's and can get out of sync. Also, reclaim of the device vnode causes even more unfortunate effects on d_close() mis-pairing with d_open().

546 ↗(On Diff #53199)

The var is static, there is no need to reinitialize it.

Update the kcov tracking to be based on the number of threads actively
being traced.

Remove a D_TRACKCLOSE that sneaked in

This revision is now accepted and ready to land.Jan 28 2019, 7:28 PM
This revision was automatically updated to reflect the committed changes.