All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles
@ 2017-05-01 18:48 kusumi.tomohiro
  2017-05-01 18:48 ` [PATCH 02/11] configure: Add compile_exec_prog() to compile and execute the binary kusumi.tomohiro
                   ` (11 more replies)
  0 siblings, 12 replies; 18+ messages in thread
From: kusumi.tomohiro @ 2017-05-01 18:48 UTC (permalink / raw)
  To: axboe, fio; +Cc: Tomohiro Kusumi

From: Tomohiro Kusumi <tkusumi@tuxera.com>

fio on NetBSD may have CONFIG_POSIX_FALLOCATE configuration enabled
since posix_fallocate(3) compiles (at least on recent versions),
but this is actually not supported on UFS as mentioned in below wiki
and fio result.

https://wiki.netbsd.org/projects/project/ffs-fallocate/
> This functionality is not currently implemented for FFS;

compile_prog() during ./configure fails to catch this as it doesn't
run the test code after compilation (and it needs to use a valid fd
in order to do runtime test).

This commit simply disables CONFIG_POSIX_FALLOCATE on NetBSD regardless
of compilation result on ./configure. It doesn't check the fs type,
but it should be enough provided that UFS is the fs used by majority
of users and there's also no real alternative for disk fs.

-- yes for posix_fallocate(3), but EOPNOTSUPP on runtime
 # uname
 NetBSD
 # gmake clean >/dev/null 2>&1
 # ./configure | grep "POSIX fallocate"
 POSIX fallocate               yes
 # grep -A1 posix_fallocate ./config.log
 Compiling test case posix_fallocate
 gcc -D_GNU_SOURCE -include config-host.h -o /tmp/fio-conf--23834-.exe /tmp/fio-conf--23834-.c -lrt -lz
 # gmake -j8 >/dev/null 2>&1
 # ./fio --name=xxxxx --ioengine=sync --rw=read --bs=2k --size=1m --unlink=1 | grep posix_fallocate
 fio: posix_fallocate fails: Operation not supported

-- try posix_fallocate(3) test in ./configure with a valid fd
 # uname
 NetBSD
 # cat ./test2.c
 #include <stdio.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 int main(int argc, char **argv)
 {
   int r, fd;
   fd = open(argv[1], O_WRONLY | O_CREAT, 0644);
   if (fd < 0)
           return errno;
   r = posix_fallocate(fd, 0, 1024);
   close(fd);
   return r;
 }
 # gcc -Wall -g ./test2.c
 # ./a.out xxx; echo $?
 45

-- try above on Linux
 # uname
 Linux
 # gcc -Wall -g ./test2.c
 # ./a.out xxx; echo $?
 0

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
---
 configure   | 5 +++++
 filesetup.c | 6 +++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index bcb898a..c3e06cd 100755
--- a/configure
+++ b/configure
@@ -781,6 +781,11 @@ EOF
 if compile_prog "" "" "posix_fallocate"; then
     posix_fallocate="yes"
 fi
+# Ignore the result for NetBSD since it's not supported at least on UFS,
+# which is what people basically use on NetBSD.
+if test "$targetos" = "NetBSD"; then
+    posix_fallocate="no"
+fi
 echo "POSIX fallocate               $posix_fallocate"
 
 ##########################################
diff --git a/filesetup.c b/filesetup.c
index 612e794..23fd537 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -109,7 +109,11 @@ static int extend_file(struct thread_data *td, struct fio_file *f)
 			dprint(FD_FILE, "posix_fallocate file %s size %llu\n",
 				 f->file_name,
 				 (unsigned long long) f->real_file_size);
