Merge branch 'master' of ssh://router/data/git/fio
authorJens Axboe <jaxboe@fusionio.com>
Mon, 10 Jan 2011 19:21:02 +0000 (20:21 +0100)
committerJens Axboe <jaxboe@fusionio.com>
Mon, 10 Jan 2011 19:21:02 +0000 (20:21 +0100)
1  2 
HOWTO
README
fio.1
fio.c

diff --combined HOWTO
index 35dccfb16855683115e62ff83109fa9b886f5407,7c943294ecfb838ec79ab1f6d558ab4390e2be32..9ae34b976c78043d5df8126d5b5a918d7a09f40c
--- 1/HOWTO
--- 2/HOWTO
+++ b/HOWTO
@@@ -271,14 -271,12 +271,14 @@@ filename=str    Fio normally makes up a fi
                can specify a number of files by separating the names with a
                ':' colon. So if you wanted a job to open /dev/sda and /dev/sdb
                as the two working files, you would use
 -              filename=/dev/sda:/dev/sdb. If the wanted filename does need to
 -              include a colon, then escape that with a '\' character. For
 -              instance, if the filename is "/dev/dsk/foo@3,0:c", then you would
 -              use filename="/dev/dsk/foo@3,0\:c". '-' is a reserved name,
 -              meaning stdin or stdout. Which of the two depends on the read/write
 -              direction set.
 +              filename=/dev/sda:/dev/sdb. On Windows, disk devices are accessed
 +              as \\.\PhysicalDrive0 for the first device, \\.\PhysicalDrive1
 +              for the second etc.  If the wanted filename does need to 
 +              include a colon, then escape that with a '\' character. 
 +              For instance, if the filename is "/dev/dsk/foo@3,0:c", 
 +              then you would use filename="/dev/dsk/foo@3,0\:c". 
 +              '-' is a reserved name, meaning stdin or stdout. Which of the 
 +              two depends on the read/write direction set.
  
  opendir=str   Tell fio to recursively add any file it can find in this
                directory and down the file system tree.
@@@ -494,8 -492,6 +494,8 @@@ ioengine=str       Defines how the job issue
  
                        solarisaio Solaris native asynchronous io.
  
 +                      windowsaio Windows native asynchronous io.
 +
                        mmap    File is memory mapped and data copied
                                to/from using memcpy(3).
  
@@@ -992,7 -988,8 +992,8 @@@ zoneskip=int       Skip the specified number 
                io on zones of a file.
  
  write_iolog=str       Write the issued io patterns to the specified file. See
-               read_iolog.
+               read_iolog.  Specify a separate file for each job, otherwise
+               the iologs will be interspersed and the file may be corrupt.
  
  read_iolog=str        Open an iolog with the specified file name and replay the
                io patterns it contains. This can be used to store a
