#include "fio_version.h"
#if FIO_PATCH > 0
-static char fio_version_string[] = __fio_stringify(FIO_MAJOR) "." \
+const char fio_version_string[] = __fio_stringify(FIO_MAJOR) "." \
__fio_stringify(FIO_MINOR) "." \
__fio_stringify(FIO_PATCH);
#else
-static char fio_version_string[] = __fio_stringify(FIO_MAJOR) "." \
+const char fio_version_string[] = __fio_stringify(FIO_MAJOR) "." \
__fio_stringify(FIO_MINOR);
#endif
int nr_job_sections = 0;
char *exec_profile = NULL;
int warnings_fatal = 0;
-int terse_version = 2;
+int terse_version = 3;
int is_backend = 0;
int nr_clients = 0;
int log_syslog = 0;
if (td->error)
log_info("fio: %s\n", td->verror);
+ fio_options_free(td);
+
memset(&threads[td->thread_number - 1], 0, sizeof(*td));
thread_number--;
}
if (is_buf)
p = strsep(&file, "\n");
else
- p = fgets(string, 4095, f);
+ p = fgets(string, 4096, f);
if (!p)
break;
}
if (dump_cmdline)
log_info("\n");
+ i = 0;
+ while (i < nr_job_sections) {
+ free(job_sections[i]);
+ i++;
+ }
+
for (i = 0; i < num_opts; i++)
free(opts[i]);
{
printf("fio %s\n", fio_version_string);
printf("%s [options] [job options] <job file(s)>\n", name);
- printf("\t--debug=options\tEnable debug logging\n");
- printf("\t--output\tWrite output to file\n");
- printf("\t--timeout\tRuntime in seconds\n");
- printf("\t--latency-log\tGenerate per-job latency logs\n");
- printf("\t--bandwidth-log\tGenerate per-job bandwidth logs\n");
- printf("\t--minimal\tMinimal (terse) output\n");
- printf("\t--version\tPrint version info and exit\n");
- printf("\t--terse-version=x Terse version output format\n");
- printf("\t--help\t\tPrint this page\n");
- printf("\t--cmdhelp=cmd\tPrint command help, \"all\" for all of"
+ printf(" --debug=options\tEnable debug logging. May be one/more of:\n"
+ "\t\t\tprocess,file,io,mem,blktrace,verify,random,parse,\n"
+ "\t\t\tdiskutil,job,mutex,profile,time,net\n");
+ printf(" --output\t\tWrite output to file\n");
+ printf(" --timeout\t\tRuntime in seconds\n");
+ 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(" --terse-version=x\tTerse version output format to 'x'\n");
+ printf(" --help\t\tPrint this page\n");
+ printf(" --cmdhelp=cmd\t\tPrint command help, \"all\" for all of"
" them\n");
- printf("\t--showcmd\tTurn a job file into command line options\n");
- printf("\t--eta=when\tWhen ETA estimate should be printed\n");
- printf("\t \tMay be \"always\", \"never\" or \"auto\"\n");
- printf("\t--readonly\tTurn on safety read-only checks, preventing"
+ 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(" --readonly\t\tTurn on safety read-only checks, preventing"
" writes\n");
- printf("\t--section=name\tOnly run specified section in job file\n");
- printf("\t--alloc-size=kb\tSet smalloc pool to this size in kb"
+ printf(" --section=name\tOnly run specified section in job file\n");
+ printf(" --alloc-size=kb\tSet smalloc pool to this size in kb"
" (def 1024)\n");
- printf("\t--warnings-fatal Fio parser warnings are fatal\n");
- printf("\t--max-jobs\tMaximum number of threads/processes to support\n");
- printf("\t--server=args\tStart a backend fio server\n");
- printf("\t--daemonize=pidfile Background fio server, write pid to file\n");
- printf("\t--client=hostname Talk to remote backend fio server at hostname\n");
+ printf(" --warnings-fatal\tFio parser warnings are fatal\n");
+ printf(" --max-jobs=nr\t\tMaximum number of threads/processes to support\n");
+ printf(" --server=args\t\tStart a backend fio server\n");
+ printf(" --daemonize=pidfile\tBackground fio server, write pid to file\n");
+ printf(" --client=hostname\tTalk to remote backend fio server at hostname\n");
printf("\nFio was written by Jens Axboe <jens.axboe@oracle.com>");
- printf("\n Jens Axboe <jaxboe@fusionio.com>\n");
+ printf("\n Jens Axboe <jaxboe@fusionio.com>\n");
}
#ifdef FIO_INC_DEBUG
break;
case 'V':
terse_version = atoi(optarg);
- if (terse_version != 2) {
+ if (!(terse_version == 2 || terse_version == 3)) {
log_err("fio: bad terse version format\n");
exit_val = 1;
do_exit++;
}
free(ini_file);
- options_mem_free(&def_thread);
+ fio_options_free(&def_thread);
if (!thread_number) {
if (dump_cmdline)
fio_gtod_cpu = def_thread.o.gtod_cpu;
}
- log_info("fio %s\n", fio_version_string);
+ if (!terse_output)
+ log_info("fio %s\n", fio_version_string);
+
return 0;
}