-
+			/*
+			 * Note that some OS/filesystem, for e.g. UFS on NetBSD
+			 * doesn't support posix_fallocate(3) even if it compiles.
+			 * Try to avoid it on ./configure if it's a known issue.
+			 */
 			r = posix_fallocate(f->fd, 0, f->real_file_size);
 			if (r > 0) {
 				log_err("fio: posix_fallocate fails: %s\n",
-- 
2.9.3



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 02/11] configure: Add compile_exec_prog() to compile and execute the binary
  2017-05-01 18:48 [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles kusumi.tomohiro
@ 2017-05-01 18:48 ` kusumi.tomohiro
  2017-05-01 18:48 ` [PATCH 03/11] configure: Use single square brackets (POSIX) kusumi.tomohiro
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: kusumi.tomohiro @ 2017-05-01 18:48 UTC (permalink / raw)
  To: axboe, fio; +Cc: Tomohiro Kusumi

From: Tomohiro Kusumi <tkusumi@tuxera.com>

This commit directly applies on top of the previous one which added
a NetBSD specific conditional after running compile_prog() for
posix_fallocate(3), and partly reverts it to replace with alternative
generic solution.

The new shell function compile_exec_prog() runs the executable binary
$TMPE after generating it with arguments if needed. This enables
the script to drop the NetBSD specific code added by the previous
commit, and possibly replace other compile_prog() calls that require
runtime tests in the future. The test code for posix_fallocate(3)
is also modified to use a valid fd and random tmp path.

Note that compile_exec_prog() can be used only if $TMPE returns 0 on
success and non 0 on failure, because if otherwise do_cc() result
may wrongly be intepreted. This is still generic enough though, as
most of the $TMPE binaries use 0 to indicate success while the return
values have mostly been unused.

Confirmed this doesn't change the CONFIG_POSIX_FALLOCATE result on
several platforms.

-- with this commit, no for posix_fallocate(3)
 # uname
 NetBSD
 # gmake clean >/dev/null 2>&1
 # ./configure | grep "POSIX fallocate"
 POSIX fallocate               no
 # grep -A3 posix_fallocate ./config.log
 Compiling and executing test case posix_fallocate
 gcc -D_GNU_SOURCE -include config-host.h -o /tmp/fio-conf--27794-.exe /tmp/fio-conf--27794-.c -lrt -lz
 /tmp/fio-conf--27794-.exe /tmp/fio-conf--27794-.file
 ... result 45
 # gmake -j8 >/dev/null 2>&1
 # ./fio --name=xxxxx --ioengine=sync --rw=read --bs=2k --size=1m --unlink=1 | grep posix_fallocate
 #

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
---
 configure   | 41 +++++++++++++++++++++++++++++++++--------
 filesetup.c |  1 -
 2 files changed, 33 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index c3e06cd..9bcdb63 100755
--- a/configure
+++ b/configure
@@ -17,9 +17,13 @@ TMPC="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.c"
 TMPO="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.o"
 TMPE="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.exe"
 
+# This path can be used for anything, but currently only used for
+# compile_exec_prog() argument.
+TMPF="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.file"
+
 # NB: do not call "exit" in the trap handler; this is buggy with some shells;
 # see <1285349658-3122-1-git-send-email-loic.minier@linaro.org>
-trap "rm -f $TMPC $TMPO $TMPE" EXIT INT QUIT TERM
+trap "rm -f $TMPC $TMPO $TMPE $TMPF" EXIT INT QUIT TERM
 
 rm -rf config.log
 
@@ -92,6 +96,21 @@ compile_prog() {
   do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
 }
 
+# Success if $TMPC gets compiled, and then $TMPE returns 0
+compile_exec_prog() {
+  local_cflags="$1"
+  local_ldflags="$2 $LIBS"
+  echo "Compiling and executing test case $3" >> config.log
+  do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags || return $?
+  shift; shift; shift
+  argv="$@"
+  $TMPE $argv # >/dev/null 2>&1
+  result=$?
+  echo "$TMPE $argv" >> config.log
+  echo "... result $result" >> config.log
+  return $result
+}
+
 feature_not_found() {
   feature=$1
   packages=$2
@@ -766,26 +785,32 @@ echo "POSIX fadvise                 $posix_fadvise"
 
 ##########################################
 # POSIX fallocate probe
+# Test runtime as well since some OS/filesystem, for e.g. UFS on NetBSD
+# doesn't support posix_fallocate(3) even if it compiles.
 if test "$posix_fallocate" != "yes" ; then
   posix_fallocate="no"
 fi
 cat > $TMPC << EOF
 #include <stdio.h>
+#include <unistd.h>
 #include <fcntl.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
 int main(int argc, char **argv)
 {
-  int r = posix_fallocate(0, 0, 1024);
+  int r, fd;
+  fd = open(argv[1], O_WRONLY | O_CREAT, 0644);
+  if (fd < 0)
+	  return errno;
+  r = posix_fallocate(fd, 0, 1024);
+  close(fd);
   return r;
 }
 EOF
-if compile_prog "" "" "posix_fallocate"; then
+if compile_exec_prog "" "" "posix_fallocate" "$TMPF"; then
     posix_fallocate="yes"
 fi
-# Ignore the result for NetBSD since it's not supported at least on UFS,
-# which is what people basically use on NetBSD.
-if test "$targetos" = "NetBSD"; then
-    posix_fallocate="no"
-fi
 echo "POSIX fallocate               $posix_fallocate"
 
 ##########################################
diff --git a/filesetup.c b/filesetup.c
index 23fd537..611a656 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -112,7 +112,6 @@ static int extend_file(struct thread_data *td, struct fio_file *f)
 			/*
 			 * Note that some OS/filesystem, for e.g. UFS on NetBSD
 			 * doesn't support posix_fallocate(3) even if it compiles.
-			 * Try to avoid it on ./configure if it's a known issue.
 			 */
 			r = posix_fallocate(f->fd, 0, f->real_file_size);
 			if (r > 0) {
-- 
2.9.3



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 03/11] configure: Use single square brackets (POSIX)
  2017-05-01 18:48 [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles kusumi.tomohiro
  2017-05-01 18:48 ` [PATCH 02/11] configure: Add compile_exec_prog() to compile and execute the binary kusumi.tomohiro
@ 2017-05-01 18:48 ` kusumi.tomohiro
  2017-05-02  5:36   ` Sitsofe Wheeler
  2017-05-01 18:48 ` [PATCH 04/11] configure: Use compile_exec_prog() for s390_z196_facilities kusumi.tomohiro
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 18+ messages in thread
From: kusumi.tomohiro @ 2017-05-01 18:48 UTC (permalink / raw)
  To: axboe, fio; +Cc: Tomohiro Kusumi

From: Tomohiro Kusumi <tkusumi@tuxera.com>

Avoid "if [[...]]" format which seems to be bash extension.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 9bcdb63..09c5f60 100755
--- a/configure
+++ b/configure
@@ -1710,7 +1710,7 @@ int main(int argc, char **argv)
 EOF
 if compile_prog "" "" "s390_z196_facilities"; then
   $TMPE
-  if [[ $? -eq 0 ]]; then
+  if [ $? -eq 0 ]; then
   	s390_z196_facilities="yes"
   fi
 fi
-- 
2.9.3



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 04/11] configure: Use compile_exec_prog() for s390_z196_facilities
  2017-05-01 18:48 [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles kusumi.tomohiro
  2017-05-01 18:48 ` [PATCH 02/11] configure: Add compile_exec_prog() to compile and execute the binary kusumi.tomohiro
  2017-05-01 18:48 ` [PATCH 03/11] configure: Use single square brackets (POSIX) kusumi.tomohiro
@ 2017-05-01 18:48 ` kusumi.tomohiro
  2017-05-01 18:48 ` [PATCH 05/11] configure: output_sym CONFIG_GFIO kusumi.tomohiro
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: kusumi.tomohiro @ 2017-05-01 18:48 UTC (permalink / raw)
  To: axboe, fio; +Cc: Tomohiro Kusumi

From: Tomohiro Kusumi <tkusumi@tuxera.com>

The existing compile_prog() for s390_z196_facilities can be replaced
with compile_exec_prog() since what this does is

 if (s390_z196_facilities test code compiles)
     if (s390_z196_facilities test code returns 0)
         s390_z196_facilities = "yes";

and this is what compile_exec_prog() does too.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
---
 configure | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index 09c5f60..0b72f45 100755
--- a/configure
+++ b/configure
@@ -1708,11 +1708,8 @@ int main(int argc, char **argv)
       return -1;
 }
 EOF
-if compile_prog "" "" "s390_z196_facilities"; then
-  $TMPE
-  if [ $? -eq 0 ]; then
-  	s390_z196_facilities="yes"
-  fi
+if compile_exec_prog "" "" "s390_z196_facilities"; then
+  s390_z196_facilities="yes"
 fi
 echo "s390_z196_facilities          $s390_z196_facilities"
 
-- 
2.9.3



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 05/11] configure: output_sym CONFIG_GFIO
  2017-05-01 18:48 [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles kusumi.tomohiro
                   ` (2 preceding siblings ...)
  2017-05-01 18:48 ` [PATCH 04/11] configure: Use compile_exec_prog() for s390_z196_facilities kusumi.tomohiro
@ 2017-05-01 18:48 ` kusumi.tomohiro
  2017-05-01 18:48 ` [PATCH 06/11] configure: Add missing <string.h> to avoid bogus warning kusumi.tomohiro
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: kusumi.tomohiro @ 2017-05-01 18:48 UTC (permalink / raw)
  To: axboe, fio; +Cc: Tomohiro Kusumi

From: Tomohiro Kusumi <tkusumi@tuxera.com>

No reason not to output_sym CONFIG_GFIO, when all others do this.
Having CONFIG_GFIO in config-host.h doesn't harm anything.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
---
 configure | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 0b72f45..b2120ec 100755
--- a/configure
+++ b/configure
@@ -180,8 +180,7 @@ for opt do
   ;;
   --build-static) build_static="yes"
   ;;
-  --enable-gfio)
-  gfio_check="yes"
+  --enable-gfio) gfio_check="yes"
   ;;
   --disable-numa) disable_numa="yes"
   ;;
@@ -2153,7 +2152,7 @@ if test "$rusage_thread" = "yes" ; then
   output_sym "CONFIG_RUSAGE_THREAD"
 fi
 if test "$gfio" = "yes" ; then
-  echo "CONFIG_GFIO=y" >> $config_host_mak
+  output_sym "CONFIG_GFIO"
 fi
 if test "$esx" = "yes" ; then
   output_sym "CONFIG_ESX"
