#!/bin/sh
GVF=FIO-VERSION-FILE
-DEF_VER=fio-2.0.11
+DEF_VER=fio-2.0.13
LF='
'
the values of completion latency below which 99.5% and
99.9% of the observed latencies fell, respectively.
+clocksource=str Use the given clocksource as the base of timing. The
+ supported options are:
+
+ gettimeofday gettimeofday(2)
+
+ clock_gettime clock_gettime(2)
+
+ cpu Internal CPU clock source
+
+ cpu is the preferred clocksource if it is reliable, as it
+ is very fast (and fio is heavy on time calls). Fio will
+ automatically use this clocksource if it's supported and
+ considered reliable on the system it is running on, unless
+ another clocksource is specifically set. For x86/x86-64 CPUs,
+ this means supporting TSC Invariant.
+
gtod_reduce=bool Enable all of the gettimeofday() reducing options
(disable_clat, disable_slat, disable_bw) plus reduce
precision of the timeout somewhat to really shrink
-ifneq ($(origin CC), environment)
-CC = $(CROSS_COMPILE)gcc
-endif
+CC ?= gcc
DEBUGFLAGS = -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG
CPPFLAGS= -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
$(DEBUGFLAGS)
-OPTFLAGS= -O3 -g $(EXTFLAGS)
+OPTFLAGS= -O3 -g -ffast-math $(EXTFLAGS)
CFLAGS = -std=gnu99 -Wwrite-strings -Wall $(OPTFLAGS)
LIBS = -lm -lz $(EXTLIBS)
PROGS = fio
CPPFLAGS += -DFIO_NO_HAVE_SHM_H
endif
ifeq ($(UNAME), SunOS)
+ CC = gcc
SOURCE += fifo.c lib/strsep.c helpers.c engines/posixaio.c \
engines/solarisaio.c
LIBS += -lpthread -ldl -laio -lrt -lnsl -lsocket
LDFLAGS += -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000
endif
ifeq ($(UNAME), HP-UX)
+ CC = gcc
SOURCE += fifo.c helpers.c lib/getopt_long.c lib/strsep.c engines/posixaio.c
LIBS += -lpthread -ldl -lrt
CFLAGS += -D_LARGEFILE64_SOURCE
--terse-version=type Terse version output format (default 3, or 2 or 4).
--version Print version info and exit
--help Print this page
+ --cpuclock-test Perform test/validation of CPU clock
--cmdhelp=cmd Print command help, "all" for all of them
--enghelp=engine Print ioengine help, or list available ioengines
--enghelp=engine,cmd Print help for an ioengine cmd
static inline int arch_init(char *envp[])
{
tsc_reliable = 1;
+ return 0;
}
#define ARCH_HAVE_FFZ
static inline int arch_init(char *envp[])
{
tsc_reliable = 1;
+ return 0;
}
#define ARCH_HAVE_FFZ
#define read_barrier() asm volatile("bcr 15,0" : : : "memory")
#define write_barrier() asm volatile("bcr 15,0" : : : "memory")
+static inline unsigned long long get_cpu_clock(void)
+{
+ unsigned long long clk;
+
+ __asm__ __volatile__("stck %0" : "=Q" (clk) : : "cc");
+ return clk;
+}
+
+#define ARCH_HAVE_INIT
+extern int tsc_reliable;
+static inline int arch_init(char *envp[])
+{
+ tsc_reliable = 1;
+ return 0;
+}
+
+#define ARCH_HAVE_CPU_CLOCK
+
#endif
static inline void do_cpuid(unsigned int *eax, unsigned int *ebx,
unsigned int *ecx, unsigned int *edx)
{
- unsigned int id = *eax;
-
- asm("movl %4, %%eax;"
- "cpuid;"
- "movl %%eax, %0;"
- "movl %%ebx, %1;"
- "movl %%ecx, %2;"
- "movl %%edx, %3;"
- : "=r" (*eax), "=r" (*ebx), "=r" (*ecx), "=r" (*edx)
- : "r" (id)
- : "eax", "ebx", "ecx", "edx");
+ asm volatile("cpuid"
+ : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
+ : "0" (*eax), "2" (*ecx)
+ : "memory");
}
#define ARCH_HAVE_INIT
extern int tsc_reliable;
static inline int arch_init(char *envp[])
{
- unsigned int eax, ebx, ecx, edx;
+ unsigned int eax, ebx, ecx = 0, edx;
/*
* Check for TSC
#ifndef ARCH_H
#define ARCH_H
+#include <stdint.h>
+
#ifdef __WORDSIZE
#define BITS_PER_LONG __WORDSIZE
#else
io_u = NULL;
while (!td->terminate) {
+ enum fio_ddir ddir;
int ret2, full;
update_tv_cache(td);
else
io_u->end_io = verify_io_u;
+ ddir = io_u->ddir;
+
ret = td_io_queue(td, io_u);
switch (ret) {
case FIO_Q_COMPLETED:
break;
}
- if (break_on_this_error(td, io_u->ddir, &ret))
+ if (break_on_this_error(td, ddir, &ret))
break;
/*
} else
td->pid = gettid();
+ fio_local_clock_init(td->o.use_thread);
+
dprint(FD_PROCESS, "jobs pid=%d started\n", (int) td->pid);
if (is_backend)
void crc32c_intel_probe(void)
{
if (!crc32c_probed) {
- unsigned int eax, ebx, ecx, edx;
+ unsigned int eax, ebx, ecx = 0, edx;
eax = 1;
one_more:
events = 0;
for_each_file(td, f, i) {
- bf = (void *) f->engine_data;
+ bf = (struct binject_file *) f->engine_data;
ret = read(bf->fd, p, left * sizeof(struct b_user_cmd));
if (ret < 0) {
if (errno == EAGAIN)
* Fill in the file descriptors
*/
for_each_file(td, f, i) {
- bf = (void *) f->engine_data;
+ bf = (struct binject_file *) f->engine_data;
/*
* don't block for min events == 0
if (!min) {
for_each_file(td, f, i) {
- bf = (void *) f->engine_data;
+ bf = (struct binject_file *) f->engine_data;
fcntl(bf->fd, F_SETFL, bd->fd_flags[i]);
}
}
static int fio_binject_doio(struct thread_data *td, struct io_u *io_u)
{
struct b_user_cmd *buc = &io_u->buc;
- struct binject_file *bf = (void *) io_u->file->engine_data;
+ struct binject_file *bf = (struct binject_file *) io_u->file->engine_data;
int ret;
ret = write(bf->fd, buc, sizeof(*buc));
{
struct binject_data *bd = td->io_ops->data;
struct b_user_cmd *buc = &io_u->buc;
- struct binject_file *bf = (void *) io_u->file->engine_data;
+ struct binject_file *bf = (struct binject_file *) io_u->file->engine_data;
if (io_u->xfer_buflen & (bf->bs - 1)) {
log_err("read/write not sector aligned\n");
static int fio_binject_close_file(struct thread_data *td, struct fio_file *f)
{
- struct binject_file *bf = (void *) f->engine_data;
+ struct binject_file *bf = (struct binject_file *) f->engine_data;
if (bf) {
binject_unmap_dev(td, bf);
bf = malloc(sizeof(*bf));
bf->bs = bs;
bf->minor = bf->fd = -1;
- f->engine_data = (uint64_t) bf;
+ f->engine_data = (uintptr_t) bf;
if (binject_map_dev(td, bf, f->fd)) {
err_close:
#ifdef FIO_HAVE_LIBAIO
-#define ev_to_iou(ev) (struct io_u *) ((unsigned long) (ev)->obj)
-
struct libaio_data {
io_context_t aio_ctx;
struct io_event *aio_events;
struct io_u *io_u;
ev = ld->aio_events + event;
- io_u = ev_to_iou(ev);
+ io_u = container_of(ev->obj, struct io_u, iocb);
if (ev->res != io_u->xfer_buflen) {
if (ev->res > io_u->xfer_buflen)
struct fio_overlapped *o;
o = malloc(sizeof(*o));
- o->io_complete = FALSE:
+ o->io_complete = FALSE;
o->io_u = io_u;
o->o.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
if (!o->o.hEvent) {
/*
* size of the file, offset into file, and io size from that offset
*/
- unsigned long long real_file_size;
- unsigned long long file_offset;
- unsigned long long io_size;
+ uint64_t real_file_size;
+ uint64_t file_offset;
+ uint64_t io_size;
- unsigned long long last_pos;
- unsigned long long last_start;
+ uint64_t last_pos;
+ uint64_t last_start;
- unsigned long long first_write;
- unsigned long long last_write;
+ uint64_t first_write;
+ uint64_t last_write;
/*
* For use by the io engine
*/
- uint64_t engine_data;
+ uintptr_t engine_data;
/*
* if io is protected by a semaphore, this is set
struct thread_data;
extern void close_files(struct thread_data *);
extern void close_and_free_files(struct thread_data *);
-extern unsigned long long get_start_offset(struct thread_data *);
+extern uint64_t get_start_offset(struct thread_data *);
extern int __must_check setup_files(struct thread_data *);
extern int __must_check file_invalidate_cache(struct thread_data *, struct fio_file *);
extern int __must_check generic_open_file(struct thread_data *, struct fio_file *);
return ret;
}
-unsigned long long get_start_offset(struct thread_data *td)
+uint64_t get_start_offset(struct thread_data *td)
{
return td->o.start_offset +
(td->thread_number - 1) * td->o.offset_increment;
{
unsigned int range_size, seed;
unsigned long nranges;
+ uint64_t file_size;
range_size = min(td->o.min_bs[DDIR_READ], td->o.min_bs[DDIR_WRITE]);
+ file_size = min(f->real_file_size, f->io_size);
- nranges = (f->real_file_size + range_size - 1) / range_size;
+ nranges = (file_size + range_size - 1) / range_size;
seed = jhash(f->file_name, strlen(f->file_name), 0) * td->thread_number;
if (!td->o.rand_repeatable)
.BI disk_util \fR=\fPbool
Generate disk utilization statistics if the platform supports it. Default: true.
.TP
+.BI clocksource \fR=\fPstr
+Use the given clocksource as the base of timing. The supported options are:
+.RS
+.TP
+.B gettimeofday
+gettimeofday(2)
+.TP
+.B clock_gettime
+clock_gettime(2)
+.TP
+.B cpu
+Internal CPU clock source
+.TP
+.RE
+.P
+\fBcpu\fR is the preferred clocksource if it is reliable, as it is very fast
+(and fio is heavy on time calls). Fio will automatically use this clocksource
+if it's supported and considered reliable on the system it is running on,
+unless another clocksource is specifically set. For x86/x86-64 CPUs, this
+means supporting TSC Invariant.
+.TP
.BI gtod_reduce \fR=\fPbool
Enable all of the gettimeofday() reducing options (disable_clat, disable_slat,
disable_bw) plus reduce precision of the timeout somewhat to really shrink the
#include "smalloc.h"
#include "hash.h"
+#include "os/os.h"
#ifdef ARCH_HAVE_CPU_CLOCK
static unsigned long cycles_per_usec;
-static unsigned long last_cycles;
-int tsc_reliable = 0;
+static unsigned long inv_cycles_per_usec;
#endif
-static struct timeval last_tv;
-static int last_tv_valid;
+int tsc_reliable = 0;
+
+struct tv_valid {
+ struct timeval last_tv;
+ int last_tv_valid;
+ unsigned long last_cycles;
+};
+static pthread_key_t tv_tls_key;
enum fio_cs fio_clock_source = FIO_PREFERRED_CLOCK_SOURCE;
int fio_clock_source_set = 0;
#endif /* FIO_DEBUG_TIME */
+static int fill_clock_gettime(struct timespec *ts)
+{
+#ifdef FIO_HAVE_CLOCK_MONOTONIC
+ return clock_gettime(CLOCK_MONOTONIC, ts);
+#else
+ return clock_gettime(CLOCK_REALTIME, ts);
+#endif
+}
+
#ifdef FIO_DEBUG_TIME
void fio_gettime(struct timeval *tp, void *caller)
#else
void fio_gettime(struct timeval *tp, void fio_unused *caller)
#endif
{
+ struct tv_valid *tv;
+
#ifdef FIO_DEBUG_TIME
if (!caller)
caller = __builtin_return_address(0);
return;
}
+ tv = pthread_getspecific(tv_tls_key);
+
switch (fio_clock_source) {
case CS_GTOD:
gettimeofday(tp, NULL);
case CS_CGETTIME: {
struct timespec ts;
-#ifdef FIO_HAVE_CLOCK_MONOTONIC
- if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0) {
-#else
- if (clock_gettime(CLOCK_REALTIME, &ts) < 0) {
-#endif
+ if (fill_clock_gettime(&ts) < 0) {
log_err("fio: clock_gettime fails\n");
assert(0);
}
unsigned long long usecs, t;
t = get_cpu_clock();
- if (t < last_cycles) {
+ if (tv && t < tv->last_cycles) {
dprint(FD_TIME, "CPU clock going back in time\n");
- t = last_cycles;
- }
+ t = tv->last_cycles;
+ } else if (tv)
+ tv->last_cycles = t;
- usecs = t / cycles_per_usec;
+ usecs = (t * inv_cycles_per_usec) / 16777216UL;
tp->tv_sec = usecs / 1000000;
tp->tv_usec = usecs % 1000000;
- last_cycles = t;
break;
}
#endif
* If Linux is using the tsc clock on non-synced processors,
* sometimes time can appear to drift backwards. Fix that up.
*/
- if (last_tv_valid) {
- if (tp->tv_sec < last_tv.tv_sec)
- tp->tv_sec = last_tv.tv_sec;
- else if (last_tv.tv_sec == tp->tv_sec &&
- tp->tv_usec < last_tv.tv_usec)
- tp->tv_usec = last_tv.tv_usec;
+ if (tv) {
+ if (tv->last_tv_valid) {
+ if (tp->tv_sec < tv->last_tv.tv_sec)
+ tp->tv_sec = tv->last_tv.tv_sec;
+ else if (tv->last_tv.tv_sec == tp->tv_sec &&
+ tp->tv_usec < tv->last_tv.tv_usec)
+ tp->tv_usec = tv->last_tv.tv_usec;
+ }
+ tv->last_tv_valid = 1;
+ memcpy(&tv->last_tv, tp, sizeof(*tp));
}
- last_tv_valid = 1;
- memcpy(&last_tv, tp, sizeof(*tp));
}
#ifdef ARCH_HAVE_CPU_CLOCK
static unsigned long get_cycles_per_usec(void)
{
+ struct timespec ts;
struct timeval s, e;
unsigned long long c_s, c_e;
- gettimeofday(&s, NULL);
+ fill_clock_gettime(&ts);
+ s.tv_sec = ts.tv_sec;
+ s.tv_usec = ts.tv_nsec / 1000;
+
c_s = get_cpu_clock();
do {
unsigned long long elapsed;
- gettimeofday(&e, NULL);
+ fill_clock_gettime(&ts);
+ e.tv_sec = ts.tv_sec;
+ e.tv_usec = ts.tv_nsec / 1000;
+
elapsed = utime_since(&s, &e);
if (elapsed >= 1280) {
c_e = get_cpu_clock();
dprint(FD_TIME, "cycles[%d]=%lu\n", i, cycles[i] / 10);
avg /= samples;
- avg = (avg + 9) / 10;
+ avg = (avg + 5) / 10;
dprint(FD_TIME, "avg: %lu\n", 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);
}
#else
static void calibrate_cpu_clock(void)
}
#endif
+void fio_local_clock_init(int is_thread)
+{
+ struct tv_valid *t;
+
+ t = calloc(sizeof(*t), 1);
+ if (pthread_setspecific(tv_tls_key, t))
+ log_err("fio: can't set TLS key\n");
+}
+
+static void kill_tv_tls_key(void *data)
+{
+ free(data);
+}
+
void fio_clock_init(void)
{
if (fio_clock_source == fio_clock_source_inited)
return;
- last_tv_valid = 0;
+ if (pthread_key_create(&tv_tls_key, kill_tv_tls_key))
+ log_err("fio: can't create TLS key\n");
+
fio_clock_source_inited = fio_clock_source;
calibrate_cpu_clock();
log_info("fio: clocksource=cpu may not be reliable\n");
}
-unsigned long long utime_since(struct timeval *s, struct timeval *e)
+uint64_t utime_since(struct timeval *s, struct timeval *e)
{
long sec, usec;
- unsigned long long ret;
+ uint64_t ret;
sec = e->tv_sec - s->tv_sec;
usec = e->tv_usec - s->tv_usec;
return ret;
}
-unsigned long long utime_since_now(struct timeval *s)
+uint64_t utime_since_now(struct timeval *s)
{
struct timeval t;
return utime_since(s, &t);
}
-unsigned long mtime_since(struct timeval *s, struct timeval *e)
+uint64_t mtime_since(struct timeval *s, struct timeval *e)
{
long sec, usec, ret;
return ret;
}
-unsigned long mtime_since_now(struct timeval *s)
+uint64_t mtime_since_now(struct timeval *s)
{
struct timeval t;
void *p = __builtin_return_address(0);
return mtime_since(s, &t);
}
-unsigned long time_since_now(struct timeval *s)
+uint64_t time_since_now(struct timeval *s)
{
return mtime_since_now(s) / 1000;
}
+
+#if defined(FIO_HAVE_CPU_AFFINITY) && defined(ARCH_HAVE_CPU_CLOCK)
+
+#define CLOCK_ENTRIES 100000
+
+struct clock_entry {
+ unsigned long seq;
+ unsigned long tsc;
+ unsigned long cpu;
+};
+
+struct clock_thread {
+ pthread_t thread;
+ int cpu;
+ pthread_mutex_t lock;
+ pthread_mutex_t started;
+ uint64_t *seq;
+ struct clock_entry *entries;
+};
+
+static inline uint64_t atomic64_inc_return(uint64_t *seq)
+{
+ return 1 + __sync_fetch_and_add(seq, 1);
+}
+
+static void *clock_thread_fn(void *data)
+{
+ struct clock_thread *t = data;
+ struct clock_entry *c;
+ os_cpu_mask_t cpu_mask;
+ int i;
+
+ memset(&cpu_mask, 0, sizeof(cpu_mask));
+ fio_cpu_set(&cpu_mask, t->cpu);
+
+ if (fio_setaffinity(gettid(), cpu_mask) == -1) {
+ log_err("clock setaffinity failed\n");
+ return (void *) 1;
+ }
+
+ pthread_mutex_lock(&t->lock);
+ pthread_mutex_unlock(&t->started);
+
+ c = &t->entries[0];
+ for (i = 0; i < CLOCK_ENTRIES; i++, c++) {
+ uint64_t seq, tsc;
+
+ c->cpu = t->cpu;
+ do {
+ seq = atomic64_inc_return(t->seq);
+ tsc = get_cpu_clock();
+ } while (seq != *t->seq);
+
+ c->seq = seq;
+ c->tsc = tsc;
+ }
+
+ log_info("cs: cpu%3d: %lu clocks seen\n", t->cpu, t->entries[CLOCK_ENTRIES - 1].tsc - t->entries[0].tsc);
+ return NULL;
+}
+
+static int clock_cmp(const void *p1, const void *p2)
+{
+ const struct clock_entry *c1 = p1;
+ const struct clock_entry *c2 = p2;
+
+ if (c1->seq == c2->seq)
+ log_err("cs: bug in atomic sequence!\n");
+
+ return c1->seq - c2->seq;
+}
+
+int fio_monotonic_clocktest(void)
+{
+ struct clock_thread *threads;
+ unsigned int nr_cpus = cpus_online();
+ struct clock_entry *entries;
+ unsigned long tentries, failed;
+ uint64_t seq = 0;
+ int i;
+
+ fio_debug |= 1U << FD_TIME;
+ calibrate_cpu_clock();
+ fio_debug &= ~(1U << FD_TIME);
+
+ threads = malloc(nr_cpus * sizeof(struct clock_thread));
+ tentries = CLOCK_ENTRIES * nr_cpus;
+ entries = malloc(tentries * sizeof(struct clock_entry));
+
+ log_info("cs: Testing %u CPUs\n", nr_cpus);
+
+ for (i = 0; i < nr_cpus; i++) {
+ struct clock_thread *t = &threads[i];
+
+ t->cpu = i;
+ t->seq = &seq;
+ t->entries = &entries[i * CLOCK_ENTRIES];
+ pthread_mutex_init(&t->lock, NULL);
+ pthread_mutex_init(&t->started, NULL);
+ pthread_mutex_lock(&t->lock);
+ pthread_create(&t->thread, NULL, clock_thread_fn, t);
+ }
+
+ for (i = 0; i < nr_cpus; i++) {
+ struct clock_thread *t = &threads[i];
+
+ pthread_mutex_lock(&t->started);
+ }
+
+ for (i = 0; i < nr_cpus; i++) {
+ struct clock_thread *t = &threads[i];
+
+ pthread_mutex_unlock(&t->lock);
+ }
+
+ for (failed = i = 0; i < nr_cpus; i++) {
+ struct clock_thread *t = &threads[i];
+ void *ret;
+
+ pthread_join(t->thread, &ret);
+ if (ret)
+ failed++;
+ }
+ free(threads);
+
+ if (failed) {
+ log_err("Clocksource test: %u threads failed\n", failed);
+ goto err;
+ }
+
+ qsort(entries, tentries, sizeof(struct clock_entry), clock_cmp);
+
+ for (failed = i = 0; i < tentries; i++) {
+ struct clock_entry *prev, *this = &entries[i];
+
+ if (!i) {
+ prev = this;
+ continue;
+ }
+
+ if (prev->tsc > this->tsc) {
+ uint64_t diff = prev->tsc - this->tsc;
+
+ log_info("cs: CPU clock mismatch (diff=%lu):\n", diff);
+ log_info("\t CPU%3lu: TSC=%lu, SEQ=%lu\n", prev->cpu, prev->tsc, prev->seq);
+ log_info("\t CPU%3lu: TSC=%lu, SEQ=%lu\n", this->cpu, this->tsc, this->seq);
+ failed++;
+ }
+
+ prev = this;
+ }
+
+ if (failed)
+ log_info("cs: Failed: %lu\n", failed);
+ else
+ log_info("cs: Pass!\n");
+
+err:
+ free(entries);
+ return !!failed;
+}
+
+#else /* defined(FIO_HAVE_CPU_AFFINITY) && defined(ARCH_HAVE_CPU_CLOCK) */
+
+int fio_monotonic_clocktest(void)
+{
+ log_info("cs: current platform does not support CPU clocks\n");
+ return 0;
+}
+
+#endif
extern void fio_gtod_init(void);
extern void fio_clock_init(void);
extern int fio_start_gtod_thread(void);
+extern int fio_monotonic_clocktest(void);
+extern void fio_local_clock_init(int);
extern struct timeval *fio_tv;
.has_arg = required_argument,
.val = 'C',
},
+ {
+ .name = (char *) "cpuclock-test",
+ .has_arg = no_argument,
+ .val = 'T',
+ },
{
.name = NULL,
},
printf(" --terse-version=x\tSet terse version output format to 'x'\n");
printf(" --version\t\tPrint version info and exit\n");
printf(" --help\t\tPrint this page\n");
+ printf(" --cpuclock-test\tPerform test/validation of CPU clock\n");
printf(" --cmdhelp=cmd\t\tPrint command help, \"all\" for all of"
" them\n");
printf(" --enghelp=engine\tPrint ioengine help, or list"
printf(" --daemonize=pidfile\tBackground fio server, write pid to file\n");
printf(" --client=hostname\tTalk to remote backend fio server at hostname\n");
printf("\nFio was written by Jens Axboe <jens.axboe@oracle.com>");
- printf("\n Jens Axboe <jaxboe@fusionio.com>\n");
+ printf("\n Jens Axboe <jaxboe@fusionio.com>\n");
}
#ifdef FIO_INC_DEBUG
optind++;
}
break;
+ case 'T':
+ do_exit++;
+ exit_val = fio_monotonic_clocktest();
+ break;
default:
do_exit++;
exit_val = 1;
<?define ProgramDirectory = ProgramFiles64Folder ?>\r
<?endif?>\r
\r
- <Product Id="C3DC8A4F-1191-412F-8287-ACB6BA798F6A"\r
+ <Product Id="F9883688-6AB3-4BD1-AB93-91D39F12F003"\r
Codepage="1252" Language="1033"\r
Manufacturer="fio" Name="fio"\r
- UpgradeCode="2338A332-5511-43cf-b9BD-5C60496CCFCC" Version="2.0.11">\r
+ UpgradeCode="2338A332-5511-43cf-b9BD-5C60496CCFCC" Version="2.0.13">\r
<Package\r
Comments="Contact: Your local administrator"\r
Description="Flexible IO Tester"\r
#ifndef DLFCN_H\r
#define DLFCN_H\r
- \r
+\r
#define RTLD_LAZY 1\r
\r
void *dlopen(const char *file, int mode);\r
\r
struct iovec\r
{\r
- void *iov_base; /* Base address of a memory region for input or output */\r
+ void *iov_base; /* Base address of a memory region for input or output */\r
size_t iov_len; /* The size of the memory pointed to by iov_base */\r
};\r
\r
\r
struct sockaddr_un\r
{\r
- sa_family_t sun_family; /* Address family */\r
+ sa_family_t sun_family; /* Address family */\r
char sun_path[]; /* Socket pathname */\r
};\r
\r
*/
uint16_t cmd_crc16; /* cmd checksum */
uint16_t pdu_crc16; /* payload checksum */
- uint8_t payload[0]; /* payload */
+ uint8_t payload[]; /* payload */
};
struct fio_net_cmd_reply {
struct cmd_single_line_pdu {
uint16_t len;
- uint8_t text[0];
+ uint8_t text[];
};
struct cmd_line_pdu {
uint16_t lines;
uint16_t client_type;
- struct cmd_single_line_pdu options[0];
+ struct cmd_single_line_pdu options[];
};
struct cmd_job_pdu {
* Network 'copy' of run_str[]
*/
uint32_t nr_threads;
- uint8_t run_str[0];
+ uint8_t run_str[];
};
extern void show_thread_status(struct thread_stat *ts, struct group_run_stats *rs);
struct fio_lfsr lfsr;
size_t size = (1UL << 28) - 200;
struct axmap *map;
+ int seed = 1;
- if (argc > 1)
+ if (argc > 1) {
size = strtoul(argv[1], NULL, 10);
+ if (argc > 2)
+ seed = strtoul(argv[2], NULL, 10);
+ }
printf("Using %llu entries\n", (unsigned long long) size);
- lfsr_init(&lfsr, size);
+ lfsr_init(&lfsr, size, seed);
map = axmap_new(size);
while (size--) {
} while (!td->terminate);
}
-unsigned long mtime_since_genesis(void)
+uint64_t mtime_since_genesis(void)
{
return mtime_since_now(&genesis);
}
#ifndef FIO_TIME_H
#define FIO_TIME_H
-extern unsigned long long utime_since(struct timeval *, struct timeval *);
-extern unsigned long long utime_since_now(struct timeval *);
-extern unsigned long mtime_since(struct timeval *, struct timeval *);
-extern unsigned long mtime_since_now(struct timeval *);
-extern unsigned long time_since_now(struct timeval *);
-extern unsigned long mtime_since_genesis(void);
+extern uint64_t utime_since(struct timeval *, struct timeval *);
+extern uint64_t utime_since_now(struct timeval *);
+extern uint64_t mtime_since(struct timeval *, struct timeval *);
+extern uint64_t mtime_since_now(struct timeval *);
+extern uint64_t time_since_now(struct timeval *);
+extern uint64_t mtime_since_genesis(void);
extern void usec_spin(unsigned int);
extern void 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 unsigned long long genesis_cycles;
extern void fio_time_init(void);
#endif