static int nr_job_sections;
int exitall_on_terminate = 0;
-int exitall_on_terminate_error = 0;
int output_format = FIO_OUTPUT_NORMAL;
int eta_print = FIO_ETA_AUTO;
int eta_new_line = 0;
},
{
.name = (char *) "bandwidth-log",
- .has_arg = required_argument,
+ .has_arg = no_argument,
.val = 'b' | FIO_CLIENT_FLAG,
},
{
static void free_shm(void)
{
if (threads) {
- file_hash_exit();
flow_exit();
fio_debug_jobp = NULL;
free_threads_shm();
free(trigger_remote_cmd);
trigger_file = trigger_cmd = trigger_remote_cmd = NULL;
- options_free(fio_options, &def_thread);
+ options_free(fio_options, &def_thread.o);
fio_filelock_exit();
+ file_hash_exit();
scleanup();
}
*/
static int setup_thread_area(void)
{
- void *hash;
-
if (threads)
return 0;
do {
size_t size = max_jobs * sizeof(struct thread_data);
- size += file_hash_size;
size += sizeof(unsigned int);
#ifndef CONFIG_NO_SHM
#endif
memset(threads, 0, max_jobs * sizeof(struct thread_data));
- hash = (void *) threads + max_jobs * sizeof(struct thread_data);
- fio_debug_jobp = (void *) hash + file_hash_size;
+ fio_debug_jobp = (void *) threads + max_jobs * sizeof(struct thread_data);
*fio_debug_jobp = -1;
- file_hash_init(hash);
flow_init();
* 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 be larger than the IO size: %llu\n", (unsigned long long) o->size);
+ log_err("fio: size too small, must not be less than minimum block size: %llu < %u\n",
+ (unsigned long long) o->size, td_min_bs(td));
ret = 1;
}
return p;
}
-static int exists_and_not_regfile(const char *filename)
-{
- struct stat sb;
-
- if (lstat(filename, &sb) == -1)
- return 0;
-
-#ifndef WIN32 /* NOT Windows */
- if (S_ISREG(sb.st_mode))
- return 0;
-#else
- /* \\.\ is the device namespace in Windows, where every file
- * is a device node */
- if (S_ISREG(sb.st_mode) && strncmp(filename, "\\\\.\\", 4) != 0)
- return 0;
-#endif
-
- return 1;
-}
-
static void init_rand_file_service(struct thread_data *td)
{
unsigned long nranges = td->o.nr_files << FIO_FSERVICE_SHIFT;
return buf;
}
-int parse_dryrun(void)
+bool parse_dryrun(void)
{
return dump_cmdline || parse_only;
}
if (setup_rate(td))
goto err;
- if (o->lat_log_file) {
+ if (o->write_lat_log) {
struct log_params p = {
.td = td,
.avg_msec = o->log_avg_msec,
.log_gz = o->log_gz,
.log_gz_store = o->log_gz_store,
};
+ const char *pre = o->lat_log_file ? o->lat_log_file : o->name;
const char *suf;
if (p.log_gz_store)
else
suf = "log";
- gen_log_name(logname, sizeof(logname), "lat", o->lat_log_file,
+ gen_log_name(logname, sizeof(logname), "lat", pre,
td->thread_number, suf, o->per_job_logs);
setup_log(&td->lat_log, &p, logname);
- gen_log_name(logname, sizeof(logname), "slat", o->lat_log_file,
+ gen_log_name(logname, sizeof(logname), "slat", pre,
td->thread_number, suf, o->per_job_logs);
setup_log(&td->slat_log, &p, logname);
- gen_log_name(logname, sizeof(logname), "clat", o->lat_log_file,
+ gen_log_name(logname, sizeof(logname), "clat", pre,
td->thread_number, suf, o->per_job_logs);
setup_log(&td->clat_log, &p, logname);
}
- if (o->hist_log_file) {
+ if (o->write_hist_log) {
struct log_params p = {
.td = td,
.avg_msec = o->log_avg_msec,
.log_gz = o->log_gz,
.log_gz_store = o->log_gz_store,
};
+ const char *pre = o->hist_log_file ? o->hist_log_file : o->name;
const char *suf;
+#ifndef CONFIG_ZLIB
+ if (td->client_type) {
+ log_err("fio: --write_hist_log requires zlib in client/server mode\n");
+ goto err;
+ }
+#endif
+
if (p.log_gz_store)
suf = "log.fz";
else
suf = "log";
- gen_log_name(logname, sizeof(logname), "clat_hist", o->hist_log_file,
+ gen_log_name(logname, sizeof(logname), "clat_hist", pre,
td->thread_number, suf, o->per_job_logs);
setup_log(&td->clat_hist_log, &p, logname);
}
- if (o->bw_log_file) {
+ if (o->write_bw_log) {
struct log_params p = {
.td = td,
.avg_msec = o->log_avg_msec,
.log_gz = o->log_gz,
.log_gz_store = o->log_gz_store,
};
+ const char *pre = o->bw_log_file ? o->bw_log_file : o->name;
const char *suf;
if (fio_option_is_set(o, bw_avg_time))
else
suf = "log";
- gen_log_name(logname, sizeof(logname), "bw", o->bw_log_file,
+ gen_log_name(logname, sizeof(logname), "bw", pre,
td->thread_number, suf, o->per_job_logs);
setup_log(&td->bw_log, &p, logname);
}
- if (o->iops_log_file) {
+ if (o->write_iops_log) {
struct log_params p = {
.td = td,
.avg_msec = o->log_avg_msec,
.log_gz = o->log_gz,
.log_gz_store = o->log_gz_store,
};
+ const char *pre = o->iops_log_file ? o->iops_log_file : o->name;
const char *suf;
if (fio_option_is_set(o, iops_avg_time))
else
suf = "log";
- gen_log_name(logname, sizeof(logname), "iops", o->iops_log_file,
+ gen_log_name(logname, sizeof(logname), "iops", pre,
td->thread_number, suf, o->per_job_logs);
setup_log(&td->iops_log, &p, logname);
}
log_info("...\n");
}
- if (o->ss_dur) {
- steadystate = true;
- o->ss_dur /= 1000000L;
-
- /* put all steady state info in one place */
- td->ss.dur = o->ss_dur;
- td->ss.limit = o->ss_limit.u.f;
- td->ss.ramp_time = o->ss_ramp_time;
- td->ss.pct = o->ss_pct;
-
- if (steadystate_check_slope(o))
- td->ss.check_slope = true;
- else
- td->ss.check_slope = false;
-
- if (o->ss == FIO_STEADYSTATE_IOPS || o->ss == FIO_STEADYSTATE_IOPS_SLOPE)
- td->ss.check_iops = true;
- else
- td->ss.check_iops = false;
-
- td->ss.bw_data = NULL;
- td->ss.iops_data = NULL;
- td->ss.ramp_time_over = (td->ss.ramp_time == 0);
- td->ss.attained = 0;
- td->ss.last_in_group = 0;
- td->ss.head = 0;
- td->ss.tail = 0;
- td->ss.sum_x = o->ss_dur * (o->ss_dur - 1) / 2;
- td->ss.sum_x_sq = (o->ss_dur - 1) * (o->ss_dur) * (2*o->ss_dur - 1) / 6;
- td->ss.prev_bytes = 0;
- td->ss.prev_iops = 0;
- td->ss.sum_y = 0;
- td->ss.oldest_y = 0;
- td->ss.criterion = 0.0;
- td->ss.slope = 0.0;
- td->ss.deviation = 0.0;
- td->ts.ss = &td->ss;
- } else
- td->ts.ss = NULL;
+ if (td_steadystate_init(td))
+ goto err;
/*
* recurse add identical jobs, clear numjobs and stonewall options
/*
* This is our [ini] type file parser.
*/
-int __parse_jobs_ini(struct thread_data *td,
+static int __parse_jobs_ini(struct thread_data *td,
char *file, int is_buf, int stonewall_flag, int type,
int nested, char *name, char ***popts, int *aopts, int *nopts)
{
printf(" --parse-only\t\tParse options only, don't start any IO\n");
printf(" --output\t\tWrite output to file\n");
printf(" --runtime\t\tRuntime in seconds\n");
- printf(" --bandwidth-log\tGenerate per-job bandwidth logs\n");
+ printf(" --bandwidth-log\tGenerate aggregate bandwidth logs\n");
printf(" --minimal\t\tMinimal (terse) output\n");
printf(" --output-format=x\tOutput format (terse,json,json+,normal)\n");
printf(" --terse-version=x\tSet terse version output format to 'x'\n");
switch (c) {
case 'a':
smalloc_pool_size = atoi(optarg);
+ smalloc_pool_size <<= 10;
+ sinit();
break;
case 't':
if (check_str_time(optarg, &def_timeout, 1)) {