-- 
2.9.3



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 06/11] configure: Add missing <string.h> to avoid bogus warning
  2017-05-01 18:48 [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles kusumi.tomohiro
                   ` (3 preceding siblings ...)
  2017-05-01 18:48 ` [PATCH 05/11] configure: output_sym CONFIG_GFIO kusumi.tomohiro
@ 2017-05-01 18:48 ` kusumi.tomohiro
  2017-05-01 18:48 ` [PATCH 07/11] configure: Add void* cast " kusumi.tomohiro
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: kusumi.tomohiro @ 2017-05-01 18:48 UTC (permalink / raw)
  To: axboe, fio; +Cc: Tomohiro Kusumi

From: Tomohiro Kusumi <tkusumi@tuxera.com>

This warning has nothing to do with what the code is trying to test.
This isn't testing if memset(3) is available, so just silence the
warning by including an appropriate header.

--
 # uname
 Linux
 # grep memset config.log -A2 | head -3
 /tmp/fio-conf-23441-58170-6422.c:5:3: warning: implicit declaration of function 'memset' [-Wimplicit-function-declaration]
    memset(&cid, 0, sizeof(cid));
    ^~~~~~

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index b2120ec..0aaa3f8 100755
--- a/configure
+++ b/configure
@@ -934,6 +934,7 @@ if test "$clockid_t" != "yes" ; then
 fi
 cat > $TMPC << EOF
 #include <time.h>
+#include <string.h>
 int main(int argc, char **argv)
 {
   volatile clockid_t cid;
-- 
2.9.3



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 07/11] configure: Add void* cast to avoid bogus warning
  2017-05-01 18:48 [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles kusumi.tomohiro
                   ` (4 preceding siblings ...)
  2017-05-01 18:48 ` [PATCH 06/11] configure: Add missing <string.h> to avoid bogus warning kusumi.tomohiro
@ 2017-05-01 18:48 ` kusumi.tomohiro
  2017-05-01 18:48 ` [PATCH 08/11] configure: Check gfio test result via return value (not printf) kusumi.tomohiro
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: kusumi.tomohiro @ 2017-05-01 18:48 UTC (permalink / raw)
  To: axboe, fio; +Cc: Tomohiro Kusumi

From: Tomohiro Kusumi <tkusumi@tuxera.com>

This warning has nothing to do with what the code is trying to test.
This test code should keep it volatile, so cast to void* to silence
a warning on discarding volatile.

--
 # uname
 Linux
 # grep memset config.log -A2 | head -3
 /tmp/fio-conf-15226-60011-1419.c:6:10: warning: passing argument 1 of 'memset' discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers]
    memset(&cid, 0, sizeof(cid));
           ^

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 0aaa3f8..d434815 100755
--- a/configure
+++ b/configure
@@ -938,7 +938,7 @@ cat > $TMPC << EOF
 int main(int argc, char **argv)
 {
   volatile clockid_t cid;
-  memset(&cid, 0, sizeof(cid));
+  memset((void*)&cid, 0, sizeof(cid));
   return 0;
 }
 EOF
-- 
2.9.3



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 08/11] configure: Check gfio test result via return value (not printf)
  2017-05-01 18:48 [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles kusumi.tomohiro
                   ` (5 preceding siblings ...)
  2017-05-01 18:48 ` [PATCH 07/11] configure: Add void* cast " kusumi.tomohiro
@ 2017-05-01 18:48 ` kusumi.tomohiro
  2017-05-01 18:48 ` [PATCH 09/11] configure: Add missing ########## kusumi.tomohiro
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: kusumi.tomohiro @ 2017-05-01 18:48 UTC (permalink / raw)
  To: axboe, fio; +Cc: Tomohiro Kusumi

From: Tomohiro Kusumi <tkusumi@tuxera.com>

Test code compiled by compile_prog() mostly return 0 on success
whether binaries are executed or not. This one actually runs and
the result can be checked without printf.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
---
 configure | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index d434815..5d8a9bd 100755
--- a/configure
+++ b/configure
@@ -1273,7 +1273,7 @@ int main(void)
   gdk_threads_enter();
   gdk_threads_leave();
 
-  printf("%d", GTK_CHECK_VERSION(2, 18, 0));
+  return GTK_CHECK_VERSION(2, 18, 0) ? 0 : 1; /* 0 on success */
 }
 EOF
 GTK_CFLAGS=$(pkg-config --cflags gtk+-2.0 gthread-2.0)
@@ -1289,8 +1289,8 @@ if test "$?" != "0" ; then
   exit 1
 fi
 if compile_prog "$GTK_CFLAGS" "$GTK_LIBS" "gfio" ; then
-  r=$($TMPE)
-  if test "$r" != "0" ; then
+  $TMPE
+  if test "$?" = "0" ; then
     gfio="yes"
     GFIO_LIBS="$LIBS $GTK_LIBS"
     CFLAGS="$CFLAGS $GTK_CFLAGS"
