Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message Nov 6

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit 3a4370979fc878d914db27673f2bd7f8b933b8fe:

Merge branch 'fix-read-iolog-sync-max-bs' of https://github.com/arethusa/fio (2026-11-04 10:30:29 -0500)

are available in the Git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to bfffdcd1ec9ca694c7ce780975f73e9ef0dbfaa2:

Merge branch 'factor-out-parse-iolog-line' of https://github.com/arethusa/fio (2026-11-05 14:01:15 -0500)

----------------------------------------------------------------
Vincent Fu (4):
Merge branch 'libnfs-optional-gnutls' of https://github.com/yegorich/fio
configure: improve lbnfs/gnutls error message
Merge branch 'ioprio-set-order' of https://github.com/arethusa/fio
Merge branch 'factor-out-parse-iolog-line' of https://github.com/arethusa/fio

Willy Yang (2):
iolog: factor out per-version line parsing in read_iolog()
backend: set thread ioprio before init_iolog()

Yegor Yefremov (1):
configure: link-test libnfs instead of checking its version for gnutls

 backend.c | 14 +++++++-------
 configure | 40 +++++++++++++++++++++++++++-------------
 iolog.c   | 26 ++++++++++++++++++++++----
 3 files changed, 56 insertions(+), 24 deletions(-)

---

Diff of recent changes:

backend.c +7 -7
index 8843cdda..e1529d1b 100644
@@ -2123,13 +2123,6 @@ static void *thread_main(void *data)
 	if (fio_pin_memory(td))
 		goto err;
 
-	/*
-	 * May alter parameters that init_io_u() will use, so we need to
-	 * do this first.
-	 */
-	if (!init_iolog(td))
-		goto err;
-
 	/* ioprio_set() has to be done before td_io_init() */
 	if (fio_option_is_set(o, ioprio) ||
 	    fio_option_is_set(o, ioprio_class) ||
@@ -2145,6 +2138,13 @@ static void *thread_main(void *data)
 		td->ts.ioprio = td->ioprio;
 	}
 
+	/*
+	 * May alter parameters that init_io_u() will use, so we need to
+	 * do this first.
+	 */
+	if (!init_iolog(td))
+		goto err;
+
 	if (td_io_init(td))
 		goto err;
 
configure +27 -13
index cb602482..2a2dcd6b 100755
@@ -2439,23 +2439,37 @@ print_config "DAOS File System (dfs) Engine" "$dfs"
 # Check if we have libnfs (for userspace nfs support).
 if test "$libnfs" != "no" ; then
   if $(pkg-config libnfs > /dev/null 2>&1); then
-    libnfs="yes"
     libnfs_cflags=$(pkg-config --cflags libnfs)
     libnfs_libs=$(pkg-config --libs libnfs)
+    cat > $TMPC << EOF
+#include <nfsc/libnfs.h>
 
-    # libnfs >= 6.0.0 on Linux requires gnutls for TLS support
-    libnfs_version=$(pkg-config --modversion libnfs 2>/dev/null)
-    if test -n "$libnfs_version" -a "$targetos" = "Linux" ; then
-      libnfs_major=$(echo $libnfs_version | cut -d. -f1)
-      if test "$libnfs_major" -ge 6 ; then
-        if $(pkg-config gnutls > /dev/null 2>&1); then
-          libnfs_cflags="$libnfs_cflags $(pkg-config --cflags gnutls)"
-          libnfs_libs="$libnfs_libs $(pkg-config --libs gnutls)"
-        else
-          feature_not_found "gnutls" "gnutls (required for libnfs >= 6.0.0)"
-          libnfs="no"
-        fi
+int main(void)
+{
+  struct nfs_context *nfs = nfs_init_context();
+  nfs_destroy_context(nfs);
+  return 0;
+}
+EOF
+    libnfs_found="no"
+    if compile_prog "$libnfs_cflags" "$libnfs_libs" "libnfs"; then
+      libnfs_found="yes"
+    # libnfs >= 6.0.0 may be built with TLS support using gnutls, but
+    # some versions do not list it in their pkg-config file.
+    elif $(pkg-config gnutls > /dev/null 2>&1); then
+      libnfs_cflags="$libnfs_cflags $(pkg-config --cflags gnutls)"
+      libnfs_libs="$libnfs_libs $(pkg-config --libs gnutls)"
+      if compile_prog "$libnfs_cflags" "$libnfs_libs" "libnfs with gnutls"; then
+        libnfs_found="yes"
+      fi
+    fi
+    if test "$libnfs_found" = "yes" ; then
+      libnfs="yes"
+    else
+      if test "$libnfs" = "yes" ; then
+        feature_not_found "libnfs" "libnfs (and gnutls if libnfs was built with TLS)"
       fi
+      libnfs="no"
     fi
   else
     if test "$libnfs" = "yes" ; then
iolog.c +22 -4
index 0926053d..166d2fc4 100644
@@ -451,6 +451,25 @@ int64_t iolog_items_to_fetch(struct thread_data *td)
 #define file_act(_td, _r) (((_td)->io_log_version == 3 && (r) == 3) || \
 					((_td)->io_log_version == 2 && (r) == 2))
 
+/*
+ * Parse one line of a version 2 or 3 iolog. Returns the number of fields
+ * parsed, which io_act() and file_act() use to tell file I/O actions from
+ * file management actions.
+ */
+static int parse_iolog_line(struct thread_data *td, const char *p,
+			    unsigned long long *ttime, char *fname, char *act,
+			    unsigned long long *offset, unsigned int *bytes)
+{
+	switch (td->io_log_version) {
+	case 3:
+		return sscanf(p, "%llu %256s %256s %llu %u", ttime, fname, act,
+			      offset, bytes);
+	default: /* version 2 */
+		return sscanf(p, "%256s %256s %llu %u", fname, act, offset,
+			      bytes);
+	}
+}
+
 /*
  * Read version 2 and 3 iolog data. It is enhanced to include per-file logging,
  * syncs, etc.
@@ -488,9 +507,9 @@ static bool read_iolog(struct thread_data *td)
 		int r;
 		unsigned long long ttime;
 
+		r = parse_iolog_line(td, p, &ttime, rfname, act, &offset,
+				     &bytes);
 		if (td->io_log_version == 3) {
-			r = sscanf(p, "%llu %256s %256s %llu %u", &ttime, rfname, act,
-							&offset, &bytes);
 			delay = delay_since_ttime(td, ttime);
 			td->io_log_last_ttime = ttime;
 			/*
@@ -501,8 +520,7 @@ static bool read_iolog(struct thread_data *td)
 					" version 3 for file %s\n", fname);
 				continue;
 			}
-		} else /* version 2 */
-			r = sscanf(p, "%256s %256s %llu %u", rfname, act, &offset, &bytes);
+		}
 
 		if (td->o.replay_redirect)
 			fname = td->o.replay_redirect;