diff --combined README
index f136bb5e559b13d27a7f169816fec37781341a35,de06fb10ad4031ebe5d727630c7171db6ad22dd6..3a85a8bd17d6a47c0338dc26b191eb6743db9808
--- 1/README
--- 2/README
+++ b/README
@@@ -54,10 -54,6 +54,10 @@@ Packages for Solaris are available fro
  tool (http://www.opencsw.org/get-it/pkgutil/) and then install fio via
  'pkgutil -i fio'.
  
 +Windows:
 +Bruce Cran <bruce@cran.org.uk> has fio packages for Windows at
 +http://www.bluestop.org/fio .
 +
  
  Mailing list
  ------------
@@@ -83,10 -79,10 +83,10 @@@ http://maillist.kernel.dk/fio-devel
  Building
  --------
  
 -Just type 'make' and 'make install'. If on FreeBSD, for now you have to
 -specify the FreeBSD Makefile with -f and use gmake (not make), eg:
 +Just type 'make' and 'make install'. If on BSD, for now you have to
 +specify the BSD Makefile with -f and use gmake (not make), eg:
  
 -$ gmake -f Makefile.Freebsd && gmake -f Makefile.FreeBSD install
 +$ gmake -f Makefile.FreeBSD && gmake -f Makefile.FreeBSD install
  
  Same goes for AIX:
  
@@@ -136,7 -132,7 +136,7 @@@ unless they match a job file parameter
  each job file will be regarded as a separate group and fio will stonewall
  its execution.
  
 -The --readonly switch is an extra safety guard to prevent accidentically
 +The --readonly switch is an extra safety guard to prevent accidentally
  turning on a write setting when that is not desired. Fio will only write
  if rw=write/randwrite/rw/randrw is given, but this extra safety net can
  be used as an extra precaution. It will also enable a write check in the
@@@ -212,8 -208,7 +212,8 @@@ The job file parameters are
        size=x          Set file size to x bytes (x string can include k/m/g)
        ioengine=x      'x' may be: aio/libaio/linuxaio for Linux aio,
                        posixaio for POSIX aio, solarisaio for Solaris
 -                      native async IO, sync for regular read/write io,
 +                      native async IO, windowsaio for Windows native async IO,
 +                      sync for regular read/write io,
                        psync for regular pread/pwrite io, vsync for regular
                        readv/writev (with queuing emulation) mmap for mmap'ed
                        io, syslet-rw for syslet driven read/write, splice for
                        and length entries being in bytes.
        write_iolog=x   Write an iolog to file 'x' in the same format as iolog.
                        The iolog options are exclusive, if both given the
-                       read iolog will be performed.
+                       read iolog will be performed.  Specify a separate file
+                       for each job, otherwise the iologs will be interspersed
+                       and the file may be corrupt.
        write_bw_log    Write a bandwidth log.
        write_lat_log   Write a latency log.
        lockmem=x       Lock down x amount of memory on the machine, to
  Platforms
  ---------
  
 -Fio works on (at least) Linux, Solaris, AIX, OSX, NetBSD, and FreeBSD. Some
 -features and/or options may only be available on some of the platforms,
 +Fio works on (at least) Linux, Solaris, AIX, OSX, NetBSD, Windows and FreeBSD.
 +Some features and/or options may only be available on some of the platforms,
  typically because those features only apply to that platform (like the
  solarisaio engine, or the splice engine on Linux).
  
diff --combined fio.1
index 8d5baa831d1c90f63ef60810a560b4238810cae4,1f1116c9ce59c0e49a52411b08dfb99214bdd7a7..4445c71ff975f7bba1d58854f28f047803ae3680
--- 1/fio.1
--- 2/fio.1
+++ b/fio.1
@@@ -331,13 -331,7 +331,13 @@@ coalescing adjacents IOs into a single 
  Linux native asynchronous I/O.
  .TP
  .B posixaio
 -glibc POSIX asynchronous I/O using \fIaio_read\fR\|(3) and \fIaio_write\fR\|(3).
 +POSIX asynchronous I/O using \fIaio_read\fR\|(3) and \fIaio_write\fR\|(3).
 +.TP
 +.B solarisaio
 +Solaris native asynchronous I/O.
 +.TP
 +.B windowsaio
 +Windows native asynchronous I/O.
  .TP
  .B mmap
  File is memory mapped with \fImmap\fR\|(2) and data copied using
@@@ -749,7 -743,9 +749,9 @@@ Skip the specified number of bytes whe
  read.
  .TP
  .BI write_iolog \fR=\fPstr
- Write the issued I/O patterns to the specified file.
+ Write the issued I/O patterns to the specified file.  Specify a separate file
+ for each job, otherwise the iologs will be interspersed and the file may be
+ corrupt.
  .TP
  .BI read_iolog \fR=\fPstr
  Replay the I/O patterns contained in the specified file generated by
diff --combined fio.c
index 93482f5294ed55c245e25a0e98f8151fe7354ced,8cc8fcf3361be69e39bd4003a8d93e8ec81466a2..280dbe6660c1513dedebb6a551f1258a8bb162b1
--- 1/fio.c
--- 2/fio.c
+++ b/fio.c
@@@ -101,12 -101,12 +101,12 @@@ static void terminate_threads(int group
                         * if the thread is running, just let it exit
                         */
                        if (td->runstate < TD_RUNNING)
 -                              kill(td->pid, SIGQUIT);
 +                              kill(td->pid, SIGTERM);
                        else {
                                struct ioengine_ops *ops = td->io_ops;
  
 -                              if (ops && (ops->flags & FIO_SIGQUIT))
 -                                      kill(td->pid, SIGQUIT);
 +                              if (ops && (ops->flags & FIO_SIGTERM))
 +                                      kill(td->pid, SIGTERM);
                        }
                }
        }
@@@ -161,9 -161,8 +161,9 @@@ static void posix_timer_setup(void
        evt.sigev_notify = SIGEV_THREAD;
        evt.sigev_notify_function = ival_fn;
  
 -      if (timer_create(CLOCK_MONOTONIC, &evt, &ival_timer) < 0)
 +      if (timer_create(FIO_TIMER_CLOCK, &evt, &ival_timer) < 0)
                perror("timer_create");
 +
  }
  
  static void set_sig_handlers(void)
        memset(&act, 0, sizeof(act));
        act.sa_handler = sig_quit;
        act.sa_flags = SA_RESTART;
 -      sigaction(SIGQUIT, &act, NULL);
 +      sigaction(SIGTERM, &act, NULL);
  }
  
  /*
@@@ -1069,14 -1068,18 +1069,18 @@@ static void *thread_main(void *data
         */
        fio_mutex_remove(td->mutex);
  
-       if (td->o.uid != -1U && setuid(td->o.uid)) {
-               td_verror(td, errno, "setuid");
-               goto err;
-       }
+       /*
+        * A new gid requires privilege, so we need to do this before setting
+        * the uid.
+        */
        if (td->o.gid != -1U && setgid(td->o.gid)) {
                td_verror(td, errno, "setgid");
                goto err;
        }
+       if (td->o.uid != -1U && setuid(td->o.uid)) {
+               td_verror(td, errno, "setuid");
+               goto err;
+       }
  
        /*
         * May alter parameters that init_io_u() will use, so we need to
@@@ -1353,7 -1356,7 +1357,7 @@@ static void reap_threads(int *nr_runnin
                        if (WIFSIGNALED(status)) {
                                int sig = WTERMSIG(status);
  
 -                              if (sig != SIGQUIT)
 +                              if (sig != SIGTERM)
                                        log_err("fio: pid=%d, got signal=%d\n",
                                                        (int) td->pid, sig);
                                td_set_runstate(td, TD_REAPED);
@@@ -1704,11 -1707,7 +1708,11 @@@ int main(int argc, char *argv[]
        }
  
        startup_mutex = fio_mutex_init(0);
 +      if (startup_mutex == NULL)
 +              return 1;
        writeout_mutex = fio_mutex_init(1);
 +      if (writeout_mutex == NULL)
 +              return 1;
  
        set_genesis_time();