Recent changes (gfio)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following changes since commit 29df29eaf88958c8741103d2056a4773d4959d9d:

  Merge branch 'master' into gfio (2013-02-21 20:13:57 +0100)

are available in the git repository at:

  git://git.kernel.dk/fio.git gfio

Bruce Cran (2):
      Add section 9 to HOWTO table of contents.
      Add LICENSE to Windows installer, fix filename extensions and update URL.

Jens Axboe (21):
      Add --eta-newline option
      Merge branch 'master' of ssh://brick.kernel.dk/data/git/fio
      gettime: add some sanity checks to platform clock
      Fixup wrong types for dprint()
      gettime: use 32-bit atomic sequences
      debug: only do getpid() if we have to
      debug: make __dprint() have printf() like argument type checking
      gettime: print 64-bit variable with ULL
      powerpc: use ATB clock, if it's available
      powerpc: harden the clock ATB probe a bit
      configure: use `foo` instead of $(foo)
      Merge branch 'master' of ssh://brick.kernel.dk/data/git/fio
      FIO-VERSION-GEN: use `foo` instead of $(foo)
      Revert "debug: only do getpid() if we have to"
      net: fix warning for systems without TCP_NODELAY
      Fix compile of RDMA engine for SunOS 5.x
      Merge branch 'master' of ssh://brick.kernel.dk/data/git/fio
      solaris: ensure that TCP_NODELAY gets picked up
      configure: add general libs for Solaris
      configure: fixup __sync_fetch_and_add()
      Merge branch 'master' into gfio

Steven Noonan (1):
      powerpc: use mfspr for Time Base Register reads

 FIO-VERSION-GEN        |   10 ++++----
 HOWTO                  |    3 +-
 Makefile               |    2 +-
 README                 |    1 +
 arch/arch-ppc.h        |   57 +++++++++++++++++++++++++++++++++++++++++++++--
 arch/arch.h            |    2 +
 configure              |   29 +++++++++++++++++++++---
 debug.h                |    2 +-
 engines/net.c          |   10 +++++---
 engines/rdma.c         |   46 +++++++++++++++++++++++---------------
 eta.c                  |   18 ++++++++++++++-
 filesetup.c            |    9 ++++---
 fio.h                  |    1 +
 gettime.c              |   52 ++++++++++++++++++++++++++++++++-----------
 init.c                 |   20 ++++++++++++++++
 io_u.c                 |   19 ++++++++++------
 memory.c               |   12 ++++++----
 os/windows/install.wxs |   14 +++++++----
 server.c               |    5 ++-
 19 files changed, 238 insertions(+), 74 deletions(-)

---

Diff of recent changes:

diff --git a/FIO-VERSION-GEN b/FIO-VERSION-GEN
index 85e6f4a..6811d29 100755
--- a/FIO-VERSION-GEN
+++ b/FIO-VERSION-GEN
@@ -10,14 +10,14 @@ LF='
 # then try git-describe, then default.
 if test -f version
 then
-	VN=$(cat version) || VN="$DEF_VER"
+	VN=`cat version` || VN="$DEF_VER"
 elif test -d .git -o -f .git &&
-	VN=$(git describe --match "fio-[0-9]*" --abbrev=4 HEAD 2>/dev/null) &&
+	VN=`git describe --match "fio-[0-9]*" --abbrev=4 HEAD 2>/dev/null` &&
 	case "$VN" in
 	*$LF*) (exit 1) ;;
 	v[0-9]*)
 		git update-index -q --refresh
-		test -z "$(git diff-index --name-only HEAD --)" ||
+		test -z "`git diff-index --name-only HEAD --`" ||
 		VN="$VN-dirty" ;;
 	esac
 then
@@ -26,11 +26,11 @@ else
 	VN="$DEF_VER"
 fi
 
-VN=$(expr "$VN" : v*'\(.*\)')
+VN=`expr "$VN" : v*'\(.*\)'`
 
 if test -r $GVF
 then
-	VC=$(sed -e 's/^FIO_VERSION = //' <$GVF)
+	VC=`sed -e 's/^FIO_VERSION = //' <$GVF`
 else
 	VC=unset
 fi
diff --git a/HOWTO b/HOWTO
index 1441734..9ac485b 100644
--- a/HOWTO
+++ b/HOWTO
@@ -9,6 +9,7 @@ Table of contents
 6. Normal output
 7. Terse output
 8. Trace file format
+9. CPU idleness profiling
 
 1.0 Overview and history
 ------------------------
@@ -775,7 +776,7 @@ random_generator=str	Fio supports the following engines for generating
 		block sizes, not with workloads that use multiple block
 		sizes. If used with such a workload, fio may read or write
 		some blocks multiple times.
