]> granicus.if.org Git - zfs/commitdiff
Add configure option to enable gcov analysis
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 15 Sep 2017 17:24:13 +0000 (10:24 -0700)
committerTony Hutter <hutter2@llnl.gov>
Wed, 14 Mar 2018 23:10:36 +0000 (16:10 -0700)
* Add configure option to enable gcov analysis.
* Includes a few minor ctime fixes.
* Add codecov.yml configuration.

Reviewed-by: Prakash Surya <prakash.surya@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6642

.github/codecov.yml [new file with mode: 0644]
.gitignore
Makefile.am
config/zfs-build.m4
configure.ac
tests/zfs-tests/tests/functional/ctime/.gitignore
tests/zfs-tests/tests/functional/ctime/ctime_001_pos.ksh [changed mode: 0644->0755]

diff --git a/.github/codecov.yml b/.github/codecov.yml
new file mode 100644 (file)
index 0000000..f36be39
--- /dev/null
@@ -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
index 318a4343414d21461e8d3dbbf30ce7528f75b2b8..e664bdd67bfa972c42d9af2254d29f6c88cfd229 100644 (file)
@@ -19,6 +19,8 @@
 *.mod.c
 *~
 *.swp
+*.gcno
+*.gcda
 .deps
 .libs
 .dirstamp
index 508d3f40e87693f38e14b68703c995d8c130f6ba..732a373bd6864f2ad6c6e8f4969cff6bbdebccb2 100644 (file)
@@ -29,10 +29,10 @@ distclean-local::
                -o -name .pc -o -name .hg -o -name .git \) -prune -o \
                \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
                -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-               -o -name '.*.rej' -o -name '.script-config' -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 '.*.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 '*.gcda' \
+               -o -name '*.gcno' \) \
                -type f -print | xargs $(RM)
 
 dist-hook:
index a8609b8299b3198f216fb6a9b00cc13fce500ef5..b84658a6489a90cfc11ca40fb1eb5a7f05653e6d 100644 (file)
@@ -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
index e145aa3708717ab3b1d97a10856d490c187960e9..ee754fd382641946aa9393e8fd8f8963fce96bd3 100644 (file)
@@ -56,6 +56,7 @@ ZFS_AC_PACKAGE
 ZFS_AC_CONFIG
 ZFS_AC_DEBUG
 ZFS_AC_DEBUGINFO
+ZFS_AC_GCOV
 
 AC_CONFIG_FILES([
        Makefile
index ead826c04b9cc2e931bee18a03d7bcb5ae881306..9e4539d5fee07094ee63527362bffa3d06fd42ef 100644 (file)
@@ -1 +1 @@
-/ctime_001_pos
+/ctime