projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add support for queuing > 1 command at the time
[fio.git]
/
init.c
diff --git
a/init.c
b/init.c
index e09a1f9eca44a2804c0c226d29c06ee9e4f3413f..9e7fb2c055e62a17ceac9dbf78757d1b83bd357c 100644
(file)
--- a/
init.c
+++ b/
init.c
@@
-81,7
+81,7
@@
static struct fio_option options[] = {
.help = "IO engine to use",
.def = "sync",
.posval = { "sync", "libaio", "posixaio", "mmap", "splice",
.help = "IO engine to use",
.def = "sync",
.posval = { "sync", "libaio", "posixaio", "mmap", "splice",
- "sg", "null", "net", },
+ "sg", "null", "net",
"syslet-rw"
},
},
{
.name = "iodepth",
},
{
.name = "iodepth",
@@
-330,6
+330,13
@@
static struct fio_option options[] = {
.help = "Idle time between IO buffers (usec)",
.def = "0",
},
.help = "Idle time between IO buffers (usec)",
.def = "0",
},
+ {
+ .name = "thinktime_spin",
+ .type = FIO_OPT_INT,
+ .off1 = td_var_offset(thinktime_spin),
+ .help = "Start thinktime by spinning this amount (usec)",
+ .def = "0",
+ },
{
.name = "thinktime_blocks",
.type = FIO_OPT_INT,
{
.name = "thinktime_blocks",
.type = FIO_OPT_INT,
@@
-631,6
+638,12
@@
static void fixup_options(struct thread_data *td)
*/
if (td->filetype == FIO_TYPE_CHAR && td->odirect)
td->odirect = 0;
*/
if (td->filetype == FIO_TYPE_CHAR && td->odirect)
td->odirect = 0;
+
+ /*
+ * thinktime_spin must be less than thinktime
+ */
+ if (td->thinktime_spin > td->thinktime)
+ td->thinktime_spin = td->thinktime;
}
/*
}
/*
@@
-639,7
+652,7
@@
static void fixup_options(struct thread_data *td)
static char *to_kmg(unsigned int val)
{
char *buf = malloc(32);
static char *to_kmg(unsigned int val)
{
char *buf = malloc(32);
- char post[] = { 0, 'K', 'M', 'G', 'P', 0 };
+ char post[] = { 0, 'K', 'M', 'G', 'P',
'E',
0 };
char *p = post;
do {
char *p = post;
do {
@@
-679,7
+692,7
@@
static int add_job(struct thread_data *td, const char *jobname, int job_add_num)
td->io_ops->flags |= FIO_RAWIO;
td->filetype = FIO_TYPE_FILE;
td->io_ops->flags |= FIO_RAWIO;
td->filetype = FIO_TYPE_FILE;
- if (
!stat(job
name, &sb)) {
+ if (
td->filename && !lstat(td->file
name, &sb)) {
if (S_ISBLK(sb.st_mode))
td->filetype = FIO_TYPE_BD;
else if (S_ISCHR(sb.st_mode))
if (S_ISBLK(sb.st_mode))
td->filetype = FIO_TYPE_BD;
else if (S_ISCHR(sb.st_mode))
@@
-845,7
+858,7
@@
int init_random_state(struct thread_data *td)
return 0;
if (td->rand_repeatable)
return 0;
if (td->rand_repeatable)
- seeds[3] = FIO_RANDSEED;
+ seeds[3] = FIO_RANDSEED
* td->thread_number
;
if (!td->norandommap) {
for_each_file(td, f, i) {
if (!td->norandommap) {
for_each_file(td, f, i) {