#include <string.h>
#include <errno.h>
#include <sys/ipc.h>
+#ifndef FIO_NO_HAVE_SHM_H
#include <sys/shm.h>
+#endif
#include <sys/types.h>
#include <sys/stat.h>
struct thread_data *threads = NULL;
int exitall_on_terminate = 0;
-int terse_output = 0;
+int output_format = FIO_OUTPUT_NORMAL;
int eta_print;
unsigned long long mlock_size = 0;
FILE *f_out = NULL;
.has_arg = optional_argument,
.val = 'm' | FIO_CLIENT_FLAG,
},
+ {
+ .name = (char *) "output-format",
+ .has_arg = optional_argument,
+ .val = 'F' | FIO_CLIENT_FLAG,
+ },
{
.name = (char *) "version",
.has_arg = no_argument,
shm_id = shmget(0, size, IPC_CREAT | 0600);
if (shm_id != -1)
break;
- if (errno != EINVAL && errno != ENOMEM) {
+ if (errno != EINVAL && errno != ENOMEM && errno != ENOSPC) {
perror("shmget");
break;
}
profile_add_hooks(td);
td->thread_number = thread_number;
+
+ if (!parent || !parent->o.group_reporting)
+ stat_number++;
+
return td;
}
td->o.compress_percentage = 0;
}
+ /*
+ * Using a non-uniform random distribution excludes usage of
+ * a random map
+ */
+ if (td->o.random_distribution != FIO_RAND_DIST_RANDOM)
+ td->o.norandommap = 1;
+
return ret;
}
if (!td->o.name)
td->o.name = strdup(jobname);
- if (!terse_output) {
+ if (output_format == FIO_OUTPUT_NORMAL) {
if (!job_add_num) {
if (!strcmp(td->io_ops->name, "cpuio")) {
log_info("%s: ioengine=cpu, cpuload=%u,"
fio_getaffinity(getpid(), &def_thread.o.cpumask);
def_thread.o.timeout = def_timeout;
-
+ def_thread.o.error_dump = 1;
/*
* fill default options
*/
printf(" --latency-log\t\tGenerate per-job latency logs\n");
printf(" --bandwidth-log\tGenerate per-job bandwidth logs\n");
printf(" --minimal\t\tMinimal (terse) output\n");
- printf(" --version\t\tPrint version info and exit\n");
+ printf(" --output-format=x\tOutput format (terse,json,normal)\n");
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(" --cmdhelp=cmd\t\tPrint command help, \"all\" for all of"
" them\n");
f_err = f_out;
break;
case 'm':
- terse_output = 1;
+ output_format = FIO_OUTPUT_TERSE;
+ break;
+ case 'F':
+ if (!strcmp(optarg, "minimal") ||
+ !strcmp(optarg, "terse") ||
+ !strcmp(optarg, "csv"))
+ output_format = FIO_OUTPUT_TERSE;
+ else if (!strcmp(optarg, "json"))
+ output_format = FIO_OUTPUT_JSON;
+ else
+ output_format = FIO_OUTPUT_NORMAL;
break;
case 'h':
if (!cur_client) {
break;
case 'V':
terse_version = atoi(optarg);
- if (!(terse_version == 2 || terse_version == 3) ||
- (terse_version == 4)) {
+ if (!(terse_version == 2 || terse_version == 3 ||
+ terse_version == 4)) {
log_err("fio: bad terse version format\n");
exit_val = 1;
do_exit++;
fio_gtod_cpu = def_thread.o.gtod_cpu;
}
- if (!terse_output)
+ if (output_format == FIO_OUTPUT_NORMAL)
log_info("%s\n", fio_version_string);
return 0;