-- 
2.9.3



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 09/11] configure: Add missing ##########...
  2017-05-01 18:48 [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles kusumi.tomohiro
                   ` (6 preceding siblings ...)
  2017-05-01 18:48 ` [PATCH 08/11] configure: Check gfio test result via return value (not printf) kusumi.tomohiro
@ 2017-05-01 18:48 ` kusumi.tomohiro
  2017-05-01 18:48 ` [PATCH 10/11] configure: Add missing $val != "yes" test to override compile_prog() result kusumi.tomohiro
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: kusumi.tomohiro @ 2017-05-01 18:48 UTC (permalink / raw)
  To: axboe, fio; +Cc: Tomohiro Kusumi

From: Tomohiro Kusumi <tkusumi@tuxera.com>

And remove unneeded blank lines from embedded test C code.
Both are just for better readability.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
---
 configure | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 5d8a9bd..fe3354e 100755
--- a/configure
+++ b/configure
@@ -1309,6 +1309,7 @@ if test "$gfio_check" = "yes" ; then
   echo "gtk 2.18 or higher            $gfio"
 fi
 
+##########################################
 # Check whether we have getrusage(RUSAGE_THREAD)
 if test "$rusage_thread" != "yes" ; then
   rusage_thread="no"
@@ -1503,7 +1504,6 @@ cat > $TMPC << EOF
 
 int main(int argc, char **argv)
 {
-
   rados_t cluster;
   rados_ioctx_t io_ctx;
   const char pool[] = "rbd";
@@ -1621,6 +1621,7 @@ if compile_prog "" "" "setvbuf"; then
 fi
 echo "setvbuf                       $setvbuf"
 
+##########################################
 # check for gfapi
 if test "$gfapi" != "yes" ; then
   gfapi="no"
@@ -1630,7 +1631,6 @@ cat > $TMPC << EOF
 
 int main(int argc, char **argv)
 {
-
   glfs_t *g = glfs_new("foo");
 
   return 0;
@@ -1821,6 +1821,7 @@ echo "NVML pmemblk engine           $pmemblk"
 # Report whether dev-dax engine is enabled
 echo "NVML dev-dax engine           $devdax"
 
+##########################################
 # Check if we have lex/yacc available
 yacc="no"
 yacc_is_bison="no"
-- 
2.9.3



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 10/11] configure: Add missing $val != "yes" test to override compile_prog() result
  2017-05-01 18:48 [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles kusumi.tomohiro
                   ` (7 preceding siblings ...)
  2017-05-01 18:48 ` [PATCH 09/11] configure: Add missing ########## kusumi.tomohiro
@ 2017-05-01 18:48 ` kusumi.tomohiro
  2017-05-01 18:48 ` [PATCH 11/11] configure: Add print_config() for "<config>... <yes|no>" outputs kusumi.tomohiro
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: kusumi.tomohiro @ 2017-05-01 18:48 UTC (permalink / raw)
  To: axboe, fio; +Cc: Tomohiro Kusumi

From: Tomohiro Kusumi <tkusumi@tuxera.com>

Since it's possible for some platforms to use statically configured
configurations (e.g. see around L350 for Cygwin), it should test if
the variable hasn't been set to "yes" before initializing the variable
with "no", so that compile_prog() result can be safely ignored when
the platform knows it's supported.

ca205a75 (configure: Make Cygwin take regular configure path) started
this due to a major change in the configuration path, which changed
Cygwin to take the normal path taken by all other platforms, and
these two were added after that change.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
---
 configure | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index fe3354e..ce46996 100755
--- a/configure
+++ b/configure
@@ -631,7 +631,9 @@ echo "POSIX AIO fsync               $posix_aio_fsync"
 
 ##########################################
 # POSIX pshared attribute probe
-posix_pshared="no"
+if test "$posix_pshared" != "yes" ; then
+  posix_pshared="no"
+fi
 cat > $TMPC <<EOF
 #include <unistd.h>
 int main(void)
@@ -2024,7 +2026,9 @@ echo "march_armv8_a_crc_crypto      $march_armv8_a_crc_crypto"
 
 ##########################################
 # cuda probe
-cuda="no"
+if test "$cuda" != "yes" ; then
+  cuda="no"
+fi
 cat > $TMPC << EOF
 #include <cuda.h>
 int main(int argc, char **argv)
-- 
2.9.3



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 11/11] configure: Add print_config() for "<config>... <yes|no>" outputs
  2017-05-01 18:48 [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles kusumi.tomohiro
                   ` (8 preceding siblings ...)
  2017-05-01 18:48 ` [PATCH 10/11] configure: Add missing $val != "yes" test to override compile_prog() result kusumi.tomohiro
@ 2017-05-01 18:48 ` kusumi.tomohiro
  2017-05-01 20:44 ` [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles Jens Axboe
  2017-05-01 20:48 ` Jens Axboe
  11 siblings, 0 replies; 18+ messages in thread
From: kusumi.tomohiro @ 2017-05-01 18:48 UTC (permalink / raw)
  To: axboe, fio; +Cc: Tomohiro Kusumi

From: Tomohiro Kusumi <tkusumi@tuxera.com>

Hide alignment (30 spaces between two columns) from callers.

This may not be applied depending on adoption of previous series
of diffs, but in case this one is good but doesn't apply, I'll
resubmit this.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
---
 configure | 157 ++++++++++++++++++++++++++++++++------------------------------
 1 file changed, 81 insertions(+), 76 deletions(-)

diff --git a/configure b/configure
index ce46996..3bb8b40 100755
--- a/configure
+++ b/configure
@@ -41,6 +41,11 @@ fatal() {
   exit 1
 }
 
+# Print result for each configuration test
+print_config() {
+  printf "%-30s%s\n" "$1" "$2"
+}
+
 # Default CFLAGS
 CFLAGS="-D_GNU_SOURCE -include config-host.h"
 BUILD_CFLAGS=""
@@ -494,11 +499,11 @@ EOF
 fi
 
 
-echo "Operating system              $targetos"
-echo "CPU                           $cpu"
-echo "Big endian                    $bigendian"
-echo "Compiler                      $cc"
-echo "Cross compile                 $cross_compile"
+print_config "Operating system" "$targetos"
+print_config "CPU" "$cpu"
+print_config "Big endian" "$bigendian"
+print_config "Compiler" "$cc"
+print_config "Cross compile" "$cross_compile"
 echo
 
 ##########################################
@@ -509,7 +514,7 @@ if test "$build_static" = "yes" ; then
 else
   build_static="no"
 fi
-echo "Static build                  $build_static"
+print_config "Static build" "$build_static"
 
 ##########################################
 # check for wordsize
@@ -530,7 +535,7 @@ elif compile_prog "-DWORDSIZE=64" "" "wordsize"; then
 else
   fatal "Unknown wordsize"
 fi
-echo "Wordsize                      $wordsize"
+print_config "Wordsize" "$wordsize"
 
 ##########################################
 # zlib probe
@@ -551,7 +556,7 @@ if compile_prog "" "-lz" "zlib" ; then
   zlib=yes
   LIBS="-lz $LIBS"
 fi
-echo "zlib                          $zlib"
+print_config "zlib" "$zlib"
 
 ##########################################
 # linux-aio probe
@@ -578,7 +583,7 @@ EOF
     libaio=no
   fi
 fi
-echo "Linux AIO support             $libaio"
+print_config "Linux AIO support" "$libaio"
 
 ##########################################
 # posix aio probe
@@ -604,8 +609,8 @@ elif compile_prog "" "-lrt" "posixaio"; then
   posix_aio_lrt="yes"
   LIBS="-lrt $LIBS"
 fi
-echo "POSIX AIO support             $posix_aio"
-echo "POSIX AIO support needs -lrt  $posix_aio_lrt"
+print_config "POSIX AIO support" "$posix_aio"
+print_config "POSIX AIO support needs -lrt" "$posix_aio_lrt"
 
 ##########################################
 # posix aio fsync probe
@@ -627,7 +632,7 @@ EOF
     posix_aio_fsync=yes
   fi
 fi
-echo "POSIX AIO fsync               $posix_aio_fsync"
+print_config "POSIX AIO fsync" "$posix_aio_fsync"
 
 ##########################################
 # POSIX pshared attribute probe
@@ -657,7 +662,7 @@ EOF
 if compile_prog "" "$LIBS" "posix_pshared" ; then
   posix_pshared=yes
 fi
-echo "POSIX pshared support         $posix_pshared"
+print_config "POSIX pshared support" "$posix_pshared"
 
 ##########################################
 # solaris aio probe
@@ -679,7 +684,7 @@ if compile_prog "" "-laio" "solarisaio" ; then
   solaris_aio=yes
   LIBS="-laio $LIBS"
 fi
-echo "Solaris AIO support           $solaris_aio"
+print_config "Solaris AIO support" "$solaris_aio"
 
 ##########################################
 # __sync_fetch_and_add test
@@ -703,7 +708,7 @@ EOF
 if compile_prog "" "" "__sync_fetch_and_add()" ; then
     sfaa="yes"
 fi
-echo "__sync_fetch_and_add          $sfaa"
+print_config "__sync_fetch_and_add" "$sfaa"
 
 ##########################################
 # libverbs probe
@@ -723,7 +728,7 @@ if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; the
     libverbs="yes"
     LIBS="-libverbs $LIBS"
 fi
-echo "libverbs                      $libverbs"
+print_config "libverbs" "$libverbs"
 
 ##########################################
 # rdmacm probe
@@ -743,7 +748,7 @@ if test "$disable_rdma" != "yes" && compile_prog "" "-lrdmacm" "rdma"; then
     rdmacm="yes"
     LIBS="-lrdmacm $LIBS"
 fi
-echo "rdmacm                        $rdmacm"
+print_config "rdmacm" "$rdmacm"
 
 ##########################################
 # Linux fallocate probe
@@ -763,7 +768,7 @@ EOF
 if compile_prog "" "" "linux_fallocate"; then
     linux_fallocate="yes"
 fi
-echo "Linux fallocate               $linux_fallocate"
+print_config "Linux fallocate" "$linux_fallocate"
 
 ##########################################
 # POSIX fadvise probe
@@ -782,7 +787,7 @@ EOF
 if compile_prog "" "" "posix_fadvise"; then
     posix_fadvise="yes"
 fi
-echo "POSIX fadvise                 $posix_fadvise"
+print_config "POSIX fadvise" "$posix_fadvise"
 
 ##########################################
 # POSIX fallocate probe
@@ -812,7 +817,7 @@ EOF
 if compile_exec_prog "" "" "posix_fallocate" "$TMPF"; then
     posix_fallocate="yes"
 fi
-echo "POSIX fallocate               $posix_fallocate"
+print_config "POSIX fallocate" "$posix_fallocate"
 
 ##########################################
 # sched_set/getaffinity 2 or 3 argument test
@@ -845,8 +850,8 @@ EOF
     linux_2arg_affinity="yes"
   fi
 fi
-echo "sched_setaffinity(3 arg)      $linux_3arg_affinity"
-echo "sched_setaffinity(2 arg)      $linux_2arg_affinity"
+print_config "sched_setaffinity(3 arg)" "$linux_3arg_affinity"
+print_config "sched_setaffinity(2 arg)" "$linux_2arg_affinity"
 
 ##########################################
 # clock_gettime probe
@@ -867,7 +872,7 @@ elif compile_prog "" "-lrt" "clock_gettime"; then
     clock_gettime="yes"
     LIBS="-lrt $LIBS"
 fi
-echo "clock_gettime                 $clock_gettime"
+print_config "clock_gettime" "$clock_gettime"
 
 ##########################################
 # CLOCK_MONOTONIC probe
@@ -887,7 +892,7 @@ EOF
       clock_monotonic="yes"
   fi
 fi
-echo "CLOCK_MONOTONIC               $clock_monotonic"
+print_config "CLOCK_MONOTONIC" "$clock_monotonic"
 
 ##########################################
 # CLOCK_MONOTONIC_RAW probe
@@ -907,7 +912,7 @@ EOF
       clock_monotonic_raw="yes"
   fi
 fi
-echo "CLOCK_MONOTONIC_RAW           $clock_monotonic_raw"
+print_config "CLOCK_MONOTONIC_RAW" "$clock_monotonic_raw"
 
 ##########################################
 # CLOCK_MONOTONIC_PRECISE probe
@@ -927,7 +932,7 @@ EOF
       clock_monotonic_precise="yes"
   fi
 fi
-echo "CLOCK_MONOTONIC_PRECISE       $clock_monotonic_precise"
+print_config "CLOCK_MONOTONIC_PRECISE" "$clock_monotonic_precise"
 
 ##########################################
 # clockid_t probe
@@ -947,7 +952,7 @@ EOF
 if compile_prog "" "$LIBS" "clockid_t"; then
   clockid_t="yes"
 fi
-echo "clockid_t                     $clockid_t"
+print_config "clockid_t" "$clockid_t"
 
 ##########################################
 # gettimeofday() probe
@@ -966,7 +971,7 @@ EOF
 if compile_prog "" "" "gettimeofday"; then
     gettimeofday="yes"
 fi
-echo "gettimeofday                  $gettimeofday"
+print_config "gettimeofday" "$gettimeofday"
 
 ##########################################
 # fdatasync() probe
@@ -984,7 +989,7 @@ EOF
 if compile_prog "" "" "fdatasync"; then
   fdatasync="yes"
 fi
-echo "fdatasync                     $fdatasync"
+print_config "fdatasync" "$fdatasync"
 
 ##########################################
 # sync_file_range() probe
@@ -1006,7 +1011,7 @@ EOF
 if compile_prog "" "" "sync_file_range"; then
   sync_file_range="yes"
 fi
-echo "sync_file_range               $sync_file_range"
+print_config "sync_file_range" "$sync_file_range"
 
 ##########################################
 # ext4 move extent probe
@@ -1030,7 +1035,7 @@ elif test $targetos = "Linux" ; then
   # work. Takes a while to bubble back.
   ext4_me="yes"
 fi
-echo "EXT4 move extent              $ext4_me"
+print_config "EXT4 move extent" "$ext4_me"
 
 ##########################################
 # splice probe
@@ -1048,7 +1053,7 @@ EOF
 if compile_prog "" "" "linux splice"; then
   linux_splice="yes"
 fi
-echo "Linux splice(2)               $linux_splice"
+print_config "Linux splice(2)" "$linux_splice"
 
 ##########################################
 # GUASI probe
@@ -1067,7 +1072,7 @@ EOF
 if compile_prog "" "" "guasi"; then
   guasi="yes"
 fi
-echo "GUASI                         $guasi"
+print_config "GUASI" "$guasi"
 
 ##########################################
 # fusion-aw probe
@@ -1089,7 +1094,7 @@ if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthrea
   LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread $LIBS"
   fusion_aw="yes"
 fi
-echo "Fusion-io atomic engine       $fusion_aw"
+print_config "Fusion-io atomic engine" "$fusion_aw"
 
 ##########################################
 # libnuma probe
@@ -1107,7 +1112,7 @@ if test "$disable_numa" != "yes"  && compile_prog "" "-lnuma" "libnuma"; then
   libnuma="yes"
   LIBS="-lnuma $LIBS"
 fi
-echo "libnuma                       $libnuma"
+print_config "libnuma" "$libnuma"
 
 ##########################################
 # libnuma 2.x version API, initialize with "no" only if $libnuma is set to "yes"
@@ -1124,7 +1129,7 @@ EOF
 if compile_prog "" "" "libnuma api"; then
   libnuma_v2="yes"
 fi
-echo "libnuma v2                    $libnuma_v2"
+print_config "libnuma v2" "$libnuma_v2"
 fi
 
 ##########################################
@@ -1144,7 +1149,7 @@ EOF
 if compile_prog "" "" "strsep"; then
   strsep="yes"
 fi
-echo "strsep                        $strsep"
+print_config "strsep" "$strsep"
 
 ##########################################
 # strcasestr() probe
@@ -1161,7 +1166,7 @@ EOF
 if compile_prog "" "" "strcasestr"; then
   strcasestr="yes"
 fi
-echo "strcasestr                    $strcasestr"
+print_config "strcasestr" "$strcasestr"
 
 ##########################################
 # strlcat() probe
@@ -1182,7 +1187,7 @@ EOF
 if compile_prog "" "" "strlcat"; then
   strlcat="yes"
 fi
-echo "strlcat                       $strlcat"
+print_config "strlcat" "$strlcat"
 
 ##########################################
 # getopt_long_only() probe
@@ -1202,7 +1207,7 @@ EOF
 if compile_prog "" "" "getopt_long_only"; then
   getopt_long_only="yes"
 fi
-echo "getopt_long_only()            $getopt_long_only"
+print_config "getopt_long_only()" "$getopt_long_only"
 
 ##########################################
 # inet_aton() probe
@@ -1222,7 +1227,7 @@ EOF
 if compile_prog "" "" "inet_aton"; then
   inet_aton="yes"
 fi
-echo "inet_aton                     $inet_aton"
+print_config "inet_aton" "$inet_aton"
 
 ##########################################
 # socklen_t probe
@@ -1240,7 +1245,7 @@ EOF
 if compile_prog "" "" "socklen_t"; then
   socklen_t="yes"
 fi
-echo "socklen_t                     $socklen_t"
+print_config "socklen_t" "$socklen_t"
 
 ##########################################
 # Whether or not __thread is supported for TLS
@@ -1258,7 +1263,7 @@ EOF
 if compile_prog "" "" "__thread"; then
   tls_thread="yes"
 fi
-echo "__thread                      $tls_thread"
+print_config "__thread" "$tls_thread"
 
 ##########################################
 # Check if we have required gtk/glib support for gfio
@@ -1308,7 +1313,7 @@ LDFLAGS=$ORG_LDFLAGS
 fi
 
 if test "$gfio_check" = "yes" ; then
-  echo "gtk 2.18 or higher            $gfio"
+  print_config "gtk 2.18 or higher" "$gfio"
 fi
 
 ##########################################
@@ -1329,7 +1334,7 @@ EOF
 if compile_prog "" "" "RUSAGE_THREAD"; then
   rusage_thread="yes"
 fi
-echo "RUSAGE_THREAD                 $rusage_thread"
+print_config "RUSAGE_THREAD" "$rusage_thread"
 
 ##########################################
 # Check whether we have SCHED_IDLE
@@ -1347,7 +1352,7 @@ EOF
 if compile_prog "" "" "SCHED_IDLE"; then
   sched_idle="yes"
 fi
-echo "SCHED_IDLE                    $sched_idle"
+print_config "SCHED_IDLE" "$sched_idle"
 
 ##########################################
 # Check whether we have TCP_NODELAY
@@ -1367,7 +1372,7 @@ EOF
 if compile_prog "" "" "TCP_NODELAY"; then
   tcp_nodelay="yes"
 fi
-echo "TCP_NODELAY                   $tcp_nodelay"
+print_config "TCP_NODELAY" "$tcp_nodelay"
 
 ##########################################
 # Check whether we have SO_SNDBUF
@@ -1388,7 +1393,7 @@ EOF
 if compile_prog "" "" "SO_SNDBUF"; then
   window_size="yes"
 fi
-echo "Net engine window_size        $window_size"
+print_config "Net engine window_size" "$window_size"
 
 ##########################################
 # Check whether we have TCP_MAXSEG
@@ -1410,7 +1415,7 @@ EOF
 if compile_prog "" "" "TCP_MAXSEG"; then
   mss="yes"
 fi
-echo "TCP_MAXSEG                    $mss"
+print_config "TCP_MAXSEG" "$mss"
 
 ##########################################
 # Check whether we have RLIMIT_MEMLOCK
@@ -1429,7 +1434,7 @@ EOF
 if compile_prog "" "" "RLIMIT_MEMLOCK"; then
   rlimit_memlock="yes"
 fi
-echo "RLIMIT_MEMLOCK                $rlimit_memlock"
+print_config "RLIMIT_MEMLOCK" "$rlimit_memlock"
 
 ##########################################
 # Check whether we have pwritev/preadv
@@ -1447,7 +1452,7 @@ EOF
 if compile_prog "" "" "pwritev"; then
   pwritev="yes"
 fi
-echo "pwritev/preadv                $pwritev"
+print_config "pwritev/preadv" "$pwritev"
 
 ##########################################
 # Check whether we have pwritev2/preadv2
@@ -1465,7 +1470,7 @@ EOF
 if compile_prog "" "" "pwritev2"; then
   pwritev2="yes"
 fi
-echo "pwritev2/preadv2              $pwritev2"
+print_config "pwritev2/preadv2" "$pwritev2"
 
 ##########################################
 # Check whether we have the required functions for ipv6
@@ -1494,7 +1499,7 @@ EOF
 if compile_prog "" "" "ipv6"; then
   ipv6="yes"
 fi
-echo "IPv6 helpers                  $ipv6"
+print_config "IPv6 helpers" "$ipv6"
 
 ##########################################
 # check for rbd
@@ -1521,7 +1526,7 @@ if test "$disable_rbd" != "yes"  && compile_prog "" "-lrbd -lrados" "rbd"; then
   LIBS="-lrbd -lrados $LIBS"
   rbd="yes"
 fi
-echo "Rados Block Device engine     $rbd"
+print_config "Rados Block Device engine" "$rbd"
 
 ##########################################
 # check for rbd_poll
@@ -1548,7 +1553,7 @@ EOF
 if compile_prog "" "-lrbd -lrados" "rbd"; then
   rbd_poll="yes"
 fi
-echo "rbd_poll                      $rbd_poll"
+print_config "rbd_poll" "$rbd_poll"
 fi
 
 ##########################################
@@ -1570,7 +1575,7 @@ EOF
 if compile_prog "" "-lrbd -lrados" "rbd"; then
   rbd_inval="yes"
 fi
-echo "rbd_invalidate_cache          $rbd_inval"
+print_config "rbd_invalidate_cache" "$rbd_inval"
 fi
 
 ##########################################
@@ -1601,7 +1606,7 @@ if test "$disable_rbd" != "yes" && test "$disable_rbd_blkin" != "yes" \
   LIBS="-lblkin $LIBS"
   rbd_blkin="yes"
 fi
-echo "rbd blkin tracing             $rbd_blkin"
+print_config "rbd blkin tracing" "$rbd_blkin"
 
 ##########################################
 # Check whether we have setvbuf
@@ -1621,7 +1626,7 @@ EOF
 if compile_prog "" "" "setvbuf"; then
   setvbuf="yes"
 fi
-echo "setvbuf                       $setvbuf"
+print_config "setvbuf" "$setvbuf"
 
 ##########################################
 # check for gfapi
@@ -1642,7 +1647,7 @@ if test "$disable_gfapi" != "yes"  && compile_prog "" "-lgfapi -lglusterfs" "gfa
   LIBS="-lgfapi -lglusterfs $LIBS"
   gfapi="yes"
 fi
- echo "Gluster API engine            $gfapi"
+print_config "Gluster API engine" "$gfapi"
 
 ##########################################
 # check for gfapi fadvise support, initialize with "no" only if $gfapi is set to "yes"
@@ -1662,7 +1667,7 @@ EOF
 if compile_prog "" "-lgfapi -lglusterfs" "gfapi"; then
   gf_fadvise="yes"
 fi
-echo "Gluster API use fadvise       $gf_fadvise"
+print_config "Gluster API use fadvise" "$gf_fadvise"
 fi
 
 ##########################################
@@ -1682,7 +1687,7 @@ EOF
 if compile_prog "" "-lgfapi -lglusterfs" "gf trim"; then
   gf_trim="yes"
 fi
-echo "Gluster API trim support      $gf_trim"
+print_config "Gluster API trim support" "$gf_trim"
 fi
 
 ##########################################
@@ -1713,7 +1718,7 @@ EOF
 if compile_exec_prog "" "" "s390_z196_facilities"; then
   s390_z196_facilities="yes"
 fi
-echo "s390_z196_facilities          $s390_z196_facilities"
+print_config "s390_z196_facilities" "$s390_z196_facilities"
 
 ##########################################
 # Check if we have required environment variables configured for libhdfs
@@ -1739,7 +1744,7 @@ if test "$libhdfs" = "yes" ; then
     FIO_HDFS_CPU="amd64"
   fi
 fi
-echo "HDFS engine                   $libhdfs"
+print_config "HDFS engine" "$libhdfs"
 
 ##########################################
 # Check whether we have MTD
@@ -1762,7 +1767,7 @@ EOF
 if compile_prog "" "" "mtd"; then
   mtd="yes"
 fi
-echo "MTD                           $mtd"
+print_config "MTD" "$mtd"
 
 ##########################################
 # Check whether we have libpmem
@@ -1782,7 +1787,7 @@ if compile_prog "" "-lpmem" "libpmem"; then
   libpmem="yes"
   LIBS="-lpmem $LIBS"
 fi
-echo "libpmem                       $libpmem"
+print_config "libpmem" "$libpmem"
 
 ##########################################
 # Check whether we have libpmemblk
@@ -1805,7 +1810,7 @@ EOF
     LIBS="-lpmemblk $LIBS"
   fi
 fi
-echo "libpmemblk                    $libpmemblk"
+print_config "libpmemblk" "$libpmemblk"
 
 # Choose the ioengines
 if test "$libpmem" = "yes" && test "$disable_pmem" = "no"; then
@@ -1817,11 +1822,11 @@ fi
 
 ##########################################
 # Report whether pmemblk engine is enabled
-echo "NVML pmemblk engine           $pmemblk"
+print_config "NVML pmemblk engine" "$pmemblk"
 
 ##########################################
 # Report whether dev-dax engine is enabled
-echo "NVML dev-dax engine           $devdax"
+print_config "NVML dev-dax engine" "$devdax"
 
 ##########################################
 # Check if we have lex/yacc available
@@ -1882,7 +1887,7 @@ fi
 fi
 fi
 
-echo "lex/yacc for arithmetic       $arith"
+print_config "lex/yacc for arithmetic" "$arith"
 
 ##########################################
 # Check whether we have setmntent/getmntent
@@ -1903,7 +1908,7 @@ EOF
 if compile_prog "" "" "getmntent"; then
   getmntent="yes"
 fi
-echo "getmntent                     $getmntent"
+print_config "getmntent" "$getmntent"
 
 ##########################################
 # Check whether we have getmntinfo
@@ -1928,7 +1933,7 @@ EOF
 if compile_prog "-Werror" "" "getmntinfo"; then
   getmntinfo="yes"
 fi
-echo "getmntinfo                    $getmntinfo"
+print_config "getmntinfo" "$getmntinfo"
 
 # getmntinfo(3) for NetBSD.
 if test "$getmntinfo_statvfs" != "yes" ; then
@@ -1946,7 +1951,7 @@ EOF
 # Skip the test if the one with statfs arg is detected.
 if test "$getmntinfo" != "yes" && compile_prog "-Werror" "" "getmntinfo_statvfs"; then
   getmntinfo_statvfs="yes"
-  echo "getmntinfo_statvfs            $getmntinfo_statvfs"
+  print_config "getmntinfo_statvfs" "$getmntinfo_statvfs"
 fi
 
 ##########################################
@@ -1981,7 +1986,7 @@ EOF
 if compile_prog "" "" "static_assert"; then
     static_assert="yes"
 fi
-echo "Static Assert                 $static_assert"
+print_config "Static Assert" "$static_assert"
 
 ##########################################
 # Check whether we have bool / stdbool.h
@@ -1999,7 +2004,7 @@ EOF
 if compile_prog "" "" "bool"; then
   have_bool="yes"
 fi
-echo "bool                          $have_bool"
+print_config "bool" "$have_bool"
 
 ##########################################
 # check march=armv8-a+crc+crypto
@@ -2022,7 +2027,7 @@ EOF
     CFLAGS="$CFLAGS -march=armv8-a+crc+crypto -DARCH_HAVE_CRC_CRYPTO"
   fi
 fi
-echo "march_armv8_a_crc_crypto      $march_armv8_a_crc_crypto"
+print_config "march_armv8_a_crc_crypto" "$march_armv8_a_crc_crypto"
 
 ##########################################
 # cuda probe
@@ -2040,7 +2045,7 @@ if test "$enable_cuda" = "yes" && compile_prog "" "-lcuda" "cuda"; then
   cuda="yes"
   LIBS="-lcuda $LIBS"
 fi
-echo "cuda                          $cuda"
+print_config "cuda" "$cuda"
 
 #############################################################################
 
-- 
2.9.3



^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles
  2017-05-01 18:48 [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles kusumi.tomohiro
                   ` (9 preceding siblings ...)
  2017-05-01 18:48 ` [PATCH 11/11] configure: Add print_config() for "<config>... <yes|no>" outputs kusumi.tomohiro
@ 2017-05-01 20:44 ` Jens Axboe
  2017-05-01 20:54   ` Tomohiro Kusumi
  2017-05-01 20:48 ` Jens Axboe
  11 siblings, 1 reply; 18+ messages in thread
From: Jens Axboe @ 2017-05-01 20:44 UTC (permalink / raw)
  To: kusumi.tomohiro; +Cc: fio, Tomohiro Kusumi

On Mon, May 01 2017, kusumi.tomohiro@gmail.com wrote:
> From: Tomohiro Kusumi <tkusumi@tuxera.com>
> 
> fio on NetBSD may have CONFIG_POSIX_FALLOCATE configuration enabled
> since posix_fallocate(3) compiles (at least on recent versions),
> but this is actually not supported on UFS as mentioned in below wiki
> and fio result.
> 
> https://wiki.netbsd.org/projects/project/ffs-fallocate/
> > This functionality is not currently implemented for FFS;
> 
> compile_prog() during ./configure fails to catch this as it doesn't
> run the test code after compilation (and it needs to use a valid fd
> in order to do runtime test).
> 
> This commit simply disables CONFIG_POSIX_FALLOCATE on NetBSD regardless
> of compilation result on ./configure. It doesn't check the fs type,
> but it should be enough provided that UFS is the fs used by majority
> of users and there's also no real alternative for disk fs.

I'd much rather we just avoid it if we get EOPNOTSUPP at runtime. That
way we don't have to change anything later on, when/if NetBSD does get
support for fallocate.

-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles
  2017-05-01 18:48 [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles kusumi.tomohiro
                   ` (10 preceding siblings ...)
  2017-05-01 20:44 ` [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles Jens Axboe
@ 2017-05-01 20:48 ` Jens Axboe
  11 siblings, 0 replies; 18+ messages in thread
From: Jens Axboe @ 2017-05-01 20:48 UTC (permalink / raw)
  To: kusumi.tomohiro; +Cc: fio, Tomohiro Kusumi

Hi,

Can you use a cover letter for multi-patch series? Makes it less awkward
to reply to the series in general.

Anway, applied 5-10. I would have applied 11 as well, but it doesn't
apply since 1-4 were dropped.

Feel free to resend the rest, considering the comments on patch #1.

-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles
  2017-05-01 20:44 ` [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles Jens Axboe
@ 2017-05-01 20:54   ` Tomohiro Kusumi
  2017-05-01 20:57     ` Jens Axboe
  0 siblings, 1 reply; 18+ messages in thread
From: Tomohiro Kusumi @ 2017-05-01 20:54 UTC (permalink / raw)
  To: Jens Axboe; +Cc: fio, Tomohiro Kusumi

Hi

2017-05-01 23:44 GMT+03:00 Jens Axboe <axboe@kernel.dk>:
> On Mon, May 01 2017, kusumi.tomohiro@gmail.com wrote:
>> From: Tomohiro Kusumi <tkusumi@tuxera.com>
>>
>> fio on NetBSD may have CONFIG_POSIX_FALLOCATE configuration enabled
>> since posix_fallocate(3) compiles (at least on recent versions),
>> but this is actually not supported on UFS as mentioned in below wiki
>> and fio result.
>>
>> https://wiki.netbsd.org/projects/project/ffs-fallocate/
>> > This functionality is not currently implemented for FFS;
>>
>> compile_prog() during ./configure fails to catch this as it doesn't
>> run the test code after compilation (and it needs to use a valid fd
>> in order to do runtime test).
>>
>> This commit simply disables CONFIG_POSIX_FALLOCATE on NetBSD regardless
>> of compilation result on ./configure. It doesn't check the fs type,
>> but it should be enough provided that UFS is the fs used by majority
>> of users and there's also no real alternative for disk fs.
>
> I'd much rather we just avoid it if we get EOPNOTSUPP at runtime. That
> way we don't have to change anything later on, when/if NetBSD does get
> support for fallocate.

Yes, so the next one 2/11 actually mostly reverts this, and replace it
with runtime check, so that it works not only with this specific
NetBSD/UFS case, but also for e.g. Linux fs (something other than
ext4, XFS, etc).
I wasn't sure if runtime check (execute $TMPE) is preferred.

Any how, I'll resend the 1,2,3,4,11 with --cover-letter as you commented.

>
> --
> Jens Axboe
>


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles
  2017-05-01 20:54   ` Tomohiro Kusumi
@ 2017-05-01 20:57     ` Jens Axboe
  2017-05-01 21:10       ` Tomohiro Kusumi
  0 siblings, 1 reply; 18+ messages in thread
From: Jens Axboe @ 2017-05-01 20:57 UTC (permalink / raw)
  To: Tomohiro Kusumi; +Cc: fio, Tomohiro Kusumi

On 05/01/2017 02:54 PM, Tomohiro Kusumi wrote:
> Hi
> 
> 2017-05-01 23:44 GMT+03:00 Jens Axboe <axboe@kernel.dk>:
>> On Mon, May 01 2017, kusumi.tomohiro@gmail.com wrote:
>>> From: Tomohiro Kusumi <tkusumi@tuxera.com>
>>>
>>> fio on NetBSD may have CONFIG_POSIX_FALLOCATE configuration enabled
>>> since posix_fallocate(3) compiles (at least on recent versions),
>>> but this is actually not supported on UFS as mentioned in below wiki
>>> and fio result.
>>>
>>> https://wiki.netbsd.org/projects/project/ffs-fallocate/
>>>> This functionality is not currently implemented for FFS;
>>>
>>> compile_prog() during ./configure fails to catch this as it doesn't
>>> run the test code after compilation (and it needs to use a valid fd
>>> in order to do runtime test).
>>>
>>> This commit simply disables CONFIG_POSIX_FALLOCATE on NetBSD regardless
>>> of compilation result on ./configure. It doesn't check the fs type,
>>> but it should be enough provided that UFS is the fs used by majority
>>> of users and there's also no real alternative for disk fs.
>>
>> I'd much rather we just avoid it if we get EOPNOTSUPP at runtime. That
>> way we don't have to change anything later on, when/if NetBSD does get
>> support for fallocate.
> 
> Yes, so the next one 2/11 actually mostly reverts this, and replace it
> with runtime check, so that it works not only with this specific
> NetBSD/UFS case, but also for e.g. Linux fs (something other than
> ext4, XFS, etc).
> I wasn't sure if runtime check (execute $TMPE) is preferred.

Let's just drop 1/11 then, and have the first patch cover the runtime of
it. But don't do that from configure. Whatever fs is hosting configure
is less interesting. Maybe that doesn't support fallocate, but whatever
you end up running on does. Or vice versa.

> Any how, I'll resend the 1,2,3,4,11 with --cover-letter as you commented.

Thanks!

-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles
  2017-05-01 20:57     ` Jens Axboe
@ 2017-05-01 21:10       ` Tomohiro Kusumi
  0 siblings, 0 replies; 18+ messages in thread
From: Tomohiro Kusumi @ 2017-05-01 21:10 UTC (permalink / raw)
  To: Jens Axboe; +Cc: fio, Tomohiro Kusumi

2017-05-01 23:57 GMT+03:00 Jens Axboe <axboe@kernel.dk>:
> On 05/01/2017 02:54 PM, Tomohiro Kusumi wrote:
>> Hi
>>
>> 2017-05-01 23:44 GMT+03:00 Jens Axboe <axboe@kernel.dk>:
>>> On Mon, May 01 2017, kusumi.tomohiro@gmail.com wrote:
>>>> From: Tomohiro Kusumi <tkusumi@tuxera.com>
>>>>
>>>> fio on NetBSD may have CONFIG_POSIX_FALLOCATE configuration enabled
>>>> since posix_fallocate(3) compiles (at least on recent versions),
>>>> but this is actually not supported on UFS as mentioned in below wiki
>>>> and fio result.
>>>>
>>>> https://wiki.netbsd.org/projects/project/ffs-fallocate/
>>>>> This functionality is not currently implemented for FFS;
>>>>
>>>> compile_prog() during ./configure fails to catch this as it doesn't
>>>> run the test code after compilation (and it needs to use a valid fd
>>>> in order to do runtime test).
>>>>
>>>> This commit simply disables CONFIG_POSIX_FALLOCATE on NetBSD regardless
>>>> of compilation result on ./configure. It doesn't check the fs type,
>>>> but it should be enough provided that UFS is the fs used by majority
>>>> of users and there's also no real alternative for disk fs.
>>>
>>> I'd much rather we just avoid it if we get EOPNOTSUPP at runtime. That
>>> way we don't have to change anything later on, when/if NetBSD does get
>>> support for fallocate.
>>
>> Yes, so the next one 2/11 actually mostly reverts this, and replace it
>> with runtime check, so that it works not only with this specific
>> NetBSD/UFS case, but also for e.g. Linux fs (something other than
>> ext4, XFS, etc).
>> I wasn't sure if runtime check (execute $TMPE) is preferred.
>
> Let's just drop 1/11 then, and have the first patch cover the runtime of
> it. But don't do that from configure. Whatever fs is hosting configure
> is less interesting. Maybe that doesn't support fallocate, but whatever
> you end up running on does. Or vice versa.

Thanks.
Yes, you're right.
They could certainly be different fs...

>
>> Any how, I'll resend the 1,2,3,4,11 with --cover-letter as you commented.
>
> Thanks!
>
> --
> Jens Axboe
>


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 03/11] configure: Use single square brackets (POSIX)
  2017-05-01 18:48 ` [PATCH 03/11] configure: Use single square brackets (POSIX) kusumi.tomohiro
@ 2017-05-02  5:36   ` Sitsofe Wheeler
  2017-05-02  5:58     ` Tomohiro Kusumi
  0 siblings, 1 reply; 18+ messages in thread
From: Sitsofe Wheeler @ 2017-05-02  5:36 UTC (permalink / raw)
  To: kusumi.tomohiro; +Cc: Jens Axboe, fio, Tomohiro Kusumi

On 1 May 2017 at 19:48,  <kusumi.tomohiro@gmail.com> wrote:
> From: Tomohiro Kusumi <tkusumi@tuxera.com>
>
> Avoid "if [[...]]" format which seems to be bash extension.

According to http://www.shellcheck.net/ , ./configure has a few other
bashims in it:

Line 16:
TMPC="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.c"
                                       ^-- SC2039: In POSIX sh, RANDOM
is undefined.

Line 17:
TMPO="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.o"
                          ^-- SC2039: In POSIX sh, RANDOM is undefined.
                                       ^-- SC2039: In POSIX sh, RANDOM
is undefined.

Line 18:
TMPE="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.exe"
                                       ^-- SC2039: In POSIX sh, RANDOM
is undefined.
                          ^-- SC2039: In POSIX sh, RANDOM is undefined.

Line 109:
  type "$1" >/dev/null 2>&1
  ^-- SC2039: In POSIX sh, 'type' is undefined.

Line 1685:
  if [[ $? -eq 0 ]]; then
     ^-- SC2039: In POSIX sh, [[ ]] is undefined.
        ^-- SC2181: Check exit code directly with e.g. 'if mycmd;',
not indirectly with $?.

-- 
Sitsofe | http://sucs.org/~sits/


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 03/11] configure: Use single square brackets (POSIX)
  2017-05-02  5:36   ` Sitsofe Wheeler
@ 2017-05-02  5:58     ` Tomohiro Kusumi
  0 siblings, 0 replies; 18+ messages in thread
From: Tomohiro Kusumi @ 2017-05-02  5:58 UTC (permalink / raw)
  To: Sitsofe Wheeler; +Cc: Jens Axboe, fio, Tomohiro Kusumi

Feel free to send those including my 03/11 if they are bash things.
I happened to just find [[...]] one without using tools.

There was one remove-bash-ism commit in the past too (40cfddb4 in 2010).

2017-05-02 8:36 GMT+03:00 Sitsofe Wheeler <sitsofe@gmail.com>:
> On 1 May 2017 at 19:48,  <kusumi.tomohiro@gmail.com> wrote:
>> From: Tomohiro Kusumi <tkusumi@tuxera.com>
>>
>> Avoid "if [[...]]" format which seems to be bash extension.
>
> According to http://www.shellcheck.net/ , ./configure has a few other
> bashims in it:
>
> Line 16:
> TMPC="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.c"
>                                        ^-- SC2039: In POSIX sh, RANDOM
> is undefined.
>
> Line 17:
> TMPO="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.o"
>                           ^-- SC2039: In POSIX sh, RANDOM is undefined.
>                                        ^-- SC2039: In POSIX sh, RANDOM
> is undefined.
>
> Line 18:
> TMPE="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.exe"
>                                        ^-- SC2039: In POSIX sh, RANDOM
> is undefined.
>                           ^-- SC2039: In POSIX sh, RANDOM is undefined.
>
> Line 109:
>   type "$1" >/dev/null 2>&1
>   ^-- SC2039: In POSIX sh, 'type' is undefined.
>
> Line 1685:
>   if [[ $? -eq 0 ]]; then
>      ^-- SC2039: In POSIX sh, [[ ]] is undefined.
>         ^-- SC2181: Check exit code directly with e.g. 'if mycmd;',
> not indirectly with $?.
>
> --
> Sitsofe | http://sucs.org/~sits/


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-05-02  5:58 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-01 18:48 [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles kusumi.tomohiro
2017-05-01 18:48 ` [PATCH 02/11] configure: Add compile_exec_prog() to compile and execute the binary kusumi.tomohiro
2017-05-01 18:48 ` [PATCH 03/11] configure: Use single square brackets (POSIX) kusumi.tomohiro
2017-05-02  5:36   ` Sitsofe Wheeler
2017-05-02  5:58     ` Tomohiro Kusumi
2017-05-01 18:48 ` [PATCH 04/11] configure: Use compile_exec_prog() for s390_z196_facilities kusumi.tomohiro
2017-05-01 18:48 ` [PATCH 05/11] configure: output_sym CONFIG_GFIO kusumi.tomohiro
2017-05-01 18:48 ` [PATCH 06/11] configure: Add missing <string.h> to avoid bogus warning kusumi.tomohiro
2017-05-01 18:48 ` [PATCH 07/11] configure: Add void* cast " kusumi.tomohiro
2017-05-01 18:48 ` [PATCH 08/11] configure: Check gfio test result via return value (not printf) kusumi.tomohiro
2017-05-01 18:48 ` [PATCH 09/11] configure: Add missing ########## kusumi.tomohiro
2017-05-01 18:48 ` [PATCH 10/11] configure: Add missing $val != "yes" test to override compile_prog() result kusumi.tomohiro
2017-05-01 18:48 ` [PATCH 11/11] configure: Add print_config() for "<config>... <yes|no>" outputs kusumi.tomohiro
2017-05-01 20:44 ` [PATCH 01/11] configure: Disable CONFIG_POSIX_FALLOCATE on NetBSD even if posix_fallocate(3) compiles Jens Axboe
2017-05-01 20:54   ` Tomohiro Kusumi
2017-05-01 20:57     ` Jens Axboe
2017-05-01 21:10       ` Tomohiro Kusumi
2017-05-01 20:48 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.