diff options
author | Brian Behlendorf <[email protected]> | 2017-09-15 10:24:13 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2017-09-15 10:24:13 -0700 |
commit | d9ec8b9b2a3880a1a2b68e57a25833486c3b164d (patch) | |
tree | 5378af5ce8db5338fe9432eab8e485408001525b | |
parent | 0107f69898e3b6d39d974b272da1739cb2f39027 (diff) |
Add configure option to enable gcov analysis
* Add configure option to enable gcov analysis.
* Includes a few minor ctime fixes.
* Add codecov.yml configuration.
Reviewed-by: Prakash Surya <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #6642
-rw-r--r-- | .github/codecov.yml | 9 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile.am | 3 | ||||
-rw-r--r-- | config/zfs-build.m4 | 31 | ||||
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | tests/zfs-tests/tests/functional/ctime/.gitignore | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | tests/zfs-tests/tests/functional/ctime/ctime_001_pos.ksh | 0 |
7 files changed, 46 insertions, 2 deletions
diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 000000000..f36be39cb --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,9 @@ +codecov: + strict_yaml_branch: master # only use the latest copy on master branch + +comment: off + +coverage: + status: + project: off + patch: off diff --git a/.gitignore b/.gitignore index 29437b58c..bfce0902f 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,8 @@ *.mod.c *~ *.swp +*.gcno +*.gcda .deps .libs .dirstamp diff --git a/Makefile.am b/Makefile.am index e6e19d6a2..ed753c81a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,7 +31,8 @@ distclean-local:: -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ -o -name '.*.rej' -o -size 0 -o -name '*%' -o -name '.*.cmd' \ -o -name 'core' -o -name 'Makefile' -o -name 'Module.symvers' \ - -o -name '*.order' -o -name '*.markers' \) \ + -o -name '*.order' -o -name '*.markers' -o -name '*.gcda' \ + -o -name '*.gcno' \) \ -type f -print | xargs $(RM) dist-hook: diff --git a/config/zfs-build.m4 b/config/zfs-build.m4 index a8609b829..b84658a64 100644 --- a/config/zfs-build.m4 +++ b/config/zfs-build.m4 @@ -75,6 +75,37 @@ 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 diff --git a/configure.ac b/configure.ac index 0e7686fab..ae03d1bf7 100644 --- a/configure.ac +++ b/configure.ac @@ -56,6 +56,7 @@ ZFS_AC_PACKAGE ZFS_AC_CONFIG ZFS_AC_DEBUG ZFS_AC_DEBUGINFO +ZFS_AC_GCOV AC_CONFIG_FILES([ Makefile diff --git a/tests/zfs-tests/tests/functional/ctime/.gitignore b/tests/zfs-tests/tests/functional/ctime/.gitignore index ead826c04..9e4539d5f 100644 --- a/tests/zfs-tests/tests/functional/ctime/.gitignore +++ b/tests/zfs-tests/tests/functional/ctime/.gitignore @@ -1 +1 @@ -/ctime_001_pos +/ctime diff --git a/tests/zfs-tests/tests/functional/ctime/ctime_001_pos.ksh b/tests/zfs-tests/tests/functional/ctime/ctime_001_pos.ksh index de12efe46..de12efe46 100644..100755 --- a/tests/zfs-tests/tests/functional/ctime/ctime_001_pos.ksh +++ b/tests/zfs-tests/tests/functional/ctime/ctime_001_pos.ksh |