From: Jens Axboe Date: Mon, 7 May 2012 07:54:41 +0000 (+0200) Subject: Merge branch 'master' into gfio X-Git-Tag: gfio-0.1~2 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=fb390e242cac8868e01cdc2046c63e04e3d53d70;hp=2a95f716d8808f45cd5806eac0baad96b39b0016 Merge branch 'master' into gfio Conflicts: Makefile backend.c client.c fio.h os/windows/install.wxs server.c server.h Signed-off-by: Jens Axboe --- diff --git a/HOWTO b/HOWTO index eeaddbac..8a4e2bde 100644 --- a/HOWTO +++ b/HOWTO @@ -320,7 +320,7 @@ rw=str Type of io pattern. Accepted values are: one by appending a ':' to the end of the string given. For a random read, it would look like 'rw=randread:8' for passing in an offset modifier with a value of 8. If the - postfix is used with a sequential IO pattern, then the value + suffix is used with a sequential IO pattern, then the value specified will be added to the generated offset for each IO. For instance, using rw=write:4k will skip 4k for every write. It turns sequential IO into sequential IO with holes. @@ -893,6 +893,11 @@ create_fsync=bool fsync the data file after creation. This is the create_on_open=bool Don't pre-setup the files for IO, just create open() when it's time to do IO to that file. +create_only=bool If true, fio will only run the setup phase of the job. + If files need to be laid out or updated on disk, only + that will be done. The actual job contents are not + executed. + pre_read=bool If this is given, files will be pre-read into memory before starting the given IO operation. This will also clear the 'invalidate' flag, since it is pointless to pre-read @@ -1107,8 +1112,8 @@ write_bw_log=str If given, write a bandwidth log of the jobs in this job file. Can be used to store data of the bandwidth of the jobs in their lifetime. The included fio_generate_plots script uses gnuplot to turn these text files into nice - graphs. See write_log_log for behaviour of given - filename. For this option, the postfix is _bw.log. + graphs. See write_lat_log for behaviour of given + filename. For this option, the suffix is _bw.log. write_lat_log=str Same as write_bw_log, except that this option stores io submission, completion, and total latencies instead. If no @@ -1447,6 +1452,9 @@ io_queue= Total time spent in the disk queue. util= The disk utilization. A value of 100% means we kept the disk busy constantly, 50% would be a disk idling half of the time. +It is also possible to get fio to dump the current output while it is +running, without terminating the job. To do that, send fio the USR1 signal. + 7.0 Terse output ---------------- diff --git a/Makefile b/Makefile index fe22741e..5165cd9f 100644 --- a/Makefile +++ b/Makefile @@ -106,7 +106,7 @@ all: .depend $(PROGS) $(SCRIPTS) FORCE .PHONY: FORCE cscope FIO-VERSION-FILE: FORCE - @$(SHELL_PATH) ./FIO-VERSION-GEN + @$(SHELL) ./FIO-VERSION-GEN -include FIO-VERSION-FILE CFLAGS += -DFIO_VERSION='"$(FIO_VERSION)"' @@ -162,7 +162,7 @@ gfio: $(GFIO_OBJS) $(PROGS): .depend clean: FORCE - -rm -f .depend $(GFIO_OBJS) $(FIO_OBJS) $(T_OBJS) $(PROGS) $(T_PROGS) core.* core gfio FIO-VERSION-FILE + -rm -f .depend $(GFIO_OBJS )$(OBJS) $(T_OBJS) $(PROGS) $(T_PROGS) core.* core gfio FIO-VERSION-FILE cscope: @cscope -b -R diff --git a/backend.c b/backend.c index 3a471521..38efc230 100644 --- a/backend.c +++ b/backend.c @@ -1068,7 +1068,7 @@ static void *thread_main(void *data) } } - if (o->cgroup_weight && cgroup_setup(td, cgroup_list, &cgroup_mnt)) + if (td->o.cgroup && cgroup_setup(td, cgroup_list, &cgroup_mnt)) goto err; errno = 0; diff --git a/cconv.c b/cconv.c index ae34e549..2bfe6aa0 100644 --- a/cconv.c +++ b/cconv.c @@ -90,6 +90,7 @@ void convert_thread_options_to_cpu(struct thread_options *o, o->create_serialize = le32_to_cpu(top->create_serialize); o->create_fsync = le32_to_cpu(top->create_fsync); o->create_on_open = le32_to_cpu(top->create_on_open); + o->create_only = le32_to_cpu(top->create_only); o->end_fsync = le32_to_cpu(top->end_fsync); o->pre_read = le32_to_cpu(top->pre_read); o->sync_io = le32_to_cpu(top->sync_io); @@ -241,6 +242,7 @@ void convert_thread_options_to_net(struct thread_options_pack *top, top->create_serialize = cpu_to_le32(o->create_serialize); top->create_fsync = cpu_to_le32(o->create_fsync); top->create_on_open = cpu_to_le32(o->create_on_open); + top->create_only = cpu_to_le32(o->create_only); top->end_fsync = cpu_to_le32(o->end_fsync); top->pre_read = cpu_to_le32(o->pre_read); top->sync_io = cpu_to_le32(o->sync_io); diff --git a/eta.c b/eta.c index e80fa484..a068e1e9 100644 --- a/eta.c +++ b/eta.c @@ -363,7 +363,7 @@ void display_thread_status(struct jobs_eta *je) { static int linelen_last; static int eta_good; - char output[512], *p = output; + char output[REAL_MAX_JOBS + 512], *p = output; char eta_str[128]; double perc = 0.0; int i2p = 0; @@ -391,6 +391,7 @@ void display_thread_status(struct jobs_eta *je) char perc_str[32]; char *iops_str[2]; char *rate_str[2]; + size_t left; int l; if ((!je->eta_sec && !eta_good) || je->nr_ramp == je->nr_running) @@ -407,7 +408,9 @@ void display_thread_status(struct jobs_eta *je) iops_str[0] = num2str(je->iops[0], 4, 1, 0); iops_str[1] = num2str(je->iops[1], 4, 1, 0); - l = sprintf(p, ": [%s] [%s] [%s/%s /s] [%s/%s iops] [eta %s]", + left = sizeof(output) - (p - output) - 1; + + l = snprintf(p, left, ": [%s] [%s] [%s/%s /s] [%s/%s iops] [eta %s]", je->run_str, perc_str, rate_str[0], rate_str[1], iops_str[0], iops_str[1], eta_str); p += l; diff --git a/filesetup.c b/filesetup.c index 166ace8c..d30b6163 100644 --- a/filesetup.c +++ b/filesetup.c @@ -665,7 +665,7 @@ int setup_files(struct thread_data *td) dprint(FD_FILE, "setup files\n"); if (td->o.read_iolog_file) - return 0; + goto done; /* * if ioengine defines a setup() method, it's responsible for @@ -816,6 +816,11 @@ int setup_files(struct thread_data *td) */ if (!td->o.read_iolog_file) td->total_io_size = td->o.size * td->o.loops; + +done: + if (td->o.create_only) + td->done = 1; + return 0; err_offset: log_err("%s: you need to specify valid offset=\n", td->o.name); diff --git a/fio.1 b/fio.1 index cc6fd35b..10cb51d5 100644 --- a/fio.1 +++ b/fio.1 @@ -204,7 +204,7 @@ Mixed random reads and writes. .P For mixed I/O, the default split is 50/50. For certain types of io the result may still be skewed a bit, since the speed may be different. It is possible to -specify a number of IO's to do before getting a new offset, this is one by +specify a number of IO's to do before getting a new offset, this is done by appending a `:\fI\fR to the end of the string given. For a random read, it would look like \fBrw=randread:8\fR for passing in an offset modifier with a value of 8. If the postfix is used with a sequential IO pattern, then the value @@ -555,10 +555,6 @@ Sync file contents when job exits. Default: false. If true, sync file contents on close. This differs from \fBend_fsync\fR in that it will happen on every close, not just at the end of the job. Default: false. .TP -.BI rwmixcycle \fR=\fPint -How many milliseconds before switching between reads and writes for a mixed -workload. Default: 500ms. -.TP .BI rwmixread \fR=\fPint Percentage of a mixed workload that should be reads. Default: 50. .TP @@ -725,6 +721,11 @@ If true, serialize file creation for the jobs. Default: true. .BI create_on_open \fR=\fPbool If true, the files are not created until they are opened for IO by the job. .TP +.BI create_only \fR=\fPbool +If true, fio will only run the setup phase of the job. If files need to be +laid out or updated on disk, only that will be done. The actual job contents +are not executed. +.TP .BI pre_read \fR=\fPbool If this is given, files will be pre-read into memory before starting the given IO operation. This will also clear the \fR \fBinvalidate\fR flag, since it is @@ -1209,6 +1210,10 @@ Total time spent in the disk queue. Disk utilization. .RE .PD +.P +It is also possible to get fio to dump the current output while it is +running, without terminating the job. To do that, send fio the \fBUSR1\fR +signal. .SH TERSE OUTPUT If the \fB\-\-minimal\fR option is given, the results will be printed in a semicolon-delimited format suitable for scripted use - a job description diff --git a/options.c b/options.c index ae9fdac8..0074e5fb 100644 --- a/options.c +++ b/options.c @@ -2220,6 +2220,13 @@ struct fio_option fio_options[FIO_MAX_OPTS] = { .category = FIO_OPT_C_FILE, .group = FIO_OPT_G_INVALID, }, + { + .name = "create_only", + .type = FIO_OPT_BOOL, + .off1 = td_var_offset(create_only), + .help = "Only perform file creation phase", + .def = "0", + }, { .name = "pre_read", .lname = "Pre-read files", diff --git a/os/os-windows.h b/os/os-windows.h index 8b801ed5..7b61d16c 100644 --- a/os/os-windows.h +++ b/os/os-windows.h @@ -82,6 +82,7 @@ typedef DWORD_PTR os_cpu_mask_t; #define POLLHUP 1 #define SIGCONT 0 +#define SIGUSR1 1 typedef int sigset_t; typedef int siginfo_t; diff --git a/os/windows/dobuild.cmd b/os/windows/dobuild.cmd index 43e5db4d..cbbe2cbc 100644 --- a/os/windows/dobuild.cmd +++ b/os/windows/dobuild.cmd @@ -1,11 +1,9 @@ @echo off setlocal enabledelayedexpansion -set /a counter=4 -for /f "tokens=3" %%i in (..\..\fio_version.h) do ( - if "!counter!"=="4" set FIO_MAJOR=%%i - if "!counter!"=="5" set FIO_MINOR=%%i - if "!counter!"=="6" set FIO_PATCH=%%i -set /a counter+=1 +set /a counter=1 +for /f "tokens=3" %%i in (..\..\FIO-VERSION-FILE) do ( + if "!counter!"=="1" set FIO_VERSION=%%i + set /a counter+=1 ) if "%1"=="x86" set FIO_ARCH=x86 @@ -22,5 +20,5 @@ if not defined FIO_ARCH ( @if ERRORLEVEL 1 goto end "%WIX%bin\candle" -nologo -arch %FIO_ARCH% examples.wxs @if ERRORLEVEL 1 goto end -"%WIX%bin\light" -nologo install.wixobj examples.wixobj -ext WixUIExtension -out fio-%FIO_MAJOR%.%FIO_MINOR%.%FIO_PATCH%-%FIO_ARCH%.msi +"%WIX%bin\light" -nologo install.wixobj examples.wixobj -ext WixUIExtension -out %FIO_VERSION%-%FIO_ARCH%.msi :end \ No newline at end of file diff --git a/os/windows/install.wxs b/os/windows/install.wxs index 18091bee..69753ba9 100755 --- a/os/windows/install.wxs +++ b/os/windows/install.wxs @@ -7,10 +7,10 @@ - + Manufacturer="fio" Name="fio" + UpgradeCode="2338A332-5511-43cf-b9BD-5C60496CCFCC" Version="2.0.7"> runtime[ddir]) { uint64_t runt = ts->runtime[ddir]; - bw = ts->io_bytes[ddir] / runt; + bw = ((1000 * ts->io_bytes[ddir]) / runt) / 1024; iops = (1000 * (uint64_t) ts->total_io_u[ddir]) / runt; } diff --git a/thread_options.h b/thread_options.h index a5d06aad..a78684cf 100644 --- a/thread_options.h +++ b/thread_options.h @@ -78,6 +78,7 @@ struct thread_options { unsigned int create_serialize; unsigned int create_fsync; unsigned int create_on_open; + unsigned int create_only; unsigned int end_fsync; unsigned int pre_read; unsigned int sync_io; @@ -262,6 +263,7 @@ struct thread_options_pack { uint32_t create_serialize; uint32_t create_fsync; uint32_t create_on_open; + uint32_t create_only; uint32_t end_fsync; uint32_t pre_read; uint32_t sync_io;