-		
+
 nice=int	Run the job with the given nice value. See man nice(2).
 
 prio=int	Set the io priority value of this job. Linux limits us to
diff --git a/Makefile b/Makefile
index 8eb2f45..4b19a59 100644
--- a/Makefile
+++ b/Makefile
@@ -96,7 +96,7 @@ ifeq ($(UNAME), Android)
   LDFLAGS += -rdynamic
 endif
 ifeq ($(UNAME), SunOS)
-  LIBS	 += -lpthread -ldl -laio -lrt -lnsl -lsocket
+  LIBS	 += -lpthread -ldl
   CPPFLAGS += -D__EXTENSIONS__
 endif
 ifeq ($(UNAME), FreeBSD)
diff --git a/README b/README
index 4f796e3..b662e71 100644
--- a/README
+++ b/README
@@ -152,6 +152,7 @@ $ fio
 				writes
 	--eta=when		When ETA estimate should be printed
 				May be "always", "never" or "auto"
+	--eta-newline=time	Force a new line for every 'time' period passed
 	--section=name		Only run specified section in job file.
 				Multiple sections can be specified.
 	--alloc-size=kb		Set smalloc pool to this size in kb (def 1024)
diff --git a/arch/arch-ppc.h b/arch/arch-ppc.h
index e73093d..65e6b74 100644
--- a/arch/arch-ppc.h
+++ b/arch/arch-ppc.h
@@ -1,6 +1,11 @@
 #ifndef ARCH_PPC_H
 #define ARCH_PPH_H
 
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
 #define FIO_ARCH	(arch_ppc)
 
 #ifndef __NR_ioprio_set
@@ -43,26 +48,72 @@ static inline int arch_ffz(unsigned long bitmask)
 	return  __ilog2(bitmask & -bitmask);
 }
 
+static inline unsigned int mfspr(unsigned int reg)
+{
+	unsigned int val;
+
+	asm volatile("mfspr %0,%1": "=r" (val) : "K" (reg));
+	return val;
+}
+
+#define SPRN_TBRL  0x10C /* Time Base Register Lower */
+#define SPRN_TBRU  0x10D /* Time Base Register Upper */
+#define SPRN_ATBL  0x20E /* Alternate Time Base Lower */
+#define SPRN_ATBU  0x20F /* Alternate Time Base Upper */
+
 static inline unsigned long long get_cpu_clock(void)
 {
 	unsigned int tbl, tbu0, tbu1;
 	unsigned long long ret;
 
 	do {
-		__asm__ __volatile__ ("mftbu %0" : "=r"(tbu0));
-		__asm__ __volatile__ ("mftb %0"  : "=r"(tbl) );
-		__asm__ __volatile__ ("mftbu %0" : "=r"(tbu1));
+		if (arch_flags & ARCH_FLAG_1) {
+			tbu0 = mfspr(SPRN_ATBU);
+			tbl = mfspr(SPRN_ATBL);
+			tbu1 = mfspr(SPRN_ATBU);
+		} else {
+			tbu0 = mfspr(SPRN_TBRU);
+			tbl = mfspr(SPRN_TBRL);
+			tbu1 = mfspr(SPRN_TBRU);
+		}
 	} while (tbu0 != tbu1);
 
 	ret = (((unsigned long long)tbu0) << 32) | tbl;
 	return ret;
 }
 
+static void atb_child(void)
+{
+	arch_flags |= ARCH_FLAG_1;
+	get_cpu_clock();
+	_exit(0);
+}
+
+static void atb_clocktest(void)
+{
+	pid_t pid;
+
+	pid = fork();
+	if (!pid)
+		atb_child();
+	else if (pid != -1) {
+		int status;
+
+		pid = wait(&status);
+		if (pid == -1 || !WIFEXITED(status))
+			arch_flags &= ~ARCH_FLAG_1;
+		else
+			arch_flags |= ARCH_FLAG_1;
+	}
+}
+
 #define ARCH_HAVE_INIT
 extern int tsc_reliable;
+
 static inline int arch_init(char *envp[])
 {
 	tsc_reliable = 1;
+	atb_clocktest();
 	return 0;
 }
 
diff --git a/arch/arch.h b/arch/arch.h
index 4165c9f..31d96d4 100644
--- a/arch/arch.h
+++ b/arch/arch.h
@@ -27,6 +27,8 @@ enum {
 	ARCH_FLAG_4	= 1 << 3,
 };
 
+extern unsigned long arch_flags;
+
 #if defined(__i386__)
 #include "arch-x86.h"
 #elif defined(__x86_64__)
