Hello community, here is the log from the commit of package fio for openSUSE:Factory checked in at 2016-06-19 10:49:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/fio (Old) and /work/SRC/openSUSE:Factory/.fio.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "fio" Changes: -------- --- /work/SRC/openSUSE:Factory/fio/fio.changes 2016-05-29 03:14:33.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.fio.new/fio.changes 2016-06-19 10:50:03.000000000 +0200 @@ -1,0 +2,6 @@ +Thu Jun 16 13:53:38 UTC 2016 - mplus...@suse.com + +- Update to version 2.12: + * No changelog available + +------------------------------------------------------------------- Old: ---- fio-2.11.tar.bz2 New: ---- fio-2.12.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ fio.spec ++++++ --- /var/tmp/diff_new_pack.9nivLb/_old 2016-06-19 10:50:04.000000000 +0200 +++ /var/tmp/diff_new_pack.9nivLb/_new 2016-06-19 10:50:04.000000000 +0200 @@ -18,7 +18,7 @@ Name: fio -Version: 2.11 +Version: 2.12 Release: 0 Summary: Flexible I/O Tester/benchmarker License: GPL-2.0 @@ -98,6 +98,7 @@ %{_bindir}/fio-dedupe %{_bindir}/fio-genzipf %{_bindir}/fio-verify-state +%{_bindir}/fio_latency2csv.py %{_datadir}/fio %{_mandir}/man1/fio.1%{ext_man} %{_mandir}/man1/fio_generate_plots.1%{ext_man} ++++++ fio-2.11.tar.bz2 -> fio-2.12.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/FIO-VERSION-GEN new/fio-2.12/FIO-VERSION-GEN --- old/fio-2.11/FIO-VERSION-GEN 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/FIO-VERSION-GEN 2016-06-13 23:42:44.000000000 +0200 @@ -1,7 +1,7 @@ #!/bin/sh GVF=FIO-VERSION-FILE -DEF_VER=fio-2.11 +DEF_VER=fio-2.12 LF=' ' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/HOWTO new/fio-2.12/HOWTO --- old/fio-2.11/HOWTO 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/HOWTO 2016-06-13 23:42:44.000000000 +0200 @@ -53,8 +53,8 @@ IO engine How do we issue io? We could be memory mapping the file, we could be using regular read/write, we - could be using splice, async io, syslet, or even - SG (SCSI generic sg). + could be using splice, async io, or even SG + (SCSI generic sg). IO depth If the io engine is async, how large a queuing depth do we want to maintain? @@ -706,7 +706,9 @@ vsync Basic readv(2) or writev(2) IO. - psyncv Basic preadv(2) or pwritev(2) IO. + pvsync Basic preadv(2) or pwritev(2) IO. + + pvsync2 Basic preadv2(2) or pwritev2(2) IO. libaio Linux native asynchronous io. Note that Linux may only support queued behaviour with @@ -726,9 +728,6 @@ vmsplice(2) to transfer data from user space to the kernel. - syslet-rw Use the syslet system calls to make - regular read/write async. - sg SCSI generic sg v3 io. May either be synchronous using the SG_IO ioctl, or if the target is an sg character device diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/Makefile new/fio-2.12/Makefile --- old/fio-2.11/Makefile 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/Makefile 2016-06-13 23:42:44.000000000 +0200 @@ -26,7 +26,7 @@ CFLAGS = -std=gnu99 -Wwrite-strings -Wall -Wdeclaration-after-statement $(OPTFLAGS) $(EXTFLAGS) $(BUILD_CFLAGS) -I. -I$(SRCDIR) LIBS += -lm $(EXTLIBS) PROGS = fio -SCRIPTS = $(addprefix $(SRCDIR)/,tools/fio_generate_plots tools/plot/fio2gnuplot tools/genfio tools/fiologparser.py) +SCRIPTS = $(addprefix $(SRCDIR)/,tools/fio_generate_plots tools/plot/fio2gnuplot tools/genfio tools/fiologparser.py tools/fio_latency2csv.py) ifndef CONFIG_FIO_NO_OPT CFLAGS += -O3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/arch/arch-arm.h new/fio-2.12/arch/arch-arm.h --- old/fio-2.11/arch/arch-arm.h 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/arch/arch-arm.h 2016-06-13 23:42:44.000000000 +0200 @@ -18,6 +18,13 @@ #define __NR_sys_vmsplice 343 #endif +#ifndef __NR_preadv2 +#define __NR_preadv2 392 +#endif +#ifndef __NR_pwritev2 +#define __NR_pwritev2 393 +#endif + #if defined (__ARM_ARCH_4__) || defined (__ARM_ARCH_4T__) \ || defined (__ARM_ARCH_5__) || defined (__ARM_ARCH_5T__) || defined (__ARM_ARCH_5E__)\ || defined (__ARM_ARCH_5TE__) || defined (__ARM_ARCH_5TEJ__) \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/arch/arch-ia64.h new/fio-2.12/arch/arch-ia64.h --- old/fio-2.11/arch/arch-ia64.h 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/arch/arch-ia64.h 2016-06-13 23:42:44.000000000 +0200 @@ -18,6 +18,13 @@ #define __NR_sys_vmsplice 1302 #endif +#ifndef __NR_preadv2 +#define __NR_preadv2 1348 +#endif +#ifndef __NR_pwritev2 +#define __NR_pwritev2 1349 +#endif + #define nop asm volatile ("hint @pause" ::: "memory"); #define read_barrier() asm volatile ("mf" ::: "memory") #define write_barrier() asm volatile ("mf" ::: "memory") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/arch/arch-s390.h new/fio-2.12/arch/arch-s390.h --- old/fio-2.11/arch/arch-s390.h 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/arch/arch-s390.h 2016-06-13 23:42:44.000000000 +0200 @@ -18,6 +18,13 @@ #define __NR_sys_vmsplice 309 #endif +#ifndef __NR_preadv2 +#define __NR_preadv2 376 +#endif +#ifndef __NR_pwritev2 +#define __NR_pwritev2 377 +#endif + #define nop asm volatile("nop" : : : "memory") #define read_barrier() asm volatile("bcr 15,0" : : : "memory") #define write_barrier() asm volatile("bcr 15,0" : : : "memory") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/arch/arch-sparc.h new/fio-2.12/arch/arch-sparc.h --- old/fio-2.11/arch/arch-sparc.h 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/arch/arch-sparc.h 2016-06-13 23:42:44.000000000 +0200 @@ -18,6 +18,13 @@ #define __NR_sys_vmsplice 25 #endif +#ifndef __NR_preadv2 +#define __NR_preadv2 358 +#endif +#ifndef __NR_pwritev2 +#define __NR_pwritev2 359 +#endif + #define nop do { } while (0) #define read_barrier() __asm__ __volatile__ ("" : : : "memory") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/arch/arch-sparc64.h new/fio-2.12/arch/arch-sparc64.h --- old/fio-2.11/arch/arch-sparc64.h 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/arch/arch-sparc64.h 2016-06-13 23:42:44.000000000 +0200 @@ -18,6 +18,13 @@ #define __NR_sys_vmsplice 25 #endif +#ifndef __NR_preadv2 +#define __NR_preadv2 358 +#endif +#ifndef __NR_pwritev2 +#define __NR_pwritev2 359 +#endif + #define nop do { } while (0) #define membar_safe(type) \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/arch/arch-x86.h new/fio-2.12/arch/arch-x86.h --- old/fio-2.11/arch/arch-x86.h 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/arch/arch-x86.h 2016-06-13 23:42:44.000000000 +0200 @@ -29,6 +29,13 @@ #define __NR_sys_vmsplice 316 #endif +#ifndef __NR_preadv2 +#define __NR_preadv2 378 +#endif +#ifndef __NR_pwritev2 +#define __NR_pwritev2 379 +#endif + #define FIO_HUGE_PAGE 4194304 #define nop __asm__ __volatile__("rep;nop": : :"memory") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/arch/arch-x86_64.h new/fio-2.12/arch/arch-x86_64.h --- old/fio-2.11/arch/arch-x86_64.h 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/arch/arch-x86_64.h 2016-06-13 23:42:44.000000000 +0200 @@ -36,6 +36,14 @@ #define __NR_shmdt 67 #endif +#ifndef __NR_preadv2 +#define __NR_preadv2 327 +#endif +#ifndef __NR_pwritev2 +#define __NR_pwritev2 328 +#endif + + #define FIO_HUGE_PAGE 2097152 #define nop __asm__ __volatile__("rep;nop": : :"memory") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/backend.c new/fio-2.12/backend.c --- old/fio-2.11/backend.c 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/backend.c 2016-06-13 23:42:44.000000000 +0200 @@ -1428,7 +1428,6 @@ struct thread_data *td = fd->td; struct thread_options *o = &td->o; struct sk_out *sk_out = fd->sk_out; - pthread_condattr_t attr; int clear_state; int ret; @@ -1453,12 +1452,18 @@ INIT_FLIST_HEAD(&td->verify_list); INIT_FLIST_HEAD(&td->trim_list); INIT_FLIST_HEAD(&td->next_rand_list); - pthread_mutex_init(&td->io_u_lock, NULL); td->io_hist_tree = RB_ROOT; - pthread_condattr_init(&attr); - pthread_cond_init(&td->verify_cond, &attr); - pthread_cond_init(&td->free_cond, &attr); + ret = mutex_cond_init_pshared(&td->io_u_lock, &td->free_cond); + if (ret) { + td_verror(td, ret, "mutex_cond_init_pshared"); + goto err; + } + ret = cond_init_pshared(&td->verify_cond); + if (ret) { + td_verror(td, ret, "mutex_cond_pshared"); + goto err; + } td_set_runstate(td, TD_INITIALIZED); dprint(FD_MUTEX, "up startup_mutex\n"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/engines/sync.c new/fio-2.12/engines/sync.c --- old/fio-2.11/engines/sync.c 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/engines/sync.c 2016-06-13 23:42:44.000000000 +0200 @@ -32,7 +32,7 @@ enum fio_ddir last_ddir; }; -#ifdef CONFIG_PWRITEV2 +#ifdef FIO_HAVE_PWRITEV2 struct psyncv2_options { void *pad; unsigned int hipri; @@ -121,7 +121,7 @@ } #endif -#ifdef CONFIG_PWRITEV2 +#ifdef FIO_HAVE_PWRITEV2 static int fio_pvsyncio2_queue(struct thread_data *td, struct io_u *io_u) { struct syncio_data *sd = td->io_ops->data; @@ -429,7 +429,7 @@ }; #endif -#ifdef CONFIG_PWRITEV2 +#ifdef FIO_HAVE_PWRITEV2 static struct ioengine_ops ioengine_pvrw2 = { .name = "pvsync2", .version = FIO_IOOPS_VERSION, @@ -453,7 +453,7 @@ #ifdef CONFIG_PWRITEV register_ioengine(&ioengine_pvrw); #endif -#ifdef CONFIG_PWRITEV2 +#ifdef FIO_HAVE_PWRITEV2 register_ioengine(&ioengine_pvrw2); #endif } @@ -466,7 +466,7 @@ #ifdef CONFIG_PWRITEV unregister_ioengine(&ioengine_pvrw); #endif -#ifdef CONFIG_PWRITEV2 +#ifdef FIO_HAVE_PWRITEV2 unregister_ioengine(&ioengine_pvrw2); #endif } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/fio.1 new/fio-2.12/fio.1 --- old/fio-2.11/fio.1 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/fio.1 2016-06-13 23:42:44.000000000 +0200 @@ -633,9 +633,6 @@ \fBsplice\fR\|(2) is used to transfer the data and \fBvmsplice\fR\|(2) to transfer data from user-space to the kernel. .TP -.B syslet-rw -Use the syslet system calls to make regular read/write asynchronous. -.TP .B sg SCSI generic sg v3 I/O. May be either synchronous using the SG_IO ioctl, or if the target is an sg character device, we use \fBread\fR\|(2) and @@ -1712,7 +1709,7 @@ enabled when polling for a minimum of 0 events (eg when iodepth_batch_complete=0). .TP -.BI (psyncv2)hipri +.BI (pvsync2)hipri Set RWF_HIPRI on IO, indicating to the kernel that it's of higher priority than normal. .TP diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/fio_time.h new/fio-2.12/fio_time.h --- old/fio-2.11/fio_time.h 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/fio_time.h 2016-06-13 23:42:44.000000000 +0200 @@ -1,6 +1,8 @@ #ifndef FIO_TIME_H #define FIO_TIME_H +#include "lib/types.h" + struct thread_data; extern uint64_t utime_since(const struct timeval *,const struct timeval *); extern uint64_t utime_since_now(const struct timeval *); @@ -14,8 +16,8 @@ extern uint64_t usec_sleep(struct thread_data *, unsigned long); extern void fill_start_time(struct timeval *); extern void set_genesis_time(void); -extern int ramp_time_over(struct thread_data *); -extern int in_ramp_time(struct thread_data *); +extern bool ramp_time_over(struct thread_data *); +extern bool in_ramp_time(struct thread_data *); extern void fio_time_init(void); extern void timeval_add_msec(struct timeval *, unsigned int); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/hash.h new/fio-2.12/hash.h --- old/fio-2.11/hash.h 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/hash.h 2016-06-13 23:42:44.000000000 +0200 @@ -44,15 +44,15 @@ #define GOLDEN_RATIO_32 0x61C88647 #define GOLDEN_RATIO_64 0x61C8864680B583EBull -static inline unsigned long __hash_long(unsigned long val) +static inline unsigned long __hash_long(uint64_t val) { - unsigned long hash = val; + uint64_t hash = val; #if BITS_PER_LONG == 64 hash *= GOLDEN_RATIO_64; #else /* Sigh, gcc can't optimise this alone like it does for 32 bits. */ - unsigned long n = hash; + uint64_t n = hash; n <<= 18; hash -= n; n <<= 33; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/helper_thread.c new/fio-2.12/helper_thread.c --- old/fio-2.11/helper_thread.c 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/helper_thread.c 2016-06-13 23:42:44.000000000 +0200 @@ -148,8 +148,11 @@ setup_disk_util(); hd->sk_out = sk_out; - pthread_cond_init(&hd->cond, NULL); - pthread_mutex_init(&hd->lock, NULL); + + ret = mutex_cond_init_pshared(&hd->lock, &hd->cond); + if (ret) + return 1; + hd->startup_mutex = startup_mutex; ret = pthread_create(&hd->thread, NULL, helper_thread_main, hd); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/iolog.c new/fio-2.12/iolog.c --- old/fio-2.11/iolog.c 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/iolog.c 2016-06-13 23:42:44.000000000 +0200 @@ -604,7 +604,7 @@ if (l->log_gz && !p->td) l->log_gz = 0; else if (l->log_gz || l->log_gz_store) { - pthread_mutex_init(&l->chunk_lock, NULL); + mutex_init_pshared(&l->chunk_lock); p->td->flags |= TD_F_COMPRESS_LOG; } @@ -645,6 +645,7 @@ cur_log = flist_first_entry(&log->io_logs, struct io_logs, list); flist_del_init(&cur_log->list); free(cur_log->log); + sfree(cur_log); } if (log->pending) { @@ -988,6 +989,7 @@ cur_log = flist_first_entry(&log->io_logs, struct io_logs, list); flist_del_init(&cur_log->list); flush_samples(f, cur_log->log, cur_log->nr_samples * log_entry_sz(log)); + sfree(cur_log); } fclose(f); @@ -1226,9 +1228,7 @@ data->samples = cur_log->log; data->nr_samples = cur_log->nr_samples; - cur_log->nr_samples = 0; - cur_log->max_samples = 0; - cur_log->log = NULL; + sfree(cur_log); gz_work(data); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/mutex.c new/fio-2.12/mutex.c --- old/fio-2.11/mutex.c 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/mutex.c 2016-06-13 23:42:44.000000000 +0200 @@ -30,16 +30,39 @@ munmap((void *) mutex, sizeof(*mutex)); } -int __fio_mutex_init(struct fio_mutex *mutex, int value) +int cond_init_pshared(pthread_cond_t *cond) { - pthread_mutexattr_t attr; - pthread_condattr_t cond; + pthread_condattr_t cattr; int ret; - mutex->value = value; - mutex->magic = FIO_MUTEX_MAGIC; + ret = pthread_condattr_init(&cattr); + if (ret) { + log_err("pthread_condattr_init: %s\n", strerror(ret)); + return ret; + } + +#ifdef FIO_HAVE_PSHARED_MUTEX + ret = pthread_condattr_setpshared(&cattr, PTHREAD_PROCESS_SHARED); + if (ret) { + log_err("pthread_condattr_setpshared: %s\n", strerror(ret)); + return ret; + } +#endif + ret = pthread_cond_init(cond, &cattr); + if (ret) { + log_err("pthread_cond_init: %s\n", strerror(ret)); + return ret; + } + + return 0; +} - ret = pthread_mutexattr_init(&attr); +int mutex_init_pshared(pthread_mutex_t *mutex) +{ + pthread_mutexattr_t mattr; + int ret; + + ret = pthread_mutexattr_init(&mattr); if (ret) { log_err("pthread_mutexattr_init: %s\n", strerror(ret)); return ret; @@ -49,27 +72,47 @@ * Not all platforms support process shared mutexes (FreeBSD) */ #ifdef FIO_HAVE_PSHARED_MUTEX - ret = pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); + ret = pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED); if (ret) { log_err("pthread_mutexattr_setpshared: %s\n", strerror(ret)); return ret; } #endif - - pthread_condattr_init(&cond); -#ifdef FIO_HAVE_PSHARED_MUTEX - pthread_condattr_setpshared(&cond, PTHREAD_PROCESS_SHARED); -#endif - pthread_cond_init(&mutex->cond, &cond); - - ret = pthread_mutex_init(&mutex->lock, &attr); + ret = pthread_mutex_init(mutex, &mattr); if (ret) { log_err("pthread_mutex_init: %s\n", strerror(ret)); return ret; } - pthread_condattr_destroy(&cond); - pthread_mutexattr_destroy(&attr); + return 0; +} + +int mutex_cond_init_pshared(pthread_mutex_t *mutex, pthread_cond_t *cond) +{ + int ret; + + ret = mutex_init_pshared(mutex); + if (ret) + return ret; + + ret = cond_init_pshared(cond); + if (ret) + return ret; + + return 0; +} + +int __fio_mutex_init(struct fio_mutex *mutex, int value) +{ + int ret; + + mutex->value = value; + mutex->magic = FIO_MUTEX_MAGIC; + + ret = mutex_cond_init_pshared(&mutex->lock, &mutex->cond); + if (ret) + return ret; + return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/mutex.h new/fio-2.12/mutex.h --- old/fio-2.11/mutex.h 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/mutex.h 2016-06-13 23:42:44.000000000 +0200 @@ -40,4 +40,8 @@ extern struct fio_rwlock *fio_rwlock_init(void); extern void fio_rwlock_remove(struct fio_rwlock *); +extern int mutex_init_pshared(pthread_mutex_t *); +extern int cond_init_pshared(pthread_cond_t *); +extern int mutex_cond_init_pshared(pthread_mutex_t *, pthread_cond_t *); + #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/options.c new/fio-2.12/options.c --- old/fio-2.11/options.c 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/options.c 2016-06-13 23:42:44.000000000 +0200 @@ -1548,7 +1548,7 @@ .help = "Use preadv/pwritev", }, #endif -#ifdef CONFIG_PWRITEV2 +#ifdef FIO_HAVE_PWRITEV2 { .ival = "pvsync2", .help = "Use preadv2/pwritev2", }, @@ -1678,7 +1678,6 @@ .help = "Number of IO buffers to submit in one go", .parent = "iodepth", .hide = 1, - .minval = 1, .interval = 1, .def = "1", .category = FIO_OPT_C_IO, @@ -2162,7 +2161,14 @@ }, }, }, -#endif /* CONFIG_POSIX_FALLOCATE */ +#else /* CONFIG_POSIX_FALLOCATE */ + { + .name = "fallocate", + .lname = "Fallocate", + .type = FIO_OPT_UNSUPPORTED, + .help = "Your platform does not support fallocate", + }, +#endif /* CONFIG_POSIX_FALLOCATE */ { .name = "fadvise_hint", .lname = "Fadvise hint", @@ -2183,6 +2189,13 @@ .category = FIO_OPT_C_FILE, .group = FIO_OPT_G_INVALID, }, +#else + { + .name = "fadvise_stream", + .lname = "Fadvise stream", + .type = FIO_OPT_UNSUPPORTED, + .help = "Your platform does not support fadvise stream ID", + }, #endif { .name = "fsync", @@ -2246,6 +2259,13 @@ .category = FIO_OPT_C_FILE, .group = FIO_OPT_G_INVALID, }, +#else + { + .name = "sync_file_range", + .lname = "Sync file range", + .type = FIO_OPT_UNSUPPORTED, + .help = "Your platform does not support sync_file_range", + }, #endif { .name = "direct", @@ -2677,6 +2697,13 @@ .category = FIO_OPT_C_IO, .group = FIO_OPT_G_VERIFY, }, +#else + { + .name = "verify_async_cpus", + .lname = "Async verify CPUs", + .type = FIO_OPT_UNSUPPORTED, + .help = "Your platform does not support CPU affinities", + }, #endif { .name = "experimental_verify", @@ -2761,6 +2788,31 @@ .category = FIO_OPT_C_IO, .group = FIO_OPT_G_TRIM, }, +#else + { + .name = "trim_percentage", + .lname = "Trim percentage", + .type = FIO_OPT_UNSUPPORTED, + .help = "Fio does not support TRIM on your platform", + }, + { + .name = "trim_verify_zero", + .lname = "Verify trim zero", + .type = FIO_OPT_UNSUPPORTED, + .help = "Fio does not support TRIM on your platform", + }, + { + .name = "trim_backlog", + .lname = "Trim backlog", + .type = FIO_OPT_UNSUPPORTED, + .help = "Fio does not support TRIM on your platform", + }, + { + .name = "trim_backlog_batch", + .lname = "Trim backlog batch", + .type = FIO_OPT_UNSUPPORTED, + .help = "Fio does not support TRIM on your platform", + }, #endif { .name = "write_iolog", @@ -2853,6 +2905,13 @@ .category = FIO_OPT_C_FILE, .group = FIO_OPT_G_INVALID, }, +#else + { + .name = "ioscheduler", + .lname = "I/O scheduler", + .type = FIO_OPT_UNSUPPORTED, + .help = "Your platform does not support IO scheduler switching", + }, #endif { .name = "zonesize", @@ -2971,6 +3030,19 @@ .category = FIO_OPT_C_GENERAL, .group = FIO_OPT_G_CRED, }, +#else + { + .name = "prio", + .lname = "I/O nice priority", + .type = FIO_OPT_UNSUPPORTED, + .help = "Your platform does not support IO priorities", + }, + { + .name = "prioclass", + .lname = "I/O nice priority class", + .type = FIO_OPT_UNSUPPORTED, + .help = "Your platform does not support IO priorities", + }, #endif { .name = "thinktime", @@ -3269,6 +3341,25 @@ .category = FIO_OPT_C_GENERAL, .group = FIO_OPT_G_CRED, }, +#else + { + .name = "cpumask", + .lname = "CPU mask", + .type = FIO_OPT_UNSUPPORTED, + .help = "Your platform does not support CPU affinities", + }, + { + .name = "cpus_allowed", + .lname = "CPUs allowed", + .type = FIO_OPT_UNSUPPORTED, + .help = "Your platform does not support CPU affinities", + }, + { + .name = "cpus_allowed_policy", + .lname = "CPUs allowed distribution policy", + .type = FIO_OPT_UNSUPPORTED, + .help = "Your platform does not support CPU affinities", + }, #endif #ifdef CONFIG_LIBNUMA { @@ -3291,6 +3382,19 @@ .category = FIO_OPT_C_GENERAL, .group = FIO_OPT_G_INVALID, }, +#else + { + .name = "numa_cpu_nodes", + .lname = "NUMA CPU Nodes", + .type = FIO_OPT_UNSUPPORTED, + .help = "Build fio with libnuma-dev(el) to enable this option", + }, + { + .name = "numa_mem_policy", + .lname = "NUMA Memory Policy", + .type = FIO_OPT_UNSUPPORTED, + .help = "Build fio with libnuma-dev(el) to enable this option", + }, #endif { .name = "end_fsync", @@ -3463,6 +3567,13 @@ .category = FIO_OPT_C_LOG, .group = FIO_OPT_G_INVALID, }, +#else + { + .name = "log_compression_cpus", + .lname = "Log Compression CPUs", + .type = FIO_OPT_UNSUPPORTED, + .help = "Your platform does not support CPU affinities", + }, #endif { .name = "log_store_compressed", @@ -3473,6 +3584,19 @@ .category = FIO_OPT_C_LOG, .group = FIO_OPT_G_INVALID, }, +#else + { + .name = "log_compression", + .lname = "Log compression", + .type = FIO_OPT_UNSUPPORTED, + .help = "Install libz-dev(el) to get compression support", + }, + { + .name = "log_store_compressed", + .lname = "Log store compressed", + .type = FIO_OPT_UNSUPPORTED, + .help = "Install libz-dev(el) to get compression support", + }, #endif { .name = "block_error_percentiles", @@ -3633,6 +3757,13 @@ .category = FIO_OPT_C_STAT, .group = FIO_OPT_G_INVALID, }, +#else + { + .name = "disk_util", + .lname = "Disk utilization", + .type = FIO_OPT_UNSUPPORTED, + .help = "Your platform does not support disk utilization", + }, #endif { .name = "gtod_reduce", @@ -4278,7 +4409,8 @@ i++; } - if (best_option != -1 && string_distance_ok(name, best_distance)) + if (best_option != -1 && string_distance_ok(name, best_distance) && + fio_options[best_option].type != FIO_OPT_UNSUPPORTED) log_err("Did you mean %s?\n", fio_options[best_option].name); free(name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/options.h new/fio-2.12/options.h --- old/fio-2.11/options.h 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/options.h 2016-06-13 23:42:44.000000000 +0200 @@ -47,19 +47,8 @@ return false; } -static inline struct fio_option *find_option(struct fio_option *options, - const char *opt) -{ - struct fio_option *o; - - for (o = &options[0]; o->name; o++) - if (o_match(o, opt)) - return o; - - return NULL; -} - -extern struct fio_option *fio_option_find(const char *name); +extern struct fio_option *find_option(struct fio_option *, const char *); +extern struct fio_option *fio_option_find(const char *); extern unsigned int fio_get_kb_base(void *); #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/os/os-linux.h new/fio-2.12/os/os-linux.h --- old/fio-2.11/os/os-linux.h 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/os/os-linux.h 2016-06-13 23:42:44.000000000 +0200 @@ -38,6 +38,7 @@ #define FIO_HAVE_BINJECT #define FIO_HAVE_GETTID #define FIO_USE_GENERIC_INIT_RANDOM_STATE +#define FIO_HAVE_PWRITEV2 #ifdef MAP_HUGETLB #define FIO_HAVE_MMAP_HUGE @@ -289,4 +290,55 @@ #define FIO_HAVE_STREAMID +#ifndef RWF_HIPRI +#define RWF_HIPRI 0x00000001 +#endif +#ifndef RWF_DSYNC +#define RWF_DSYNC 0x00000002 +#endif +#ifndef RWF_SYNC +#define RWF_SYNC 0x00000004 +#endif + +#ifndef CONFIG_PWRITEV2 +#ifdef __NR_preadv2 +static inline void make_pos_h_l(unsigned long *pos_h, unsigned long *pos_l, + off_t offset) +{ + *pos_l = offset & 0xffffffff; + *pos_h = ((uint64_t) offset) >> 32; + +} +static inline ssize_t preadv2(int fd, const struct iovec *iov, int iovcnt, + off_t offset, unsigned int flags) +{ + unsigned long pos_l, pos_h; + + make_pos_h_l(&pos_h, &pos_l, offset); + return syscall(__NR_preadv2, fd, iov, iovcnt, pos_l, pos_h, flags); +} +static inline ssize_t pwritev2(int fd, const struct iovec *iov, int iovcnt, + off_t offset, unsigned int flags) +{ + unsigned long pos_l, pos_h; + + make_pos_h_l(&pos_h, &pos_l, offset); + return syscall(__NR_pwritev2, fd, iov, iovcnt, pos_l, pos_h, flags); +} +#else +static inline ssize_t preadv2(int fd, const struct iovec *iov, int iovcnt, + off_t offset, unsigned int flags) +{ + errno = ENOSYS; + return -1; +} +static inline ssize_t pwritev2(int fd, const struct iovec *iov, int iovcnt, + off_t offset, unsigned int flags) +{ + errno = ENOSYS; + return -1; +} +#endif /* __NR_preadv2 */ +#endif /* CONFIG_PWRITEV2 */ + #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/os/windows/install.wxs new/fio-2.12/os/windows/install.wxs --- old/fio-2.11/os/windows/install.wxs 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/os/windows/install.wxs 2016-06-13 23:42:44.000000000 +0200 @@ -10,7 +10,7 @@ <Product Id="*" Codepage="1252" Language="1033" Manufacturer="fio" Name="fio" - UpgradeCode="2338A332-5511-43CF-B9BD-5C60496CCFCC" Version="2.11"> + UpgradeCode="2338A332-5511-43CF-B9BD-5C60496CCFCC" Version="2.12"> <Package Description="Flexible IO Tester" InstallerVersion="301" Keywords="Installer,MSI,Database" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/parse.c new/fio-2.12/parse.c --- old/fio-2.11/parse.c 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/parse.c 2016-06-13 23:42:44.000000000 +0200 @@ -906,6 +906,25 @@ return ret; } +struct fio_option *find_option(struct fio_option *options, const char *opt) +{ + struct fio_option *o; + + for (o = &options[0]; o->name; o++) { + if (!o_match(o, opt)) + continue; + if (o->type == FIO_OPT_UNSUPPORTED) { + log_err("Option <%s>: %s\n", o->name, o->help); + continue; + } + + return o; + } + + return NULL; +} + + static struct fio_option *get_option(char *opt, struct fio_option *options, char **post) { @@ -1232,7 +1251,7 @@ void option_init(struct fio_option *o) { - if (o->type == FIO_OPT_DEPRECATED) + if (o->type == FIO_OPT_DEPRECATED || o->type == FIO_OPT_UNSUPPORTED) return; if (o->name && !o->lname) log_err("Option %s: missing long option name\n", o->name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/parse.h new/fio-2.12/parse.h --- old/fio-2.11/parse.h 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/parse.h 2016-06-13 23:42:44.000000000 +0200 @@ -20,6 +20,7 @@ FIO_OPT_FLOAT_LIST, FIO_OPT_STR_SET, FIO_OPT_DEPRECATED, + FIO_OPT_UNSUPPORTED, }; /* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/server.c new/fio-2.12/server.c --- old/fio-2.11/server.c 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/server.c 2016-06-13 23:42:44.000000000 +0200 @@ -1656,7 +1656,7 @@ static int __fio_append_iolog_gz(struct sk_entry *first, struct io_log *log, struct io_logs *cur_log, z_stream *stream) { - struct sk_entry *entry; + unsigned int this_len; void *out_pdu; int ret; @@ -1664,7 +1664,7 @@ stream->avail_in = cur_log->nr_samples * log_entry_sz(log); do { - unsigned int this_len; + struct sk_entry *entry; /* * Dirty - since the log is potentially huge, compress it into @@ -1675,7 +1675,7 @@ stream->avail_out = FIO_SERVER_MAX_FRAGMENT_PDU; stream->next_out = out_pdu; - ret = deflate(stream, Z_FINISH); + ret = deflate(stream, Z_BLOCK); /* may be Z_OK, or Z_STREAM_END */ if (ret < 0) { free(out_pdu); @@ -1716,8 +1716,36 @@ break; } - deflateEnd(&stream); - return ret; + ret = deflate(&stream, Z_FINISH); + + while (ret != Z_STREAM_END) { + struct sk_entry *entry; + unsigned int this_len; + void *out_pdu; + + out_pdu = malloc(FIO_SERVER_MAX_FRAGMENT_PDU); + stream.avail_out = FIO_SERVER_MAX_FRAGMENT_PDU; + stream.next_out = out_pdu; + + ret = deflate(&stream, Z_FINISH); + /* may be Z_OK, or Z_STREAM_END */ + if (ret < 0) { + free(out_pdu); + break; + } + + this_len = FIO_SERVER_MAX_FRAGMENT_PDU - stream.avail_out; + + entry = fio_net_prep_cmd(FIO_NET_CMD_IOLOG, out_pdu, this_len, + NULL, SK_F_VEC | SK_F_INLINE | SK_F_FREE); + flist_add_tail(&entry->list, &first->next); + } while (ret != Z_STREAM_END); + + ret = deflateEnd(&stream); + if (ret == Z_OK) + return 0; + + return 1; } #else static int fio_append_iolog_gz(struct sk_entry *first, struct io_log *log) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/stat.c new/fio-2.12/stat.c --- old/fio-2.11/stat.c 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/stat.c 2016-06-13 23:42:44.000000000 +0200 @@ -16,6 +16,7 @@ #include "lib/pow2.h" #include "lib/output_buffer.h" #include "helper_thread.h" +#include "smalloc.h" struct fio_mutex *stat_mutex; @@ -1636,16 +1637,21 @@ if (output_format & FIO_OUTPUT_JSON) { struct thread_data *global; char time_buf[32]; - time_t time_p; + struct timeval now; + unsigned long long ms_since_epoch; - time(&time_p); - os_ctime_r((const time_t *) &time_p, time_buf, + gettimeofday(&now, NULL); + ms_since_epoch = (unsigned long long)(now.tv_sec) * 1000 + + (unsigned long long)(now.tv_usec) / 1000; + + os_ctime_r((const time_t *) &now.tv_sec, time_buf, sizeof(time_buf)); time_buf[strlen(time_buf) - 1] = '\0'; root = json_create_object(); json_object_add_value_string(root, "fio version", fio_version_string); - json_object_add_value_int(root, "timestamp", time_p); + json_object_add_value_int(root, "timestamp", now.tv_sec); + json_object_add_value_int(root, "timestamp_ms", ms_since_epoch); json_object_add_value_string(root, "time", time_buf); global = get_global_options(); json_add_job_opts(root, "global options", &global->opt_list, false); @@ -1872,7 +1878,7 @@ new_size = new_samples * log_entry_sz(iolog); - cur_log = malloc(sizeof(*cur_log)); + cur_log = smalloc(sizeof(*cur_log)); if (cur_log) { INIT_FLIST_HEAD(&cur_log->list); cur_log->log = malloc(new_size); @@ -1883,7 +1889,7 @@ iolog->cur_log_max = new_samples; return cur_log; } - free(cur_log); + sfree(cur_log); } return NULL; @@ -1977,11 +1983,14 @@ return cur_log; /* - * Out of space. If we're in IO offload mode, add a new log chunk - * inline. If we're doing inline submissions, flag 'td' as needing - * a log regrow and we'll take care of it on the submission side. + * Out of space. If we're in IO offload mode, or we're not doing + * per unit logging (hence logging happens outside of the IO thread + * as well), add a new log chunk inline. If we're doing inline + * submissions, flag 'td' as needing a log regrow and we'll take + * care of it on the submission side. */ - if (iolog->td->o.io_submit_mode == IO_MODE_OFFLOAD) + if (iolog->td->o.io_submit_mode == IO_MODE_OFFLOAD || + !per_unit_log(iolog)) return regrow_log(iolog); iolog->td->flags |= TD_F_REGROW_LOGS; @@ -2255,9 +2264,6 @@ unsigned long spent, rate; enum fio_ddir ddir; - if (per_unit_log(td->bw_log)) - return 0; - spent = mtime_since(&td->bw_sample_time, t); if (spent < td->o.bw_avg_time && td->o.bw_avg_time - spent >= 10) @@ -2326,9 +2332,6 @@ unsigned long spent, iops; enum fio_ddir ddir; - if (per_unit_log(td->iops_log)) - return 0; - spent = mtime_since(&td->iops_sample_time, t); if (spent < td->o.iops_avg_time && td->o.iops_avg_time - spent >= 10) @@ -2388,7 +2391,7 @@ fio_gettime(&now, NULL); for_each_td(td, i) { - if (!ramp_time_over(td) || + if (in_ramp_time(td) || !(td->runstate == TD_RUNNING || td->runstate == TD_VERIFYING)) { next = min(td->o.iops_avg_time, td->o.bw_avg_time); continue; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/time.c new/fio-2.12/time.c --- old/fio-2.11/time.c 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/time.c 2016-06-13 23:42:44.000000000 +0200 @@ -84,7 +84,7 @@ return utime_since_now(&genesis); } -int in_ramp_time(struct thread_data *td) +bool in_ramp_time(struct thread_data *td) { return td->o.ramp_time && !td->ramp_time_over; } @@ -101,12 +101,12 @@ td_set_runstate(parent, TD_RAMP); } -int ramp_time_over(struct thread_data *td) +bool ramp_time_over(struct thread_data *td) { struct timeval tv; if (!td->o.ramp_time || td->ramp_time_over) - return 1; + return true; fio_gettime(&tv, NULL); if (utime_since(&td->epoch, &tv) >= td->o.ramp_time) { @@ -114,10 +114,10 @@ reset_all_stats(td); td_set_runstate(td, TD_RAMP); parent_update_ramp(td); - return 1; + return true; } - return 0; + return false; } void fio_time_init(void) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/tools/fio_latency2csv.py new/fio-2.12/tools/fio_latency2csv.py --- old/fio-2.11/tools/fio_latency2csv.py 1970-01-01 01:00:00.000000000 +0100 +++ new/fio-2.12/tools/fio_latency2csv.py 2016-06-13 23:42:44.000000000 +0200 @@ -0,0 +1,101 @@ +#!/usr/bin/python +# +# fio_latency2csv.py +# +# This tool converts fio's json+ completion latency data to CSV format. +# For example: +# +# fio_latency2csv.py fio-jsonplus.output fio-latency.csv +# + +import os +import json +import argparse + + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument('source', + help='fio json+ output file containing completion ' + 'latency data') + parser.add_argument('dest', + help='destination file stub for latency data in CSV ' + 'format. job number will be appended to filename') + args = parser.parse_args() + + return args + + +# from stat.c +def plat_idx_to_val(idx, FIO_IO_U_PLAT_BITS=6, FIO_IO_U_PLAT_VAL=64): + # MSB <= (FIO_IO_U_PLAT_BITS-1), cannot be rounded off. Use + # all bits of the sample as index + if (idx < (FIO_IO_U_PLAT_VAL << 1)): + return idx + + # Find the group and compute the minimum value of that group + error_bits = (idx >> FIO_IO_U_PLAT_BITS) - 1 + base = 1 << (error_bits + FIO_IO_U_PLAT_BITS) + + # Find its bucket number of the group + k = idx % FIO_IO_U_PLAT_VAL + + # Return the mean of the range of the bucket + return (base + ((k + 0.5) * (1 << error_bits))) + + +def percentile(idx, run_total): + total = run_total[len(run_total)-1] + if total == 0: + return 0 + + return float(run_total[x]) / total + + +if __name__ == '__main__': + args = parse_args() + + with open(args.source, 'r') as source: + jsondata = json.loads(source.read()) + + bins = {} + bin_const = {} + run_total = {} + ddir_list = ['read', 'write', 'trim'] + const_list = ['FIO_IO_U_PLAT_NR', 'FIO_IO_U_PLAT_BITS', + 'FIO_IO_U_PLAT_VAL'] + + for jobnum in range(0,len(jsondata['jobs'])): + prev_ddir = None + for ddir in ddir_list: + bins[ddir] = jsondata['jobs'][jobnum][ddir]['clat']['bins'] + + bin_const[ddir] = {} + for const in const_list: + bin_const[ddir][const] = bins[ddir].pop(const) + if prev_ddir: + assert bin_const[ddir][const] == bin_const[prev_ddir][const] + prev_ddir = ddir + + run_total[ddir] = [0 for x in + range(bin_const[ddir]['FIO_IO_U_PLAT_NR'])] + run_total[ddir][0] = bins[ddir]['0'] + for x in range(1, bin_const[ddir]['FIO_IO_U_PLAT_NR']): + run_total[ddir][x] = run_total[ddir][x-1] + bins[ddir][str(x)] + + stub, ext = os.path.splitext(args.dest) + outfile = stub + '_job' + str(jobnum) + ext + + with open(outfile, 'w') as output: + output.write("clat (usec),") + for ddir in ddir_list: + output.write("{0},".format(ddir)) + output.write("\n") + + for x in range(bin_const['read']['FIO_IO_U_PLAT_NR']): + output.write("{0},".format(plat_idx_to_val(x, + bin_const['read']['FIO_IO_U_PLAT_BITS'], + bin_const['read']['FIO_IO_U_PLAT_VAL']))) + for ddir in ddir_list: + output.write("{0},".format(percentile(x, run_total[ddir]))) + output.write("\n") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fio-2.11/workqueue.c new/fio-2.12/workqueue.c --- old/fio-2.11/workqueue.c 2016-05-25 02:42:04.000000000 +0200 +++ new/fio-2.12/workqueue.c 2016-06-13 23:42:44.000000000 +0200 @@ -278,8 +278,11 @@ int ret; INIT_FLIST_HEAD(&sw->work_list); - pthread_cond_init(&sw->cond, NULL); - pthread_mutex_init(&sw->lock, NULL); + + ret = mutex_cond_init_pshared(&sw->lock, &sw->cond); + if (ret) + return ret; + sw->wq = wq; sw->index = index; sw->sk_out = sk_out; @@ -308,15 +311,20 @@ { unsigned int running; int i, error; + int ret; wq->max_workers = max_workers; wq->td = td; wq->ops = *ops; wq->work_seq = 0; wq->next_free_worker = 0; - pthread_cond_init(&wq->flush_cond, NULL); - pthread_mutex_init(&wq->flush_lock, NULL); - pthread_mutex_init(&wq->stat_lock, NULL); + + ret = mutex_cond_init_pshared(&wq->flush_lock, &wq->flush_cond); + if (ret) + goto err; + ret = mutex_init_pshared(&wq->stat_lock); + if (ret) + goto err; wq->workers = smalloc(wq->max_workers * sizeof(struct submit_worker));