Add support for "--enable-code-coverage" option

This change adds support for a new option that can be passed to the
configure script: "--enable-code-coverage". Further, the "--enable-gcov"
option has been removed, as this new option provides the same
functionality (plus more).

When using this new option the following make targets are available:

 * check-code-coverage
 * code-coverage-capture
 * code-coverage-clean

Note: these make targets can only be run from the root of the project.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Prakash Surya <prakash.surya@delphix.com>
Closes #6670
This commit is contained in:
Prakash Surya
2017-09-22 18:49:57 -07:00
committed by Brian Behlendorf
parent d410c6d9fd
commit acf044420b
5 changed files with 269 additions and 32 deletions
-31
View File
@@ -76,37 +76,6 @@ AC_DEFUN([ZFS_AC_DEBUGINFO], [
AC_MSG_RESULT([$enable_debuginfo])
])
AC_DEFUN([ZFS_AC_GCOV_KERNEL], [
])
AC_DEFUN([ZFS_AC_GCOV_USER], [
DEBUG_CFLAGS="$DEBUG_CFLAGS -fprofile-arcs -ftest-coverage"
])
AC_DEFUN([ZFS_AC_GCOV], [
AC_MSG_CHECKING([whether gcov profiling will be enabled])
AC_ARG_ENABLE([gcov],
[AS_HELP_STRING([--enable-gcov],
[Enable gcov profiling @<:@default=no@:>@])],
[],
[enable_gcov=no])
AS_CASE(["x$enable_gcov"],
["xyes"],
[ZFS_AC_GCOV_KERNEL
ZFS_AC_GCOV_USER],
["xkernel"],
[ZFS_AC_GCOV_KERNEL],
["xuser"],
[ZFS_AC_GCOV_USER],
["xno"],
[],
[AC_MSG_ERROR([Unknown option $enable_gcov])])
AC_SUBST(DEBUG_CFLAGS)
AC_MSG_RESULT([$enable_gcov])
])
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
ZFS_AC_CONFIG_ALWAYS_NO_UNUSED_BUT_SET_VARIABLE
ZFS_AC_CONFIG_ALWAYS_NO_BOOL_COMPARE