X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=init.c;h=742262867a3d51ecd529b033264789ee00c947d0;hb=33765372d5588c347e44d868d0bd6bc416a0fd05;hp=7bddcea4b88bcd217e343267a45c4e0f1c7a7a26;hpb=0353050fe32065e1932a43a7c39a7c390ea71142;p=fio.git diff --git a/init.c b/init.c index 7bddcea4..74226286 100644 --- a/init.c +++ b/init.c @@ -25,14 +25,7 @@ #include "fio_version.h" -#if FIO_PATCH > 0 -const char fio_version_string[] = __fio_stringify(FIO_MAJOR) "." \ - __fio_stringify(FIO_MINOR) "." \ - __fio_stringify(FIO_PATCH); -#else -const char fio_version_string[] = __fio_stringify(FIO_MAJOR) "." \ - __fio_stringify(FIO_MINOR); -#endif +const char fio_version_string[] = FIO_VERSION; #define FIO_RANDSEED (0xb1899bedUL) @@ -47,7 +40,6 @@ struct thread_data *threads = NULL; int exitall_on_terminate = 0; int terse_output = 0; int eta_print; -unsigned long long mlock_size = 0; FILE *f_out = NULL; FILE *f_err = NULL; char **job_sections = NULL; @@ -214,7 +206,7 @@ static struct option l_opts[FIO_NR_OPTIONS] = { }, }; -static void free_shm(void) +void free_threads_shm(void) { struct shmid_ds sbuf; @@ -222,11 +214,19 @@ static void free_shm(void) void *tp = threads; threads = NULL; + shmdt(tp); + shmctl(shm_id, IPC_RMID, &sbuf); + shm_id = -1; + } +} + +void free_shm(void) +{ + if (threads) { file_hash_exit(); flow_exit(); fio_debug_jobp = NULL; - shmdt(tp); - shmctl(shm_id, IPC_RMID, &sbuf); + free_threads_shm(); } scleanup(); @@ -775,11 +775,6 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, if (ioengine_load(td)) goto err; - if (td->o.use_thread) - nr_thread++; - else - nr_process++; - if (td->o.odirect) td->io_ops->flags |= FIO_RAWIO; @@ -847,14 +842,14 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, if (setup_rate(td)) goto err; - if (td->o.write_lat_log) { + if (td->o.lat_log_file) { setup_log(&td->lat_log, td->o.log_avg_msec, IO_LOG_TYPE_LAT); setup_log(&td->slat_log, td->o.log_avg_msec, IO_LOG_TYPE_SLAT); setup_log(&td->clat_log, td->o.log_avg_msec, IO_LOG_TYPE_CLAT); } - if (td->o.write_bw_log) + if (td->o.bw_log_file) setup_log(&td->bw_log, td->o.log_avg_msec, IO_LOG_TYPE_BW); - if (td->o.write_iops_log) + if (td->o.iops_log_file) setup_log(&td->iops_log, td->o.log_avg_msec, IO_LOG_TYPE_IOPS); if (!td->o.name) @@ -1187,7 +1182,7 @@ static int fill_def_thread(void) static void usage(const char *name) { - printf("fio %s\n", fio_version_string); + printf("%s\n", fio_version_string); printf("%s [options] [job options] \n", name); printf(" --debug=options\tEnable debug logging. May be one/more of:\n" "\t\t\tprocess,file,io,mem,blktrace,verify,random,parse,\n" @@ -1460,7 +1455,7 @@ int parse_cmd_line(int argc, char *argv[], int client_type) break; case 'v': if (!cur_client) { - log_info("fio %s\n", fio_version_string); + log_info("%s\n", fio_version_string); do_exit++; } break; @@ -1699,7 +1694,7 @@ int parse_options(int argc, char *argv[]) } if (!terse_output) - log_info("fio %s\n", fio_version_string); + log_info("%s\n", fio_version_string); return 0; }