#!/bin/sh
GVF=FIO-VERSION-FILE
-DEF_VER=fio-3.7
+DEF_VER=fio-3.8
LF='
'
*ret = -io_u->error;
clear_io_u(td, io_u);
} else if (io_u->resid) {
- int bytes = io_u->xfer_buflen - io_u->resid;
+ long long bytes = io_u->xfer_buflen - io_u->resid;
struct fio_file *f = io_u->file;
if (bytes_issued)
if (x1 < y2 && y1 < x2) {
overlap = true;
- dprint(FD_IO, "in-flight overlap: %llu/%lu, %llu/%lu\n",
+ dprint(FD_IO, "in-flight overlap: %llu/%llu, %llu/%llu\n",
x1, io_u->buflen,
y1, check_io_u->buflen);
break;
log_io_piece(td, io_u);
if (td->o.io_submit_mode == IO_MODE_OFFLOAD) {
- const unsigned long blen = io_u->xfer_buflen;
+ const unsigned long long blen = io_u->xfer_buflen;
const enum fio_ddir __ddir = acct_ddir(io_u);
if (td->error)
static int init_io_u(struct thread_data *td)
{
struct io_u *io_u;
- unsigned int max_bs, min_write;
+ unsigned long long max_bs, min_write;
int cl_align, i, max_units;
int data_xfer = 1, err;
char *p;
td->orig_buffer_size += page_mask + td->o.mem_align;
if (td->o.mem_type == MEM_SHMHUGE || td->o.mem_type == MEM_MMAPHUGE) {
- unsigned long bs;
+ unsigned long long bs;
bs = td->orig_buffer_size + td->o.hugepage_size - 1;
td->orig_buffer_size = bs & ~(td->o.hugepage_size - 1);
o->start_offset_percent = le32_to_cpu(top->start_offset_percent);
for (i = 0; i < DDIR_RWDIR_CNT; i++) {
- o->bs[i] = le32_to_cpu(top->bs[i]);
- o->ba[i] = le32_to_cpu(top->ba[i]);
- o->min_bs[i] = le32_to_cpu(top->min_bs[i]);
- o->max_bs[i] = le32_to_cpu(top->max_bs[i]);
+ o->bs[i] = le64_to_cpu(top->bs[i]);
+ o->ba[i] = le64_to_cpu(top->ba[i]);
+ o->min_bs[i] = le64_to_cpu(top->min_bs[i]);
+ o->max_bs[i] = le64_to_cpu(top->max_bs[i]);
o->bssplit_nr[i] = le32_to_cpu(top->bssplit_nr[i]);
if (o->bssplit_nr[i]) {
o->bssplit[i] = malloc(o->bssplit_nr[i] * sizeof(struct bssplit));
for (j = 0; j < o->bssplit_nr[i]; j++) {
- o->bssplit[i][j].bs = le32_to_cpu(top->bssplit[i][j].bs);
+ o->bssplit[i][j].bs = le64_to_cpu(top->bssplit[i][j].bs);
o->bssplit[i][j].perc = le32_to_cpu(top->bssplit[i][j].perc);
}
}
o->gauss_dev.u.f = fio_uint64_to_double(le64_to_cpu(top->gauss_dev.u.i));
o->random_generator = le32_to_cpu(top->random_generator);
o->hugepage_size = le32_to_cpu(top->hugepage_size);
- o->rw_min_bs = le32_to_cpu(top->rw_min_bs);
+ o->rw_min_bs = le64_to_cpu(top->rw_min_bs);
o->thinktime = le32_to_cpu(top->thinktime);
o->thinktime_spin = le32_to_cpu(top->thinktime_spin);
o->thinktime_blocks = le32_to_cpu(top->thinktime_blocks);
top->gauss_dev.u.i = __cpu_to_le64(fio_double_to_uint64(o->gauss_dev.u.f));
top->random_generator = cpu_to_le32(o->random_generator);
top->hugepage_size = cpu_to_le32(o->hugepage_size);
- top->rw_min_bs = cpu_to_le32(o->rw_min_bs);
+ top->rw_min_bs = __cpu_to_le64(o->rw_min_bs);
top->thinktime = cpu_to_le32(o->thinktime);
top->thinktime_spin = cpu_to_le32(o->thinktime_spin);
top->thinktime_blocks = cpu_to_le32(o->thinktime_blocks);
top->write_hist_log = cpu_to_le32(o->write_hist_log);
for (i = 0; i < DDIR_RWDIR_CNT; i++) {
- top->bs[i] = cpu_to_le32(o->bs[i]);
- top->ba[i] = cpu_to_le32(o->ba[i]);
- top->min_bs[i] = cpu_to_le32(o->min_bs[i]);
- top->max_bs[i] = cpu_to_le32(o->max_bs[i]);
+ top->bs[i] = __cpu_to_le64(o->bs[i]);
+ top->ba[i] = __cpu_to_le64(o->ba[i]);
+ top->min_bs[i] = __cpu_to_le64(o->min_bs[i]);
+ top->max_bs[i] = __cpu_to_le64(o->max_bs[i]);
top->bssplit_nr[i] = cpu_to_le32(o->bssplit_nr[i]);
if (o->bssplit_nr[i]) {
bssplit_nr = BSSPLIT_MAX;
}
for (j = 0; j < bssplit_nr; j++) {
- top->bssplit[i][j].bs = cpu_to_le32(o->bssplit[i][j].bs);
+ top->bssplit[i][j].bs = cpu_to_le64(o->bssplit[i][j].bs);
top->bssplit[i][j].perc = cpu_to_le32(o->bssplit[i][j].perc);
}
}
entry = s->data.plat_entry;
io_u_plat = entry->io_u_plat;
- fprintf(f, "%lu, %u, %u, ", (unsigned long) s->time,
- io_sample_ddir(s), s->bs);
+ fprintf(f, "%lu, %u, %llu, ", (unsigned long) s->time,
+ io_sample_ddir(s), (unsigned long long) s->bs);
for (j = 0; j < FIO_IO_U_PLAT_NR - stride; j += stride) {
fprintf(f, "%llu, ", (unsigned long long)hist_sum(j, stride, io_u_plat, NULL));
}
s->time = le64_to_cpu(s->time);
s->data.val = le64_to_cpu(s->data.val);
s->__ddir = le32_to_cpu(s->__ddir);
- s->bs = le32_to_cpu(s->bs);
+ s->bs = le64_to_cpu(s->bs);
if (ret->log_offset) {
struct io_sample_offset *so = (void *) s;
*/
#define typecheck(type,x) \
({ type __dummy; \
- typeof(x) __dummy2; \
+ __typeof__(x) __dummy2; \
(void)(&__dummy == &__dummy2); \
1; \
})
#ifdef FIO_INTERNAL
#define ARRAY_SIZE(x) (sizeof((x)) / (sizeof((x)[0])))
-#define FIELD_SIZE(s, f) (sizeof(((typeof(s))0)->f))
+#define FIELD_SIZE(s, f) (sizeof(((__typeof__(s))0)->f))
#endif
#endif
struct gf_data *g = td->io_ops_data;
int ret = 0;
- dprint(FD_FILE, "fio queue len %lu\n", io_u->xfer_buflen);
+ dprint(FD_FILE, "fio queue len %llu\n", io_u->xfer_buflen);
fio_ro_check(td, io_u);
if (io_u->ddir == DDIR_READ)
io_u->error = EINVAL;
return FIO_Q_COMPLETED;
}
- dprint(FD_FILE, "fio len %lu ret %d\n", io_u->xfer_buflen, ret);
+ dprint(FD_FILE, "fio len %llu ret %d\n", io_u->xfer_buflen, ret);
if (io_u->file && ret >= 0 && ddir_rw(io_u->ddir))
LAST_POS(io_u->file) = io_u->offset + ret;
{
struct thread_options *o = &td->o;
- dprint(FD_IO,"o->rw_min_bs %d \n o->fsync_blocks %d \n o->fdatasync_blocks %d \n",
+ dprint(FD_IO,"o->rw_min_bs %llu \n o->fsync_blocks %d \n o->fdatasync_blocks %d \n",
o->rw_min_bs,o->fsync_blocks,o->fdatasync_blocks);
dprint(FD_IO, "DEBUG fio_libpmem_init\n");
*/
unsigned int major, minor;
int fileno;
- int bs;
+ unsigned long long bs;
char *file_name;
/*
{
int new_layout = 0, unlink_file = 0, flags;
unsigned long long left;
- unsigned int bs;
+ unsigned long long bs;
char *b = NULL;
if (read_only) {
{
int r, did_open = 0, old_runstate;
unsigned long long left;
- unsigned int bs;
+ unsigned long long bs;
bool ret = true;
char *b;
unsigned int i, nr_fs_extra = 0;
int err = 0, need_extend;
int old_state;
- const unsigned int bs = td_min_bs(td);
+ const unsigned long long bs = td_min_bs(td);
uint64_t fs = 0;
dprint(FD_FILE, "setup files\n");
return ddir_rw_sum(td->bytes_done) != 0;
}
-static inline unsigned int td_max_bs(struct thread_data *td)
+static inline unsigned long long td_max_bs(struct thread_data *td)
{
- unsigned int max_bs;
+ unsigned long long max_bs;
max_bs = max(td->o.max_bs[DDIR_READ], td->o.max_bs[DDIR_WRITE]);
return max(td->o.max_bs[DDIR_TRIM], max_bs);
}
-static inline unsigned int td_min_bs(struct thread_data *td)
+static inline unsigned long long td_min_bs(struct thread_data *td)
{
- unsigned int min_bs;
+ unsigned long long min_bs;
min_bs = min(td->o.min_bs[DDIR_READ], td->o.min_bs[DDIR_WRITE]);
return min(td->o.min_bs[DDIR_TRIM], min_bs);
#include <stdlib.h>
#include <stddef.h>
-#define container_of(ptr, type, member) ({ \
- const typeof( ((type *)0)->member ) *__mptr = (ptr); \
+#define container_of(ptr, type, member) ({ \
+ const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
/*
-#include <malloc.h>
+#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <locale.h>
-#include <malloc.h>
+#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
*
*/
#include <locale.h>
-#include <malloc.h>
+#include <stdlib.h>
#include <string.h>
+#include <libgen.h>
#include <glib.h>
#include <cairo.h>
#include <locale.h>
-#include <malloc.h>
+#include <stdlib.h>
#include <string.h>
#include <glib.h>
*
*/
#include <string.h>
-#include <malloc.h>
+#include <stdlib.h>
#include <math.h>
#include <assert.h>
#include <stdlib.h>
static int __setup_rate(struct thread_data *td, enum fio_ddir ddir)
{
- unsigned int bs = td->o.min_bs[ddir];
+ unsigned long long bs = td->o.min_bs[ddir];
assert(ddir_rw(ddir));
* If size is set but less than the min block size, complain
*/
if (o->size && o->size < td_min_bs(td)) {
- log_err("fio: size too small, must not be less than minimum block size: %llu < %u\n",
+ log_err("fio: size too small, must not be less than minimum block size: %llu < %llu\n",
(unsigned long long) o->size, td_min_bs(td));
ret |= 1;
}
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(" --eta-newline=t\tForce a new line for every 't'");
printf(" period passed\n");
printf(" --status-interval=t\tForce full status dump every");
printf(" 't' period passed\n");
*/
static void mark_random_map(struct thread_data *td, struct io_u *io_u)
{
- unsigned int min_bs = td->o.min_bs[io_u->ddir];
+ unsigned long long min_bs = td->o.min_bs[io_u->ddir];
struct fio_file *f = io_u->file;
- unsigned int nr_blocks;
+ unsigned long long nr_blocks;
uint64_t block;
block = (io_u->offset - f->file_offset) / (uint64_t) min_bs;
}
static inline bool io_u_fits(struct thread_data *td, struct io_u *io_u,
- unsigned int buflen)
+ unsigned long long buflen)
{
struct fio_file *f = io_u->file;
return io_u->offset + buflen <= f->io_size + get_start_offset(td, f);
}
-static unsigned int get_next_buflen(struct thread_data *td, struct io_u *io_u,
+static unsigned long long get_next_buflen(struct thread_data *td, struct io_u *io_u,
bool is_random)
{
int ddir = io_u->ddir;
- unsigned int buflen = 0;
- unsigned int minbs, maxbs;
+ unsigned long long buflen = 0;
+ unsigned long long minbs, maxbs;
uint64_t frand_max, r;
bool power_2;
r = __rand(&td->bsrange_state[ddir]);
if (!td->o.bssplit_nr[ddir]) {
- buflen = minbs + (unsigned int) ((double) maxbs *
+ buflen = minbs + (unsigned long long) ((double) maxbs *
(r / (frand_max + 1.0)));
} else {
long long perc = 0;
}
if (io_u->offset + io_u->buflen > io_u->file->real_file_size) {
- dprint(FD_IO, "io_u %p, off=0x%llx + len=0x%lx exceeds file size=0x%llx\n",
+ dprint(FD_IO, "io_u %p, off=0x%llx + len=0x%llx exceeds file size=0x%llx\n",
io_u,
(unsigned long long) io_u->offset, io_u->buflen,
(unsigned long long) io_u->file->real_file_size);
*/
static void small_content_scramble(struct io_u *io_u)
{
- unsigned int i, nr_blocks = io_u->buflen >> 9;
+ unsigned long long i, nr_blocks = io_u->buflen >> 9;
unsigned int offset;
uint64_t boffset, *iptr;
char *p;
if (td_non_fatal_error(td, eb, io_u->error) && !td->o.error_dump)
return;
- log_err("fio: io_u error%s%s: %s: %s offset=%llu, buflen=%lu\n",
+ log_err("fio: io_u error%s%s: %s: %s offset=%llu, buflen=%llu\n",
io_u->file ? " on file " : "",
io_u->file ? io_u->file->file_name : "",
strerror(io_u->error),
td->last_ddir = ddir;
if (!io_u->error && ddir_rw(ddir)) {
- unsigned int bytes = io_u->buflen - io_u->resid;
+ unsigned long long bytes = io_u->buflen - io_u->resid;
int ret;
td->io_blocks[ddir]++;
frand_copy(&td->buf_state_prev, rs);
}
-void fill_io_buffer(struct thread_data *td, void *buf, unsigned int min_write,
- unsigned int max_bs)
+void fill_io_buffer(struct thread_data *td, void *buf, unsigned long long min_write,
+ unsigned long long max_bs)
{
struct thread_options *o = &td->o;
if (o->compress_percentage || o->dedupe_percentage) {
unsigned int perc = td->o.compress_percentage;
struct frand_state *rs;
- unsigned int left = max_bs;
- unsigned int this_write;
+ unsigned long long left = max_bs;
+ unsigned long long this_write;
do {
rs = get_buf_state(td);
if (perc) {
this_write = min_not_zero(min_write,
- td->o.compress_chunk);
+ (unsigned long long) td->o.compress_chunk);
fill_random_buf_percentage(rs, buf, perc,
this_write, this_write,
* "randomly" fill the buffer contents
*/
void io_u_fill_buffer(struct thread_data *td, struct io_u *io_u,
- unsigned int min_write, unsigned int max_bs)
+ unsigned long long min_write, unsigned long long max_bs)
{
io_u->buf_filled_len = 0;
fill_io_buffer(td, io_u->buf, min_write, max_bs);
/*
* Allocated/set buffer and length
*/
- unsigned long buflen;
+ unsigned long long buflen;
unsigned long long offset;
void *buf;
* partial transfers / residual data counts
*/
void *xfer_buf;
- unsigned long xfer_buflen;
+ unsigned long long xfer_buflen;
/*
* Parameter related to pre-filled buffers and
* their size to handle variable block sizes.
*/
- unsigned long buf_filled_len;
+ unsigned long long buf_filled_len;
struct io_piece *ipo;
extern int io_u_quiesce(struct thread_data *);
extern void io_u_log_error(struct thread_data *, struct io_u *);
extern void io_u_mark_depth(struct thread_data *, unsigned int);
-extern void fill_io_buffer(struct thread_data *, void *, unsigned int, unsigned int);
-extern void io_u_fill_buffer(struct thread_data *td, struct io_u *, unsigned int, unsigned int);
+extern void fill_io_buffer(struct thread_data *, void *, unsigned long long, unsigned long long);
+extern void io_u_fill_buffer(struct thread_data *td, struct io_u *, unsigned long long, unsigned long long);
void io_u_mark_complete(struct thread_data *, unsigned int);
void io_u_mark_submit(struct thread_data *, unsigned int);
bool queue_full(const struct thread_data *);
struct fio_file *f = io_u->file;
if (f)
- dprint(FD_IO, "%s: io_u %p: off=0x%llx,len=0x%lx,ddir=%d,file=%s\n",
+ dprint(FD_IO, "%s: io_u %p: off=0x%llx,len=0x%llx,ddir=%d,file=%s\n",
p, io_u,
(unsigned long long) io_u->offset,
io_u->buflen, io_u->ddir,
f->file_name);
else
- dprint(FD_IO, "%s: io_u %p: off=0x%llx,len=0x%lx,ddir=%d\n",
+ dprint(FD_IO, "%s: io_u %p: off=0x%llx,len=0x%llx,ddir=%d\n",
p, io_u,
(unsigned long long) io_u->offset,
io_u->buflen, io_u->ddir);
enum fio_q_status td_io_queue(struct thread_data *td, struct io_u *io_u)
{
const enum fio_ddir ddir = acct_ddir(io_u);
- unsigned long buflen = io_u->xfer_buflen;
+ unsigned long long buflen = io_u->xfer_buflen;
enum fio_q_status ret;
dprint_io_u(io_u, "queue");
if (!td->o.write_iolog_file)
return;
- fprintf(td->iolog_f, "%s %s %llu %lu\n", io_u->file->file_name,
+ fprintf(td->iolog_f, "%s %s %llu %llu\n", io_u->file->file_name,
io_ddir_name(io_u->ddir),
io_u->offset, io_u->buflen);
}
io_u->buflen = ipo->len;
io_u->file = td->files[ipo->fileno];
get_file(io_u->file);
- dprint(FD_IO, "iolog: get %llu/%lu/%s\n", io_u->offset,
+ dprint(FD_IO, "iolog: get %llu/%llu/%s\n", io_u->offset,
io_u->buflen, io_u->file->file_name);
if (ipo->delay)
iolog_delay(td, ipo->delay);
entry_before = flist_first_entry(&entry->list, struct io_u_plat_entry, list);
io_u_plat_before = entry_before->io_u_plat;
- fprintf(f, "%lu, %u, %u, ", (unsigned long) s->time,
- io_sample_ddir(s), s->bs);
+ fprintf(f, "%lu, %u, %llu, ", (unsigned long) s->time,
+ io_sample_ddir(s), (unsigned long long) s->bs);
for (j = 0; j < FIO_IO_U_PLAT_NR - stride; j += stride) {
fprintf(f, "%llu, ", (unsigned long long)
hist_sum(j, stride, io_u_plat, io_u_plat_before));
s = __get_sample(samples, log_offset, i);
if (!log_offset) {
- fprintf(f, "%lu, %" PRId64 ", %u, %u\n",
+ fprintf(f, "%lu, %" PRId64 ", %u, %llu\n",
(unsigned long) s->time,
s->data.val,
- io_sample_ddir(s), s->bs);
+ io_sample_ddir(s), (unsigned long long) s->bs);
} else {
struct io_sample_offset *so = (void *) s;
- fprintf(f, "%lu, %" PRId64 ", %u, %u, %llu\n",
+ fprintf(f, "%lu, %" PRId64 ", %u, %llu, %llu\n",
(unsigned long) s->time,
s->data.val,
- io_sample_ddir(s), s->bs,
+ io_sample_ddir(s), (unsigned long long) s->bs,
(unsigned long long) so->offset);
}
}
uint64_t time;
union io_sample_data data;
uint32_t __ddir;
- uint32_t bs;
+ uint64_t bs;
};
struct io_sample_offset {
#ifndef min
#define min(x,y) ({ \
- typeof(x) _x = (x); \
- typeof(y) _y = (y); \
+ __typeof__(x) _x = (x); \
+ __typeof__(y) _y = (y); \
(void) (&_x == &_y); \
_x < _y ? _x : _y; })
#endif
#ifndef max
#define max(x,y) ({ \
- typeof(x) _x = (x); \
- typeof(y) _y = (y); \
+ __typeof__(x) _x = (x); \
+ __typeof__(y) _y = (y); \
(void) (&_x == &_y); \
_x > _y ? _x : _y; })
#endif
#define min_not_zero(x, y) ({ \
- typeof(x) __x = (x); \
- typeof(y) __y = (y); \
+ __typeof__(x) __x = (x); \
+ __typeof__(y) __y = (y); \
__x == 0 ? __y : ((__y == 0) ? __x : min(__x, __y)); })
#endif
struct split {
unsigned int nr;
- unsigned int val1[ZONESPLIT_MAX];
+ unsigned long long val1[ZONESPLIT_MAX];
unsigned long long val2[ZONESPLIT_MAX];
};
bool data)
{
unsigned int i, perc, perc_missing;
- unsigned int max_bs, min_bs;
+ unsigned long long max_bs, min_bs;
struct split split;
memset(&split, 0, sizeof(split));
.name = "bs",
.lname = "Block size",
.alias = "blocksize",
- .type = FIO_OPT_INT,
+ .type = FIO_OPT_ULL,
.off1 = offsetof(struct thread_options, bs[DDIR_READ]),
.off2 = offsetof(struct thread_options, bs[DDIR_WRITE]),
.off3 = offsetof(struct thread_options, bs[DDIR_TRIM]),
.name = "ba",
.lname = "Block size align",
.alias = "blockalign",
- .type = FIO_OPT_INT,
+ .type = FIO_OPT_ULL,
.off1 = offsetof(struct thread_options, ba[DDIR_READ]),
.off2 = offsetof(struct thread_options, ba[DDIR_WRITE]),
.off3 = offsetof(struct thread_options, ba[DDIR_TRIM]),
{
.name = "bssplit",
.lname = "Block size split",
- .type = FIO_OPT_STR,
+ .type = FIO_OPT_STR_ULL,
.cb = str_bssplit_cb,
.off1 = offsetof(struct thread_options, bssplit),
.help = "Set a specific mix of block sizes",
#define min(a, b) MIN(a, b) /* glue for linux kernel source */
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
-#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
+#define ALIGN(x,a) __ALIGN_MASK(x,(__typeof__(x))(a)-1)
#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
#define min_t(t,x,y) ({ \
- typeof((x)) _x = (x); \
- typeof((y)) _y = (y); \
+ __typeof__((x)) _x = (x); \
+ __typeof__((y)) _y = (y); \
(_x < _y) ? _x : _y; \
})
#define max_t(t,x,y) ({ \
- typeof((x)) _x = (x); \
- typeof((y)) _y = (y); \
+ __typeof__((x)) _x = (x); \
+ __typeof__((y)) _y = (y); \
(_x > _y) ? _x : _y; \
})
static const char *opt_type_names[] = {
"OPT_INVALID",
"OPT_STR",
+ "OPT_STR_ULL",
"OPT_STR_MULTI",
"OPT_STR_VAL",
"OPT_STR_VAL_TIME",
"OPT_STR_STORE",
"OPT_RANGE",
"OPT_INT",
+ "OPT_ULL",
"OPT_BOOL",
"OPT_FLOAT_LIST",
"OPT_STR_SET",
*(s + 1) = '\0';
}
-static int check_range_bytes(const char *str, long *val, void *data)
+static int check_range_bytes(const char *str, long long *val, void *data)
{
long long __val;
int il=0, *ilp;
fio_fp64_t *flp;
long long ull, *ullp;
- long ul1, ul2;
+ long ul2;
+ long long ull1, ull2;
double uf;
char **cp = NULL;
int ret = 0, is_time = 0;
switch (o->type) {
case FIO_OPT_STR:
+ case FIO_OPT_STR_ULL:
case FIO_OPT_STR_MULTI: {
fio_opt_str_fn *fn = o->cb;
break;
if (!strncmp(vp->ival, ptr, str_match_len(vp, ptr))) {
ret = 0;
- if (o->off1)
+ if (!o->off1)
+ continue;
+ if (o->type == FIO_OPT_STR_ULL)
+ val_store(ullp, vp->oval, o->off1, vp->orval, data, o);
+ else
val_store(ilp, vp->oval, o->off1, vp->orval, data, o);
continue;
}
}
case FIO_OPT_STR_VAL_TIME:
is_time = 1;
+ /* fall through */
+ case FIO_OPT_ULL:
case FIO_OPT_INT:
case FIO_OPT_STR_VAL: {
fio_opt_str_val_fn *fn = o->cb;
if (o->maxval && ull > o->maxval) {
log_err("max value out of range: %llu"
- " (%u max)\n", ull, o->maxval);
+ " (%llu max)\n", ull, o->maxval);
return 1;
}
if (o->minval && ull < o->minval) {
val_store(ilp, ull, o->off3, 0, data, o);
}
}
+ } else if (o->type == FIO_OPT_ULL) {
+ if (first)
+ val_store(ullp, ull, o->off1, 0, data, o);
+ if (curr == 1) {
+ if (o->off2)
+ val_store(ullp, ull, o->off2, 0, data, o);
+ }
+ if (curr == 2) {
+ if (o->off3)
+ val_store(ullp, ull, o->off3, 0, data, o);
+ }
+ if (!more) {
+ if (curr < 1) {
+ if (o->off2)
+ val_store(ullp, ull, o->off2, 0, data, o);
+ }
+ if (curr < 2) {
+ if (o->off3)
+ val_store(ullp, ull, o->off3, 0, data, o);
+ }
+ }
} else {
if (first)
val_store(ullp, ull, o->off1, 0, data, o);
p1 = tmp;
ret = 1;
- if (!check_range_bytes(p1, &ul1, data) &&
- !check_range_bytes(p2, &ul2, data)) {
+ if (!check_range_bytes(p1, &ull1, data) &&
+ !check_range_bytes(p2, &ull2, data)) {
ret = 0;
- if (ul1 > ul2) {
- unsigned long foo = ul1;
+ if (ull1 > ull2) {
+ unsigned long long foo = ull1;
- ul1 = ul2;
- ul2 = foo;
+ ull1 = ull2;
+ ull2 = foo;
}
if (first) {
- val_store(ilp, ul1, o->off1, 0, data, o);
- val_store(ilp, ul2, o->off2, 0, data, o);
+ val_store(ullp, ull1, o->off1, 0, data, o);
+ val_store(ullp, ull2, o->off2, 0, data, o);
}
if (curr == 1) {
if (o->off3 && o->off4) {
- val_store(ilp, ul1, o->off3, 0, data, o);
- val_store(ilp, ul2, o->off4, 0, data, o);
+ val_store(ullp, ull1, o->off3, 0, data, o);
+ val_store(ullp, ull2, o->off4, 0, data, o);
}
}
if (curr == 2) {
if (o->off5 && o->off6) {
- val_store(ilp, ul1, o->off5, 0, data, o);
- val_store(ilp, ul2, o->off6, 0, data, o);
+ val_store(ullp, ull1, o->off5, 0, data, o);
+ val_store(ullp, ull2, o->off6, 0, data, o);
}
}
if (!more) {
if (curr < 1) {
if (o->off3 && o->off4) {
- val_store(ilp, ul1, o->off3, 0, data, o);
- val_store(ilp, ul2, o->off4, 0, data, o);
+ val_store(ullp, ull1, o->off3, 0, data, o);
+ val_store(ullp, ull2, o->off4, 0, data, o);
}
}
if (curr < 2) {
if (o->off5 && o->off6) {
- val_store(ilp, ul1, o->off5, 0, data, o);
- val_store(ilp, ul2, o->off6, 0, data, o);
+ val_store(ullp, ull1, o->off5, 0, data, o);
+ val_store(ullp, ull2, o->off6, 0, data, o);
}
}
}
break;
if (o->maxval && il > (int) o->maxval) {
- log_err("max value out of range: %d (%d max)\n",
+ log_err("max value out of range: %d (%llu max)\n",
il, o->maxval);
return 1;
}
}
case FIO_OPT_DEPRECATED:
ret = 1;
+ /* fall through */
case FIO_OPT_SOFT_DEPRECATED:
log_info("Option %s is deprecated\n", o->name);
break;
if (!o->maxval)
o->maxval = UINT_MAX;
}
+ if (o->type == FIO_OPT_ULL) {
+ if (!o->maxval)
+ o->maxval = ULLONG_MAX;
+ }
if (o->type == FIO_OPT_STR_SET && o->def && !o->no_warn_def) {
log_err("Option %s: string set option with"
" default will always be true\n", o->name);
enum fio_opt_type {
FIO_OPT_INVALID = 0,
FIO_OPT_STR,
+ FIO_OPT_STR_ULL,
FIO_OPT_STR_MULTI,
FIO_OPT_STR_VAL,
FIO_OPT_STR_VAL_TIME,
FIO_OPT_STR_STORE,
FIO_OPT_RANGE,
FIO_OPT_INT,
+ FIO_OPT_ULL,
FIO_OPT_BOOL,
FIO_OPT_FLOAT_LIST,
FIO_OPT_STR_SET,
*/
struct value_pair {
const char *ival; /* string option */
- unsigned int oval; /* output value */
+ unsigned long long oval;/* output value */
const char *help; /* help text for sub option */
int orval; /* OR value */
void *cb; /* sub-option callback */
unsigned int off4;
unsigned int off5;
unsigned int off6;
- unsigned int maxval; /* max and min value */
+ unsigned long long maxval; /* max and min value */
int minval;
double maxfp; /* max and min floating value */
double minfp;
s->time = cpu_to_le64(s->time);
s->data.val = cpu_to_le64(s->data.val);
s->__ddir = cpu_to_le32(s->__ddir);
- s->bs = cpu_to_le32(s->bs);
+ s->bs = cpu_to_le64(s->bs);
if (log->log_offset) {
struct io_sample_offset *so = (void *) s;
};
enum {
- FIO_SERVER_VER = 73,
+ FIO_SERVER_VER = 74,
FIO_SERVER_MAX_FRAGMENT_PDU = 1024,
FIO_SERVER_MAX_CMD_MB = 2048,
static int compare_block_infos(const void *bs1, const void *bs2)
{
- uint32_t block1 = *(uint32_t *)bs1;
- uint32_t block2 = *(uint32_t *)bs2;
+ uint64_t block1 = *(uint64_t *)bs1;
+ uint64_t block2 = *(uint64_t *)bs2;
int state1 = BLOCK_INFO_STATE(block1);
int state2 = BLOCK_INFO_STATE(block2);
int bscat1 = block_state_category(state1);
}
static void __add_log_sample(struct io_log *iolog, union io_sample_data data,
- enum fio_ddir ddir, unsigned int bs,
+ enum fio_ddir ddir, unsigned long long bs,
unsigned long t, uint64_t offset)
{
struct io_logs *cur_log;
static unsigned long add_log_sample(struct thread_data *td,
struct io_log *iolog,
union io_sample_data data,
- enum fio_ddir ddir, unsigned int bs,
+ enum fio_ddir ddir, unsigned long long bs,
uint64_t offset)
{
unsigned long elapsed, this_window;
_add_stat_to_log(td->iops_log, elapsed, td->o.log_max != 0);
}
-void add_agg_sample(union io_sample_data data, enum fio_ddir ddir, unsigned int bs)
+void add_agg_sample(union io_sample_data data, enum fio_ddir ddir, unsigned long long bs)
{
struct io_log *iolog;
}
void add_clat_sample(struct thread_data *td, enum fio_ddir ddir,
- unsigned long long nsec, unsigned int bs, uint64_t offset)
+ unsigned long long nsec, unsigned long long bs,
+ uint64_t offset)
{
unsigned long elapsed, this_window;
struct thread_stat *ts = &td->ts;
}
void add_slat_sample(struct thread_data *td, enum fio_ddir ddir,
- unsigned long usec, unsigned int bs, uint64_t offset)
+ unsigned long usec, unsigned long long bs, uint64_t offset)
{
struct thread_stat *ts = &td->ts;
}
void add_lat_sample(struct thread_data *td, enum fio_ddir ddir,
- unsigned long long nsec, unsigned int bs, uint64_t offset)
+ unsigned long long nsec, unsigned long long bs,
+ uint64_t offset)
{
struct thread_stat *ts = &td->ts;
add_stat_sample(&stat[ddir], rate);
if (log) {
- unsigned int bs = 0;
+ unsigned long long bs = 0;
if (td->o.min_bs[ddir] == td->o.max_bs[ddir])
bs = td->o.min_bs[ddir];
extern void clear_rusage_stat(struct thread_data *);
extern void add_lat_sample(struct thread_data *, enum fio_ddir, unsigned long long,
- unsigned int, uint64_t);
+ unsigned long long, uint64_t);
extern void add_clat_sample(struct thread_data *, enum fio_ddir, unsigned long long,
- unsigned int, uint64_t);
+ unsigned long long, uint64_t);
extern void add_slat_sample(struct thread_data *, enum fio_ddir, unsigned long,
- unsigned int, uint64_t);
-extern void add_agg_sample(union io_sample_data, enum fio_ddir, unsigned int);
+ unsigned long long, uint64_t);
+extern void add_agg_sample(union io_sample_data, enum fio_ddir, unsigned long long);
extern void add_iops_sample(struct thread_data *, struct io_u *,
unsigned int);
extern void add_bw_sample(struct thread_data *, struct io_u *,
#define ZONESPLIT_MAX 256
struct bssplit {
- uint32_t bs;
+ uint64_t bs;
uint32_t perc;
};
unsigned long long start_offset;
unsigned long long start_offset_align;
- unsigned int bs[DDIR_RWDIR_CNT];
- unsigned int ba[DDIR_RWDIR_CNT];
- unsigned int min_bs[DDIR_RWDIR_CNT];
- unsigned int max_bs[DDIR_RWDIR_CNT];
+ unsigned long long bs[DDIR_RWDIR_CNT];
+ unsigned long long ba[DDIR_RWDIR_CNT];
+ unsigned long long min_bs[DDIR_RWDIR_CNT];
+ unsigned long long max_bs[DDIR_RWDIR_CNT];
struct bssplit *bssplit[DDIR_RWDIR_CNT];
unsigned int bssplit_nr[DDIR_RWDIR_CNT];
unsigned int perc_rand[DDIR_RWDIR_CNT];
unsigned int hugepage_size;
- unsigned int rw_min_bs;
+ unsigned long long rw_min_bs;
+ unsigned int pad2;
unsigned int thinktime;
unsigned int thinktime_spin;
unsigned int thinktime_blocks;
uint64_t start_offset;
uint64_t start_offset_align;
- uint32_t bs[DDIR_RWDIR_CNT];
- uint32_t ba[DDIR_RWDIR_CNT];
- uint32_t min_bs[DDIR_RWDIR_CNT];
- uint32_t max_bs[DDIR_RWDIR_CNT];
+ uint64_t bs[DDIR_RWDIR_CNT];
+ uint64_t ba[DDIR_RWDIR_CNT];
+ uint64_t min_bs[DDIR_RWDIR_CNT];
+ uint64_t max_bs[DDIR_RWDIR_CNT];
struct bssplit bssplit[DDIR_RWDIR_CNT][BSSPLIT_MAX];
uint32_t bssplit_nr[DDIR_RWDIR_CNT];
uint32_t perc_rand[DDIR_RWDIR_CNT];
uint32_t hugepage_size;
- uint32_t rw_min_bs;
+ uint64_t rw_min_bs;
+ uint32_t pad2;
uint32_t thinktime;
uint32_t thinktime_spin;
uint32_t thinktime_blocks;
#include <stdio.h>
#include <math.h>
-#include <malloc.h>
+#include <stdlib.h>
#include <string.h>
/*
mem_is_zero_slow(io_u->buf, io_u->buflen, &offset);
- log_err("trim: verify failed at file %s offset %llu, length %lu"
+ log_err("trim: verify failed at file %s offset %llu, length %llu"
", block offset %lu\n",
io_u->file->file_name, io_u->offset, io_u->buflen,
(unsigned long) offset);
struct io_u *io = priv;
unsigned long long off;
- typecheck(typeof(off), io->offset);
+ typecheck(__typeof__(off), io->offset);
off = cpu_to_le64((uint64_t)io->offset);
len = min(len, (unsigned int)sizeof(off));
memcpy(buf, &off, len);