]> 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)
committerGitHub <noreply@github.com>
Fri, 15 Sep 2017 17:24:13 +0000 (10:24 -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 29437b58c8fc8bd21946d3824898127a1a1a5d28..bfce0902fe917be2dcc1cc143b403ce242b6f767 100644 (file)
@@ -19,6 +19,8 @@
 *.mod.c
 *~
 *.swp
+*.gcno
+*.gcda
 .deps
 .libs
 .dirstamp
index e6e19d6a23eaed43204c4e127ef89300e1daf2bc..ed753c81a28a96d419f25a512f7e7b03ecfd8f80 100644 (file)
@@ -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:
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 0e7686fab484beba70ce6d2a89af976439e2c7af..ae03d1bf7f54673ee1679ebd62e69b3bb5969a75 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