diff --git a/configure b/configure
index 71faf91..5d576e1 100755
--- a/configure
+++ b/configure
@@ -87,7 +87,7 @@ compile_object() {
 
 compile_prog() {
   local_cflags="$1"
-  local_ldflags="$2"
+  local_ldflags="$2 $LIBS"
   echo "Compiling test case $3" >> config.log
   do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
 }
@@ -199,6 +199,7 @@ SunOS)
   if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
     cpu="x86_64"
   fi
+  LIBS="-lnsl -lsocket"
   ;;
 CYGWIN*)
   echo "Forcing known good options on Windows"
@@ -355,7 +356,7 @@ int main(void)
 }
 EOF
 if compile_prog "" "" "wordsize"; then
-  wordsize=$($TMPE)
+  wordsize=`$TMPE`
 fi
 echo "Wordsize                      $wordsize"
 
@@ -451,7 +452,7 @@ sfaa="no"
 cat > $TMPC << EOF
 static int sfaa(int *ptr)
 {
-  return __sync_fetch_and_and(ptr, 0);
+  return __sync_fetch_and_add(ptr, 0);
 }
 
 int main(int argc, char **argv)
@@ -464,7 +465,7 @@ EOF
 if compile_prog "" "" "__sync_fetch_and_add()" ; then
     sfaa="yes"
 fi
-echo "__sync_fetch_and add          $sfaa"
+echo "__sync_fetch_and_add          $sfaa"
 
 ##########################################
 # libverbs probe
@@ -957,6 +958,23 @@ if compile_prog "" "" "TCP_NODELAY"; then
 fi
 echo "TCP_NODELAY                   $tcp_nodelay"
 
+##########################################
+# Check whether we have RLIMIT_MEMLOCK
+rlimit_memlock="no"
+cat > $TMPC << EOF
+#include <sys/time.h>
+#include <sys/resource.h>
+int main(int argc, char **argv)
+{
+  struct rlimit rl;
+  return getrlimit(RLIMIT_MEMLOCK, &rl);
+}
+EOF
+if compile_prog "" "" "RLIMIT_MEMLOCK"; then
+  rlimit_memlock="yes"
+fi
+echo "RLIMIT_MEMLOCK                $rlimit_memlock"
+
 #############################################################################
 
 echo "# Automatically generated by configure - do not modify" > $config_host_mak
@@ -1068,6 +1086,9 @@ fi
 if test "$tcp_nodelay" = "yes" ; then
   output_sym "CONFIG_TCP_NODELAY"
 fi
+if test "$rlimit_memlock" = "yes" ; then
+  output_sym "CONFIG_RLIMIT_MEMLOCK"
+fi
 
 echo "LIBS+=$LIBS" >> $config_host_mak
 echo "CFLAGS+=$CFLAGS" >> $config_host_mak
diff --git a/debug.h b/debug.h
index b55a1e4..6a74131 100644
--- a/debug.h
+++ b/debug.h
@@ -35,7 +35,7 @@ extern struct debug_level debug_levels[];
 
 extern unsigned long fio_debug;
 
