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.
solarisaio Solaris native asynchronous io.
+ windowsaio Windows native asynchronous io.
+
mmap File is memory mapped and data copied
to/from using memcpy(3).
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
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
------------
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:
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
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).
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
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
* 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);
}
}
}
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);
}
/*
*/
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
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);
}
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();