Merge branch 'master' into gfio
authorJens Axboe <axboe@kernel.dk>
Mon, 7 May 2012 07:54:41 +0000 (09:54 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 7 May 2012 07:54:41 +0000 (09:54 +0200)
Conflicts:
Makefile
backend.c
client.c
fio.h
os/windows/install.wxs
server.c
server.h

Signed-off-by: Jens Axboe <axboe@kernel.dk>
13 files changed:
HOWTO
Makefile
backend.c
cconv.c
eta.c
filesetup.c
fio.1
options.c
os/os-windows.h
os/windows/dobuild.cmd
os/windows/install.wxs
stat.c
thread_options.h

diff --git a/HOWTO b/HOWTO
index eeaddbac69520f3997bebd5cc8c8f79149e23626..8a4e2bde1b7b8a1bd85d1a56dba41eb7d23e1d26 100644 (file)
--- a/HOWTO
+++ b/HOWTO
@@ -320,7 +320,7 @@ rw=str              Type of io pattern. Accepted values are:
                one by appending a ':<nr>' 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
 ----------------
index fe22741e940e51628934e2f3900e66dd9356fbda..5165cd9ff38dd1cbb0e59b933c1dfafc124fd0b8 100644 (file)
--- 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
index 3a471521d6931508335f9ede44b3ab5aae1598f1..38efc2307809266d234cfeb183e33bda94b5ea68 100644 (file)
--- 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 ae34e5490672925bae4bfbdd07a13da9db4ecbd3..2bfe6aa09d9585884f0766a6d4ff504580c24aac 100644 (file)
--- 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 e80fa4845e8583d8e9e74e5ce74039320ef4de81..a068e1e9cf770cc4fc4b8754fc1f52c9759878b5 100644 (file)
--- 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;
index 166ace8c529e02d0afa5cc91fb4ca66d6626cd21..d30b61639afa62548c0147613facbeff3854c724 100644 (file)
@@ -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 cc6fd35b32d72e0efd9294b34e3e01a8871405b1..10cb51d5ced620e523a60aff4600c17566e054a6 100644 (file)
--- 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<nr>\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
index ae9fdac8f169d2985e77f7e5ac376c521677a353..0074e5fbc98e5d7cf9356e7967dd14de834da3d7 100644 (file)
--- 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",
index 8b801ed5bfabf959236fbf8711060d63e5db7037..7b61d16cce5c46db3e692bad238d984423f2f470 100644 (file)
@@ -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;
index 43e5db4dad43f581e21a7da3483192d4124d0e96..cbbe2cbced20e1cad7464b328394d8388b2b0419 100644 (file)
@@ -1,11 +1,9 @@
 @echo off\r
 setlocal enabledelayedexpansion\r
-set /a counter=4\r
-for /f "tokens=3" %%i in (..\..\fio_version.h) do (\r
- if "!counter!"=="4" set FIO_MAJOR=%%i\r
- if "!counter!"=="5" set FIO_MINOR=%%i\r
- if "!counter!"=="6" set FIO_PATCH=%%i\r
-set /a counter+=1\r
+set /a counter=1\r
+for /f "tokens=3" %%i in (..\..\FIO-VERSION-FILE) do (\r
+ if "!counter!"=="1" set FIO_VERSION=%%i\r
+ set /a counter+=1\r
 )\r
 \r
 if "%1"=="x86" set FIO_ARCH=x86\r
@@ -22,5 +20,5 @@ if not defined FIO_ARCH (
 @if ERRORLEVEL 1 goto end\r
 "%WIX%bin\candle" -nologo -arch %FIO_ARCH% examples.wxs\r
 @if ERRORLEVEL 1 goto end\r
-"%WIX%bin\light" -nologo install.wixobj examples.wixobj -ext WixUIExtension -out fio-%FIO_MAJOR%.%FIO_MINOR%.%FIO_PATCH%-%FIO_ARCH%.msi\r
+"%WIX%bin\light" -nologo install.wixobj examples.wixobj -ext WixUIExtension -out %FIO_VERSION%-%FIO_ARCH%.msi\r
 :end
\ No newline at end of file
index 18091bee9d6c215f76bfecd4d0c55a39dd613392..69753ba99d519a28db09b9e99697525fc72b2ce4 100755 (executable)
@@ -7,10 +7,10 @@
                <?define ProgramDirectory = ProgramFiles64Folder ?>\r
        <?endif?>\r
 \r
-       <Product Id="*"\r
+       <Product Id="CCE88492-8C5A-4EAF-8B82-E22A90CEC47B"\r
          Codepage="1252" Language="1033"\r
-         Manufacturer="fio" Name="FIO"\r
-         UpgradeCode="{2338A332-5511-43cf-b9BD-5C60496CCFCC}" Version="$(env.FIO_VERSION)">\r
+         Manufacturer="fio" Name="fio"\r
+         UpgradeCode="2338A332-5511-43cf-b9BD-5C60496CCFCC" Version="2.0.7">\r
                <Package \r
                  Comments="Contact: Your local administrator"\r
                  Description="Flexible IO Tester"\r
diff --git a/stat.c b/stat.c
index eff1a27e4d135acae099bca57513a980f935b44b..ee495ffd88dc5dae82f92717deda18e59ef8bd57 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -573,7 +573,7 @@ static void show_ddir_status_terse(struct thread_stat *ts,
        if (ts->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;
        }
 
index a5d06aad5a80aaceb848fa2b46eaf3013ec15712..a78684cf985030f861da02a68f77de30d3f114fe 100644 (file)
@@ -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;