#define DEF_RWMIX_READ (50)
#define DEF_NICE (0)
-static int def_sequential = DEF_SEQUENTIAL;
-static int def_bs = DEF_BS;
static int def_timeout = DEF_TIMEOUT;
-static int def_repeatable = DEF_RAND_REPEAT;
-static int def_odirect = DEF_ODIRECT;
static char fio_version_string[] = "fio 1.4";
char tmp[PATH_MAX];
if (td->directory && td->directory[0] != '\0')
- sprintf(tmp, "%s/%s.%d", td->directory, jobname, td->jobnum);
+ sprintf(tmp, "%s/%s.%d", td->directory, jobname, td->thread_number);
else
- sprintf(tmp, "%s.%d", jobname, td->jobnum);
+ sprintf(tmp, "%s.%d", jobname, td->thread_number);
td->file_name = strdup(tmp);
} else
td->file_name = strdup(jobname);
td_new->numjobs = 1;
td_new->stonewall = 0;
- td_new->jobnum = numjobs;
job_add_num = numjobs - 1;
if (add_job(td_new, jobname, job_add_num))
if (td->sequential)
return 0;
- if (def_repeatable)
+ if (td->rand_repeatable)
seeds[3] = DEF_RANDSEED;
blocks = (td->io_size + td->min_bs - 1) / td->min_bs;
/*
* Seperate multiple job files by a stonewall
*/
- if (stonewall) {
+ if (!global && stonewall) {
td->stonewall = stonewall;
stonewall = 0;
}
fgetpos(f, &off);
continue;
}
+ if (!check_int(p, "rand_repeatable", &il)) {
+ td->rand_repeatable = il;
+ fgetpos(f, &off);
+ continue;
+ }
if (!check_int(p, "rate", &td->rate)) {
fgetpos(f, &off);
continue;
*/
def_thread.ddir = DDIR_READ;
def_thread.iomix = 0;
- def_thread.bs = def_bs;
+ def_thread.bs = DEF_BS;
def_thread.min_bs = -1;
def_thread.max_bs = -1;
def_thread.io_engine = DEF_IO_ENGINE;
strcpy(def_thread.io_engine_name, DEF_IO_ENGINE_NAME);
- def_thread.odirect = def_odirect;
+ def_thread.odirect = DEF_ODIRECT;
def_thread.ratecycle = DEF_RATE_CYCLE;
- def_thread.sequential = def_sequential;
+ def_thread.sequential = DEF_SEQUENTIAL;
def_thread.timeout = def_timeout;
def_thread.create_file = DEF_CREATE;
def_thread.overwrite = DEF_OVERWRITE;
def_thread.rwmixcycle = DEF_RWMIX_CYCLE;
def_thread.rwmixread = DEF_RWMIX_READ;
def_thread.nice = DEF_NICE;
+ def_thread.rand_repeatable = DEF_RAND_REPEAT;
#ifdef FIO_HAVE_DISK_UTIL
def_thread.do_disk_util = 1;
#endif
static void usage(char *name)
{
printf("%s\n", fio_version_string);
- printf("\t-s IO is sequential\n");
- printf("\t-b Block size in KiB for each IO\n");
+ printf("\t-o Write output to file\n");
printf("\t-t Runtime in seconds\n");
- printf("\t-R Exit all threads on failure to meet rate goal\n");
- printf("\t-o Use O_DIRECT\n");
printf("\t-l Generate per-job latency logs\n");
printf("\t-w Generate per-job bandwidth logs\n");
printf("\t-f Job file (Required)\n");
{
int c, idx = 1, ini_idx = 0;
- while ((c = getopt(argc, argv, "s:b:t:r:R:o:f:lwvhO:")) != EOF) {
+ while ((c = getopt(argc, argv, "t:o:f:lwvh")) != EOF) {
switch (c) {
- case 's':
- def_sequential = !!atoi(optarg);
- idx++;
- break;
- case 'b':
- def_bs = atoi(optarg);
- def_bs <<= 10;
- if (!def_bs) {
- printf("bad block size\n");
- def_bs = DEF_BS;
- }
- idx++;
- break;
case 't':
def_timeout = atoi(optarg);
idx++;
break;
- case 'r':
- def_repeatable = !!atoi(optarg);
- idx++;
- break;
- case 'R':
- rate_quit = !!atoi(optarg);
- idx++;
- break;
- case 'o':
- def_odirect = !!atoi(optarg);
- idx++;
- break;
case 'f':
ini_idx++;
ini_file = realloc(ini_file, ini_idx * sizeof(char *));
write_bw_log = 1;
idx++;
break;
- case 'O':
+ case 'o':
f_out = fopen(optarg, "w+");
if (!f_out) {
perror("fopen output");
return 1;
if (parse_jobs_ini(ini_file[i]))
return 1;
+ free(ini_file[i]);
}
+ free(ini_file);
return 0;
}