-void __dprint(int type, const char *str, ...);
+void __dprint(int type, const char *str, ...) __attribute__((format (printf, 2, 3)));
 
 #define dprint(type, str, args...)			\
 	do {						\
diff --git a/engines/net.c b/engines/net.c
index 12f49a2..a70e56e 100644
--- a/engines/net.c
+++ b/engines/net.c
@@ -466,7 +466,7 @@ static int fio_netio_connect(struct thread_data *td, struct fio_file *f)
 {
 	struct netio_data *nd = td->io_ops->data;
 	struct netio_options *o = td->eo;
-	int type, domain, optval;
+	int type, domain;
 
 	if (o->proto == FIO_TYPE_TCP) {
 		domain = AF_INET;
@@ -491,7 +491,8 @@ static int fio_netio_connect(struct thread_data *td, struct fio_file *f)
 
 #ifdef CONFIG_TCP_NODELAY
 	if (o->nodelay && o->proto == FIO_TYPE_TCP) {
-		optval = 1;
+		int optval = 1;
+
 		if (setsockopt(f->fd, IPPROTO_TCP, TCP_NODELAY, (void *) &optval, sizeof(int)) < 0) {
 			log_err("fio: cannot set TCP_NODELAY option on socket (%s), disable with 'nodelay=0'\n", strerror(errno));
 			return 1;
@@ -530,7 +531,7 @@ static int fio_netio_accept(struct thread_data *td, struct fio_file *f)
 	struct netio_data *nd = td->io_ops->data;
 	struct netio_options *o = td->eo;
 	socklen_t socklen = sizeof(nd->addr);
-	int state, optval;
+	int state;
 
 	if (o->proto == FIO_TYPE_UDP) {
 		f->fd = nd->listenfd;
@@ -553,7 +554,8 @@ static int fio_netio_accept(struct thread_data *td, struct fio_file *f)
 
 #ifdef CONFIG_TCP_NODELAY
 	if (o->nodelay && o->proto == FIO_TYPE_TCP) {
-		optval = 1;
+		int optval = 1;
+
 		if (setsockopt(f->fd, IPPROTO_TCP, TCP_NODELAY, (void *) &optval, sizeof(int)) < 0) {
 			log_err("fio: cannot set TCP_NODELAY option on socket (%s), disable with 'nodelay=0'\n", strerror(errno));
 			return 1;
diff --git a/engines/rdma.c b/engines/rdma.c
index e1fb380..ea1af2b 100644
--- a/engines/rdma.c
+++ b/engines/rdma.c
@@ -36,7 +36,6 @@
 #include <sys/time.h>
 #include <sys/resource.h>
 
-#include <byteswap.h>
 #include <pthread.h>
 #include <inttypes.h>
 
@@ -1013,26 +1012,11 @@ static int fio_rdmaio_setup_listen(struct thread_data *td, short port)
 	return 0;
 }
 
-static int fio_rdmaio_init(struct thread_data *td)
+static int check_set_rlimits(struct thread_data *td)
 {
-	struct rdmaio_data *rd = td->io_ops->data;
-	struct flist_head *entry;
-	unsigned int max_bs;
-	unsigned int port;
-	char host[64], buf[128];
-	char *sep, *portp, *modep;
-	int ret, i = 0;
+#ifdef CONFIG_RLIMIT_MEMLOCK
 	struct rlimit rl;
 
-	if (td_rw(td)) {
-		log_err("fio: rdma connections must be read OR write\n");
-		return 1;
-	}
-	if (td_random(td)) {
-		log_err("fio: RDMA network IO can't be random\n");
-		return 1;
-	}
-
 	/* check RLIMIT_MEMLOCK */
 	if (getrlimit(RLIMIT_MEMLOCK, &rl) != 0) {
 		log_err("fio: getrlimit fail: %d(%s)\n",
@@ -1057,6 +1041,32 @@ static int fio_rdmaio_init(struct thread_data *td)
 			return 1;
 		}
 	}
+#endif
+
+	return 0;
+}
+
+static int fio_rdmaio_init(struct thread_data *td)
+{
+	struct rdmaio_data *rd = td->io_ops->data;
+	struct flist_head *entry;
+	unsigned int max_bs;
+	unsigned int port;
+	char host[64], buf[128];
+	char *sep, *portp, *modep;
+	int ret, i = 0;
+
+	if (td_rw(td)) {
+		log_err("fio: rdma connections must be read OR write\n");
+		return 1;
+	}
+	if (td_random(td)) {
+		log_err("fio: RDMA network IO can't be random\n");
+		return 1;
+	}
+
+	if (check_set_rlimits(td))
+		return 1;
 
 	strcpy(buf, td->o.filename);
 
diff --git a/eta.c b/eta.c
index a724fe6..531b876 100644
--- a/eta.c
+++ b/eta.c
@@ -422,12 +422,13 @@ int calc_thread_status(struct jobs_eta *je, int force)
 
 	je->nr_threads = thread_number;
 	memcpy(je->run_str, run_str, thread_number * sizeof(char));
-
 	return 1;
 }
 
 void display_thread_status(struct jobs_eta *je)
 {
+	static struct timeval disp_eta_new_line;
+	static int eta_new_line_init, eta_new_line_pending;
 	static int linelen_last;
 	static int eta_good;
 	char output[REAL_MAX_JOBS + 512], *p = output;
@@ -439,6 +440,11 @@ void display_thread_status(struct jobs_eta *je)
 		eta_to_str(eta_str, je->eta_sec);
 	}
 
+	if (eta_new_line_pending) {
+		eta_new_line_pending = 0;
+		p += sprintf(p, "\n");
+	}
+
 	p += sprintf(p, "Jobs: %d (f=%d)", je->nr_running, je->files_open);
 	if (je->m_rate[0] || je->m_rate[1] || je->t_rate[0] || je->t_rate[1]) {
 		char *tr, *mr;
@@ -495,6 +501,16 @@ void display_thread_status(struct jobs_eta *je)
 	p += sprintf(p, "\r");
 
 	printf("%s", output);
+
+	if (!eta_new_line_init) {
+		fio_gettime(&disp_eta_new_line, NULL);
+		eta_new_line_init = 1;
+	} else if (eta_new_line &&
+		   mtime_since_now(&disp_eta_new_line) > eta_new_line * 1000) {
+		fio_gettime(&disp_eta_new_line, NULL);
+		eta_new_line_pending = 1;
+	}
+
 	fflush(stdout);
 }
 
diff --git a/filesetup.c b/filesetup.c
index 4e82854..422d706 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -79,7 +79,8 @@ static int extend_file(struct thread_data *td, struct fio_file *f)
 			break;
 		case FIO_FALLOCATE_POSIX:
 			dprint(FD_FILE, "posix_fallocate file %s size %llu\n",
-				 f->file_name, f->real_file_size);
+				 f->file_name,
+				 (unsigned long long) f->real_file_size);
 
 			r = posix_fallocate(f->fd, 0, f->real_file_size);
 			if (r > 0) {
@@ -91,8 +92,8 @@ static int extend_file(struct thread_data *td, struct fio_file *f)
 		case FIO_FALLOCATE_KEEP_SIZE:
 			dprint(FD_FILE,
 				"fallocate(FALLOC_FL_KEEP_SIZE) "
-				"file %s size %llu\n",
-				f->file_name, f->real_file_size);
+				"file %s size %llu\n", f->file_name,
+				(unsigned long long) f->real_file_size);
 
 			r = fallocate(f->fd, FALLOC_FL_KEEP_SIZE, 0,
 					f->real_file_size);
@@ -118,7 +119,7 @@ static int extend_file(struct thread_data *td, struct fio_file *f)
 	 */
 	if (!td->o.fill_device) {
 		dprint(FD_FILE, "truncate file %s, size %llu\n", f->file_name,
-							f->real_file_size);
+					(unsigned long long) f->real_file_size);
 		if (ftruncate(f->fd, f->real_file_size) == -1) {
 			td_verror(td, errno, "ftruncate");
 			goto err;
diff --git a/fio.h b/fio.h
index 2d75213..5805fcb 100644
--- a/fio.h
+++ b/fio.h
@@ -349,6 +349,7 @@ extern int temp_stall_ts;
 extern uintptr_t page_mask, page_size;
 extern int read_only;
 extern int eta_print;
+extern int eta_new_line;
 extern unsigned long done_secs;
 extern char *job_section;
 extern int fio_gtod_offload;
diff --git a/gettime.c b/gettime.c
index 5b85a23..4c998e5 100644
--- a/gettime.c
+++ b/gettime.c
@@ -262,7 +262,7 @@ static unsigned long get_cycles_per_usec(void)
 
 #define NR_TIME_ITERS	50
 
-static void calibrate_cpu_clock(void)
+static int calibrate_cpu_clock(void)
 {
 	double delta, mean, S;
 	uint64_t avg, cycles[NR_TIME_ITERS];
@@ -279,6 +279,13 @@ static void calibrate_cpu_clock(void)
 		}
 	}
 
+	/*
+	 * The most common platform clock breakage is returning zero
+	 * indefinitely. Check for that and return failure.
+	 */
+	if (!cycles[0] && !cycles[NR_TIME_ITERS - 1])
+		return 1;
+
 	S = sqrt(S / (NR_TIME_ITERS - 1.0));
 
 	samples = avg = 0;
@@ -295,20 +302,23 @@ static void calibrate_cpu_clock(void)
 	mean /= 10.0;
 
 	for (i = 0; i < NR_TIME_ITERS; i++)
-		dprint(FD_TIME, "cycles[%d]=%lu\n", i, cycles[i] / 10);
+		dprint(FD_TIME, "cycles[%d]=%llu\n", i,
+					(unsigned long long) cycles[i] / 10);
 
 	avg /= samples;
 	avg = (avg + 5) / 10;
-	dprint(FD_TIME, "avg: %lu\n", avg);
+	dprint(FD_TIME, "avg: %llu\n", (unsigned long long) avg);
 	dprint(FD_TIME, "mean=%f, S=%f\n", mean, S);
 
 	cycles_per_usec = avg;
 	inv_cycles_per_usec = 16777216UL / cycles_per_usec;
 	dprint(FD_TIME, "inv_cycles_per_usec=%lu\n", inv_cycles_per_usec);
+	return 0;
 }
 #else
-static void calibrate_cpu_clock(void)
+static int calibrate_cpu_clock(void)
 {
+	return 1;
 }
 #endif
 
@@ -343,7 +353,9 @@ void fio_clock_init(void)
 #endif
 
 	fio_clock_source_inited = fio_clock_source;
-	calibrate_cpu_clock();
+
+	if (calibrate_cpu_clock())
+		tsc_reliable = 0;
 
 	/*
 	 * If the arch sets tsc_reliable != 0, then it must be good enough
@@ -429,9 +441,9 @@ uint64_t time_since_now(struct timeval *s)
 #define CLOCK_ENTRIES	100000
 
 struct clock_entry {
-	uint64_t seq;
+	uint32_t seq;
+	uint32_t cpu;
 	uint64_t tsc;
-	uint64_t cpu;
 };
 
 struct clock_thread {
@@ -439,11 +451,11 @@ struct clock_thread {
 	int cpu;
 	pthread_mutex_t lock;
 	pthread_mutex_t started;
-	uint64_t *seq;
+	uint32_t *seq;
 	struct clock_entry *entries;
 };
 
-static inline uint64_t atomic64_inc_return(uint64_t *seq)
+static inline uint32_t atomic32_inc_return(uint32_t *seq)
 {
 	return 1 + __sync_fetch_and_add(seq, 1);
 }
@@ -453,6 +465,7 @@ static void *clock_thread_fn(void *data)
 	struct clock_thread *t = data;
 	struct clock_entry *c;
 	os_cpu_mask_t cpu_mask;
+	uint32_t last_seq;
 	int i;
 
 	memset(&cpu_mask, 0, sizeof(cpu_mask));
@@ -466,13 +479,17 @@ static void *clock_thread_fn(void *data)
 	pthread_mutex_lock(&t->lock);
 	pthread_mutex_unlock(&t->started);
 
+	last_seq = 0;
 	c = &t->entries[0];
 	for (i = 0; i < CLOCK_ENTRIES; i++, c++) {
-		uint64_t seq, tsc;
+		uint32_t seq;
+		uint64_t tsc;
 
 		c->cpu = t->cpu;
 		do {
-			seq = atomic64_inc_return(t->seq);
+			seq = atomic32_inc_return(t->seq);
+			if (seq < last_seq)
+				break;
 			tsc = get_cpu_clock();
 		} while (seq != *t->seq);
 
@@ -480,7 +497,16 @@ static void *clock_thread_fn(void *data)
 		c->tsc = tsc;
 	}
 
-	log_info("cs: cpu%3d: %lu clocks seen\n", t->cpu, t->entries[CLOCK_ENTRIES - 1].tsc - t->entries[0].tsc);
+	log_info("cs: cpu%3d: %llu clocks seen\n", t->cpu,
+		(unsigned long long) t->entries[i - 1].tsc - t->entries[0].tsc);
+
+	/*
+	 * The most common platform clock breakage is returning zero
+	 * indefinitely. Check for that and return failure.
+	 */
+	if (!t->entries[i - 1].tsc && !t->entries[0].tsc)
+		return (void *) 1;
+
 	return NULL;
 }
 
@@ -502,7 +528,7 @@ int fio_monotonic_clocktest(void)
 	struct clock_entry *entries;
 	unsigned long tentries, failed;
 	struct clock_entry *prev, *this;
-	uint64_t seq = 0;
+	uint32_t seq = 0;
 	int i;
 
 	log_info("cs: reliable_tsc: %s\n", tsc_reliable ? "yes" : "no");
diff --git a/init.c b/init.c
index 8ec1eb9..347d1e9 100644
--- a/init.c
+++ b/init.c
@@ -41,6 +41,8 @@ struct thread_data *threads = NULL;
 int exitall_on_terminate = 0;
 int output_format = FIO_OUTPUT_NORMAL;
 int eta_print = FIO_ETA_AUTO;
+int eta_new_line = 0;
+unsigned long long mlock_size = 0;
 FILE *f_out = NULL;
 FILE *f_err = NULL;
 char **job_sections = NULL;
@@ -139,6 +141,11 @@ static struct option l_opts[FIO_NR_OPTIONS] = {
 		.val		= 'e' | FIO_CLIENT_FLAG,
 	},
 	{
+		.name		= (char *) "eta-newline",
+		.has_arg	= required_argument,
+		.val		= 'E' | FIO_CLIENT_FLAG,
+	},
+	{
 		.name		= (char *) "debug",
 		.has_arg	= required_argument,
 		.val		= 'd' | FIO_CLIENT_FLAG,
@@ -1264,6 +1271,8 @@ static void usage(const char *name)
 	printf("  --showcmd\t\tTurn a job file into command line options\n");
 	printf("  --eta=when\t\tWhen ETA estimate should be printed\n");
 	printf("            \t\tMay be \"always\", \"never\" or \"auto\"\n");
+	printf("  --eta-newline=time\tForce a new line for every 'time'");
+	printf(" period passed\n");
 	printf("  --readonly\t\tTurn on safety read-only checks, preventing"
 		" writes\n");
 	printf("  --section=name\tOnly run specified section in job file\n");
@@ -1547,6 +1556,17 @@ int parse_cmd_line(int argc, char *argv[], int client_type)
 			else if (!strcmp("never", optarg))
 				eta_print = FIO_ETA_NEVER;
 			break;
+		case 'E': {
+			long long t = 0;
+
+			if (str_to_decimal(optarg, &t, 0, NULL)) {
+				log_err("fio: failed parsing eta time %s\n", optarg);
+				exit_val = 1;
+				do_exit++;
+			}
+			eta_new_line = t;
+			break;
+			}
 		case 'd':
 			if (set_debug(optarg))
 				do_exit++;
diff --git a/io_u.c b/io_u.c
index 1013c7f..e474b48 100644
--- a/io_u.c
+++ b/io_u.c
@@ -101,7 +101,7 @@ static int __get_next_rand_offset(struct thread_data *td, struct fio_file *f,
 			r = __rand(&td->__random_state);
 		}
 
-		dprint(FD_RANDOM, "off rand %llu\n", r);
+		dprint(FD_RANDOM, "off rand %llu\n", (unsigned long long) r);
 
 		*b = (lastb - 1) * (r / ((uint64_t) rmax + 1.0));
 	} else {
@@ -125,7 +125,8 @@ static int __get_next_rand_offset(struct thread_data *td, struct fio_file *f,
 	if (random_map_free(f, *b))
 		goto ret;
 
-	dprint(FD_RANDOM, "get_next_rand_offset: offset %llu busy\n", *b);
+	dprint(FD_RANDOM, "get_next_rand_offset: offset %llu busy\n",
+						(unsigned long long) *b);
 
 	*b = axmap_next_free(f->io_axmap, *b);
 	if (*b == (uint64_t) -1ULL)
@@ -242,7 +243,8 @@ static int get_next_rand_block(struct thread_data *td, struct fio_file *f,
 	}
 
 	dprint(FD_IO, "%s: rand offset failed, last=%llu, size=%llu\n",
-			f->file_name, f->last_pos, f->real_file_size);
+			f->file_name, (unsigned long long) f->last_pos,
+			(unsigned long long) f->real_file_size);
 	return 1;
 }
 
@@ -344,14 +346,16 @@ static int __get_next_offset(struct thread_data *td, struct io_u *io_u)
 
 	if (io_u->offset >= f->io_size) {
 		dprint(FD_IO, "get_next_offset: offset %llu >= io_size %llu\n",
-					io_u->offset, f->io_size);
+					(unsigned long long) io_u->offset,
+					(unsigned long long) f->io_size);
 		return 1;
 	}
 
 	io_u->offset += f->file_offset;
 	if (io_u->offset >= f->real_file_size) {
 		dprint(FD_IO, "get_next_offset: offset %llu >= size %llu\n",
-					io_u->offset, f->real_file_size);
+					(unsigned long long) io_u->offset,
+					(unsigned long long) f->real_file_size);
 		return 1;
 	}
 
@@ -716,8 +720,9 @@ static int fill_io_u(struct thread_data *td, struct io_u *io_u)
 
 	if (io_u->offset + io_u->buflen > io_u->file->real_file_size) {
 		dprint(FD_IO, "io_u %p, offset too large\n", io_u);
-		dprint(FD_IO, "  off=%llu/%lu > %llu\n", io_u->offset,
-				io_u->buflen, io_u->file->real_file_size);
+		dprint(FD_IO, "  off=%llu/%lu > %llu\n",
+			(unsigned long long) io_u->offset, io_u->buflen,
+			(unsigned long long) io_u->file->real_file_size);
 		return 1;
 	}
 
diff --git a/memory.c b/memory.c
index e969221..f1cd2d7 100644
--- a/memory.c
+++ b/memory.c
@@ -153,8 +153,8 @@ static int alloc_mem_mmap(struct thread_data *td, size_t total_mem)
 
 	td->orig_buffer = mmap(NULL, total_mem, PROT_READ | PROT_WRITE, flags,
 				td->mmapfd, 0);
-	dprint(FD_MEM, "mmap %u/%d %p\n", total_mem, td->mmapfd,
-						td->orig_buffer);
+	dprint(FD_MEM, "mmap %llu/%d %p\n", (unsigned long long) total_mem,
+						td->mmapfd, td->orig_buffer);
 	if (td->orig_buffer == MAP_FAILED) {
 		td_verror(td, errno, "mmap");
 		td->orig_buffer = NULL;
@@ -171,7 +171,8 @@ static int alloc_mem_mmap(struct thread_data *td, size_t total_mem)
 
 static void free_mem_mmap(struct thread_data *td, size_t total_mem)
 {
-	dprint(FD_MEM, "munmap %u %p\n", total_mem, td->orig_buffer);
+	dprint(FD_MEM, "munmap %llu %p\n", (unsigned long long) total_mem,
+						td->orig_buffer);
 	munmap(td->orig_buffer, td->orig_buffer_size);
 	if (td->o.mmapfile) {
 		close(td->mmapfd);
@@ -183,7 +184,8 @@ static void free_mem_mmap(struct thread_data *td, size_t total_mem)
 static int alloc_mem_malloc(struct thread_data *td, size_t total_mem)
 {
 	td->orig_buffer = malloc(total_mem);
-	dprint(FD_MEM, "malloc %u %p\n", total_mem, td->orig_buffer);
+	dprint(FD_MEM, "malloc %llu %p\n", (unsigned long long) total_mem,
+							td->orig_buffer);
 
 	return td->orig_buffer == NULL;
 }
@@ -214,7 +216,7 @@ int allocate_io_mem(struct thread_data *td)
 			total_mem += td->o.mem_align - page_size;
 	}
 
-	dprint(FD_MEM, "Alloc %lu for buffers\n", (size_t) total_mem);
+	dprint(FD_MEM, "Alloc %llu for buffers\n", (unsigned long long) total_mem);
 
 	if (td->o.mem_type == MEM_MALLOC)
 		ret = alloc_mem_malloc(td, total_mem);
diff --git a/os/windows/install.wxs b/os/windows/install.wxs
index 5b4b939..37216b4 100755
--- a/os/windows/install.wxs
+++ b/os/windows/install.wxs
@@ -30,16 +30,19 @@
 							<File KeyPath="yes" Source="..\..\pthreadGC2.dll"/>
 						</Component>
 						<Component>
-							<File Id="README" Name="README.rtf" Source="..\..\README"/>
+							<File Id="README" Name="README.txt" Source="..\..\README"/>
 						</Component>
 						<Component>
-							<File Id="REPORTING_BUGS" Name="REPORTING-BUGS.rtf" Source="..\..\REPORTING-BUGS"/>
+							<File Id="REPORTING_BUGS" Name="REPORTING-BUGS.txt" Source="..\..\REPORTING-BUGS"/>
 						</Component>
 						<Component>
-							<File Id="HOWTO" Name="HOWTO.rtf" Source="..\..\HOWTO"/>
+							<File Id="HOWTO" Name="HOWTO.txt" Source="..\..\HOWTO"/>
 						</Component>
 						<Component>
-							<File Id="COPYING" Name="COPYING.rtf" Source="..\..\COPYING"/>
+							<File Id="COPYING" Name="COPYING.txt" Source="..\..\COPYING"/>
+						</Component>
+						<Component>
+							<File Id="LICENSE" Name="LICENSE.txt" Source="..\..\LICENSE"/>
 						</Component>
 						<Directory Id="examples" Name="examples"/>
 					</Directory>
@@ -54,13 +57,14 @@
 		<ComponentRef Id="README"/>
 		<ComponentRef Id="REPORTING_BUGS"/>
 		<ComponentRef Id="COPYING"/>
+		<ComponentRef Id="LICENSE"/>
 		<ComponentGroupRef Id="examples"/>
 	</Feature>
 
 	<Property Id="ARPURLINFOABOUT" Value="http://git.kernel.dk/?p=fio.git"; />
 	<Property Id='ARPCONTACT'>fio@xxxxxxxxxxxxxxx</Property>
 	<Property Id='ARPHELPLINK'>http://www.spinics.net/lists/fio/</Property>
-	<Property Id='ARPURLUPDATEINFO'>http://git.kernel.dk/?p=fio.git</Property>
+	<Property Id='ARPURLUPDATEINFO'>http://bluestop.org/fio/</Property>
 
 	<WixVariable Id="WixUILicenseRtf" Value="eula.rtf" />
 
diff --git a/server.c b/server.c
index 8e5ca50..b7e9922 100644
--- a/server.c
+++ b/server.c
@@ -712,8 +712,9 @@ static int handle_command(struct fio_net_cmd *cmd)
 {
 	int ret;
 
-	dprint(FD_NET, "server: got op [%s], pdu=%u, tag=%lx\n",
-			fio_server_op(cmd->opcode), cmd->pdu_len, cmd->tag);
+	dprint(FD_NET, "server: got op [%s], pdu=%u, tag=%llx\n",
+			fio_server_op(cmd->opcode), cmd->pdu_len,
+			(unsigned long long) cmd->tag);
 
 	switch (cmd->opcode) {
 	case FIO_NET_CMD_QUIT:
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux