fio.git
10 years agostat: warn on failure to detach DU thread
Jens Axboe [Mon, 14 Apr 2014 18:15:35 +0000 (12:15 -0600)]
stat: warn on failure to detach DU thread

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agogettime: handle pthread_create() failure
Jens Axboe [Mon, 14 Apr 2014 18:14:17 +0000 (12:14 -0600)]
gettime: handle pthread_create() failure

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoinit: silence bogus td == NULL warning
Jens Axboe [Mon, 14 Apr 2014 18:07:36 +0000 (12:07 -0600)]
init: silence bogus td == NULL warning

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agofilesetup: silence bogus warning on close(-1)
Jens Axboe [Mon, 14 Apr 2014 18:05:22 +0000 (12:05 -0600)]
filesetup: silence bogus warning on close(-1)

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoe4defrag: pass 'error' into td_verror()
Jens Axboe [Mon, 14 Apr 2014 18:03:22 +0000 (12:03 -0600)]
e4defrag: pass 'error' into td_verror()

Don't use -1 or -Exxxx

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agotd_verror() needs errno style error
Jens Axboe [Mon, 14 Apr 2014 18:01:45 +0000 (12:01 -0600)]
td_verror() needs errno style error

put_file_log() could pass in -1, we need the actual error instead.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agonet engine: get rid of unused struct sockaddr_in6
Jens Axboe [Mon, 14 Apr 2014 17:57:05 +0000 (11:57 -0600)]
net engine: get rid of unused struct sockaddr_in6

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoserver: ensure that incoming iolog name is NULL terminated
Jens Axboe [Mon, 14 Apr 2014 17:45:34 +0000 (11:45 -0600)]
server: ensure that incoming iolog name is NULL terminated

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoserver: sanity check incoming command size (and payload)
Jens Axboe [Mon, 14 Apr 2014 17:43:47 +0000 (11:43 -0600)]
server: sanity check incoming command size (and payload)

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agobackend: better NULL termination fix for IO scheduler switching
Jens Axboe [Mon, 14 Apr 2014 17:36:01 +0000 (11:36 -0600)]
backend: better NULL termination fix for IO scheduler switching

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agonum2str: ensure we never access postfix[] out-of-bounds
Jens Axboe [Mon, 14 Apr 2014 16:21:11 +0000 (10:21 -0600)]
num2str: ensure we never access postfix[] out-of-bounds

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agomake_filename: another off-by-one buffer issue
Jens Axboe [Mon, 14 Apr 2014 16:13:46 +0000 (10:13 -0600)]
make_filename: another off-by-one buffer issue

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoError check fcntl() calls
Jens Axboe [Mon, 14 Apr 2014 16:04:21 +0000 (10:04 -0600)]
Error check fcntl() calls

Add a helper to mark an fd as non-blocking, so we can check
and complain in one place.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoinit: remove dead code
Jens Axboe [Mon, 14 Apr 2014 15:52:50 +0000 (09:52 -0600)]
init: remove dead code

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agobackend: fix potential divide-by-zero
Jens Axboe [Mon, 14 Apr 2014 15:51:10 +0000 (09:51 -0600)]
backend: fix potential divide-by-zero

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agostat: fix potential divide-by-zero
Jens Axboe [Mon, 14 Apr 2014 15:49:38 +0000 (09:49 -0600)]
stat: fix potential divide-by-zero

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoidletime: fix potential divide-by-zero
Jens Axboe [Mon, 14 Apr 2014 15:47:14 +0000 (09:47 -0600)]
idletime: fix potential divide-by-zero

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoeta: fix potential divide by zero
Jens Axboe [Mon, 14 Apr 2014 15:45:19 +0000 (09:45 -0600)]
eta: fix potential divide by zero

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoserver: fix missing comma in fio_server_ops[] strings
Jens Axboe [Mon, 14 Apr 2014 15:07:30 +0000 (09:07 -0600)]
server: fix missing comma in fio_server_ops[] strings

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agogettime: use unsigned loop counter
Jens Axboe [Mon, 14 Apr 2014 15:05:46 +0000 (09:05 -0600)]
gettime: use unsigned loop counter

We're comparing with an unsigned exit condition.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoMake td_verror() use an unsigned type
Jens Axboe [Mon, 14 Apr 2014 15:04:48 +0000 (09:04 -0600)]
Make td_verror() use an unsigned type

Get rid of warnings stating the input can't be negative.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoFix missing sign conversion in ignore_error_type()
Jens Axboe [Mon, 14 Apr 2014 14:59:17 +0000 (08:59 -0600)]
Fix missing sign conversion in ignore_error_type()

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agostat: fix wrong check for whether we have a description or not
Jens Axboe [Mon, 14 Apr 2014 14:57:35 +0000 (08:57 -0600)]
stat: fix wrong check for whether we have a description or not

It's an array, hence never NULL. Check for size instead.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoserver: fix potential buffer overrun in socket setup path
Jens Axboe [Mon, 14 Apr 2014 14:55:13 +0000 (08:55 -0600)]
server: fix potential buffer overrun in socket setup path

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoserver: fix potential buffer overrun in bind string
Jens Axboe [Mon, 14 Apr 2014 14:54:09 +0000 (08:54 -0600)]
server: fix potential buffer overrun in bind string

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoclient: fix potential buffer overrun in socket path
Jens Axboe [Mon, 14 Apr 2014 14:50:33 +0000 (08:50 -0600)]
client: fix potential buffer overrun in socket path

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agonet engine: fix potential buffer overrun in socket path
Jens Axboe [Mon, 14 Apr 2014 14:49:04 +0000 (08:49 -0600)]
net engine: fix potential buffer overrun in socket path

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agofile: fix potential buffer overrun in get_fs_free_counts()
Jens Axboe [Mon, 14 Apr 2014 14:45:13 +0000 (08:45 -0600)]
file: fix potential buffer overrun in get_fs_free_counts()

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoverify: fix potential buffer overrun in dump_buf()
Jens Axboe [Mon, 14 Apr 2014 14:43:55 +0000 (08:43 -0600)]
verify: fix potential buffer overrun in dump_buf()

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoinit: fix potential buffer overrun in make_filename()
Jens Axboe [Mon, 14 Apr 2014 14:34:43 +0000 (08:34 -0600)]
init: fix potential buffer overrun in make_filename()

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoserver: ensure that dus->name is always NULL terminated
Jens Axboe [Mon, 14 Apr 2014 14:28:08 +0000 (08:28 -0600)]
server: ensure that dus->name is always NULL terminated

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agostat: check that TEMP environment variable is half-way sane
Jens Axboe [Mon, 14 Apr 2014 14:23:23 +0000 (08:23 -0600)]
stat: check that TEMP environment variable is half-way sane

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoinit: fix more cases of leaking pid_file
Jens Axboe [Mon, 14 Apr 2014 14:17:30 +0000 (08:17 -0600)]
init: fix more cases of leaking pid_file

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agodiskutil: separate out stats from name
Jens Axboe [Fri, 11 Apr 2014 18:17:53 +0000 (12:17 -0600)]
diskutil: separate out stats from name

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoinit: remove bogus check for NULL parent
Jens Axboe [Fri, 11 Apr 2014 17:42:13 +0000 (11:42 -0600)]
init: remove bogus check for NULL parent

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoDon't leak f_out file desciptor if specified more than once
Jens Axboe [Fri, 11 Apr 2014 17:39:46 +0000 (11:39 -0600)]
Don't leak f_out file desciptor if specified more than once

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoDon't leak memory if profile option is given twice
Jens Axboe [Fri, 11 Apr 2014 17:38:38 +0000 (11:38 -0600)]
Don't leak memory if profile option is given twice

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoserver: ensure that server pid file mem is always freed
Jens Axboe [Fri, 11 Apr 2014 17:37:34 +0000 (11:37 -0600)]
server: ensure that server pid file mem is always freed

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoEnsure that fread() string is always NULL terminated
Jens Axboe [Fri, 11 Apr 2014 17:34:17 +0000 (11:34 -0600)]
Ensure that fread() string is always NULL terminated

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoFix potentially unterminated string after strncpy() call
Jens Axboe [Fri, 11 Apr 2014 17:32:49 +0000 (11:32 -0600)]
Fix potentially unterminated string after strncpy() call

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoFix leak of directory handle in find_add_disk_slaves() error case
Jens Axboe [Fri, 11 Apr 2014 17:31:17 +0000 (11:31 -0600)]
Fix leak of directory handle in find_add_disk_slaves() error case

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agonet: fix leak of fd in bind() error path
Jens Axboe [Fri, 11 Apr 2014 17:29:50 +0000 (11:29 -0600)]
net: fix leak of fd in bind() error path

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoFix leak on error path in extend_file()
Jens Axboe [Fri, 11 Apr 2014 17:28:54 +0000 (11:28 -0600)]
Fix leak on error path in extend_file()

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoFix leak of file descriptor in error path of bc_calc()
Jens Axboe [Fri, 11 Apr 2014 17:27:34 +0000 (11:27 -0600)]
Fix leak of file descriptor in error path of bc_calc()

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoFix leak of string when doing parse dryrun
Jens Axboe [Fri, 11 Apr 2014 17:25:32 +0000 (11:25 -0600)]
Fix leak of string when doing parse dryrun

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoFix directory leak in recurse_dir() on error
Jens Axboe [Fri, 11 Apr 2014 17:24:00 +0000 (11:24 -0600)]
Fix directory leak in recurse_dir() on error

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoFix leak of 'error' if we don't assign it
Jens Axboe [Fri, 11 Apr 2014 17:20:29 +0000 (11:20 -0600)]
Fix leak of 'error' if we don't assign it

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoFio 2.1.8 fio-2.1.8
Jens Axboe [Thu, 10 Apr 2014 22:50:39 +0000 (16:50 -0600)]
Fio 2.1.8

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoblktrace: fix missing line return in dprint()
Jens Axboe [Thu, 10 Apr 2014 22:08:41 +0000 (00:08 +0200)]
blktrace: fix missing line return in dprint()

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoiolog: check for thread termination in long delays
Jens Axboe [Thu, 10 Apr 2014 22:03:32 +0000 (00:03 +0200)]
iolog: check for thread termination in long delays

If we are doing a long delay now, fio won't be able to kill
the thread when you ctrl-c the job. Split the delay into .5s
intervals, and check for signal in between.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoMake cache invalidation a soft error
Jens Axboe [Thu, 10 Apr 2014 14:59:43 +0000 (08:59 -0600)]
Make cache invalidation a soft error

On some platforms, we don't have reliable means of flushing
eg block device caches. Just warn of this fact instead of
erroring out, since the user can't do anything to stop this.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agofio: fix s390 timing for older machines/binutils
Christian Ehrhardt [Thu, 10 Apr 2014 13:09:47 +0000 (15:09 +0200)]
fio: fix s390 timing for older machines/binutils

Older gcc/binutils or one with very low default march will refuse to use stckf.
On top of that machines older than a z196 don not even have the store clock
fast facility.

To fix all of those issues, check for the facilities in configure step and make
the usage of stckf and a matching march dependent to it.

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoMerge branch 'master' of ssh://git.kernel.dk/data/git/fio
Jens Axboe [Wed, 9 Apr 2014 19:58:43 +0000 (13:58 -0600)]
Merge branch 'master' of ssh://git.kernel.dk/data/git/fio

10 years agoAdd exit_on_io_done option to the CPU IO engine
Jens Axboe [Wed, 9 Apr 2014 19:57:38 +0000 (13:57 -0600)]
Add exit_on_io_done option to the CPU IO engine

The CPU IO engine is most often used to saturate the system,
while running an IO load on it. As such, it's useful to have
CPU engine threads exit automatically, when IO has completed.
Add exit_on_io_done as a CPU IO engine option for that purpose.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoiolog: skip max_bs[rw] increment for rw == DDIR_INVAL
Jens Axboe [Wed, 9 Apr 2014 03:18:37 +0000 (21:18 -0600)]
iolog: skip max_bs[rw] increment for rw == DDIR_INVAL

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agodiskutil: fix potential out-of-bounds array write
Jens Axboe [Wed, 9 Apr 2014 03:15:09 +0000 (21:15 -0600)]
diskutil: fix potential out-of-bounds array write

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoserver: fix fd leak in error case
Jens Axboe [Wed, 9 Apr 2014 03:13:42 +0000 (21:13 -0600)]
server: fix fd leak in error case

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoIncrement open file count manually
Jens Axboe [Wed, 9 Apr 2014 03:07:12 +0000 (21:07 -0600)]
Increment open file count manually

For engines/logs that manually add files, be sure to increment
the open file count.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoRevert "Fixup ->open_files if not given"
Jens Axboe [Wed, 9 Apr 2014 03:03:59 +0000 (21:03 -0600)]
Revert "Fixup ->open_files if not given"

This reverts commit bcd27f7ae1ccebd2ac1778752bf8f13fa99600e9.

The commit causes us to default to 1 file for cases where
openfiles= isn't set, where before we would default to
nr_files.

Signed-off-by: Jens Axboe <axboe@fb.com>
Conflicts:
filesetup.c

10 years agoMerge branch 'master' of ssh://git.kernel.dk/data/git/fio
Jens Axboe [Tue, 8 Apr 2014 19:44:37 +0000 (13:44 -0600)]
Merge branch 'master' of ssh://git.kernel.dk/data/git/fio

10 years agoblktrace: probe IO depth
Jens Axboe [Tue, 8 Apr 2014 19:43:19 +0000 (13:43 -0600)]
blktrace: probe IO depth

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agofio: fix s390 nop
Christian Ehrhardt [Tue, 8 Apr 2014 15:52:01 +0000 (17:52 +0200)]
fio: fix s390 nop

When trying to run rate limited fio runs we encountered that the current
definition of a nop uses a privileged instruction which is not even a nop,
but a yield call to the hipervisor.
That leads to a SIGILL as it is privileged.

To solve that issue replace it with a nop, the assembler will take care
of it (likely to become a BCR 0,0)

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agofio: fix s390 time accounting
Christian Ehrhardt [Tue, 8 Apr 2014 15:52:00 +0000 (17:52 +0200)]
fio: fix s390 time accounting

The current timer implementation could cause time warps on s390 which ends up
as time bound jobs that would never end, because they always reset themself to
the old time.

When touching this code anyway, we also change it to use the faster stckf
and avoid the calibration as we can control the result to be usecs.
This also eliminates a few calculations cycle->usec in the hot path for the
timer.

In case other architectures have similar improved timers that might not be
usec based, but nsec based or such a thing any architecture can set
ARCH_CPU_CLOCK_CYCLES_PER_USEC to an appropriate per-arch value.
This leaves the infrastructure open for others and the compiler will throw
our division by 1 away anyway.

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoSupport limited mixed command line options and job file
Jens Axboe [Sun, 6 Apr 2014 16:10:32 +0000 (10:10 -0600)]
Support limited mixed command line options and job file

With this, you can now do:

$ fio --timeout=10s --time_based=1 jobfile.fio

and have the command line options work as if they were part
of the global section of jobfile.fio

Note that more advanced uses, like:

$ fio --option_foo=1 jobfile.fio --option_bar=1 jobfile2.fio

will not work, we still clear to default options for
subsequent jobs.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoFixup --timeout command line option
Jens Axboe [Sun, 6 Apr 2014 16:09:30 +0000 (10:09 -0600)]
Fixup --timeout command line option

Ensure we properly parse the time, use check_str_time()
instead of atoi(). Propagate the timeout correctly to
new jobs.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoMerge branch 'master' of ssh://git.kernel.dk/data/git/fio
Jens Axboe [Sun, 6 Apr 2014 15:57:59 +0000 (09:57 -0600)]
Merge branch 'master' of ssh://git.kernel.dk/data/git/fio

10 years agoFix crash in setup_files() if no files are defined
Jens Axboe [Sun, 6 Apr 2014 15:56:10 +0000 (09:56 -0600)]
Fix crash in setup_files() if no files are defined

Commit 002fe73409d1e moved the division by o->nr_files outside
of the file loop, so for error cases we could end up with
doing the division without having files defined. Crash ensues.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoMakefile: add doc target to generate PDFs from the man pages
Jens Axboe [Fri, 4 Apr 2014 14:28:17 +0000 (08:28 -0600)]
Makefile: add doc target to generate PDFs from the man pages

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoFix JSON_INTEGER overflow on Windows by changing datatype to 'long long'
Bruce Cran [Thu, 3 Apr 2014 18:17:00 +0000 (12:17 -0600)]
Fix JSON_INTEGER overflow on Windows by changing datatype to 'long long'

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoparse: fix crash with empty FIO_OPT_STR_STORE variables
Jens Axboe [Thu, 3 Apr 2014 14:18:07 +0000 (08:18 -0600)]
parse: fix crash with empty FIO_OPT_STR_STORE variables

Sébastien reports:

A crash on solaris & windows (at least) when using fio-2.1.6.1 :

A simple profile that use a env variable : directory=${DIRECTORY}

I'm starting fio without defining DIRECTORY and I'm getting a crash:

The stack on solaris is :

core 'core' of 4574:    ./fio ../fio_env.win
 0000000100035348 set_name_idx (ffffffff7fffe970100231950, 0, 16c4e8, 0, 1002319b0) + cc
 0000000100021a70 add_file (ffffffff7b400000ffffffff7fffee60, 0, 0, 100071c30ffffffff7fffe970) + 38
 000000010000daf4 add_job.part.4 (7, 100236050, 0, ffffffff7ffff268, 1, 0) + 11f0
 000000010000f444 parse_jobs_ini (0, 0, 0, 1, 1002360501002276c0) + 77c
 0000000100010db0 parse_options (5118, ffffffff7ffff968, 1, 0, 0, 10021eef0) + 304
 000000010006ff68 main (2, ffffffff7ffff968ffffffff7ffff980100228338100000000, 2800) + 20
 000000010000952c _start (0, 0, 0, 0, 0, 0) + 7c

Same thing happens with filename and other store options. Fix this
by checking in the parser whether the string is empty or not.

Reported-by: Sébastien Bouchex Bellomié <sbouchex@infovista.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoUse setvbuf() for log writing
Jens Axboe [Thu, 3 Apr 2014 03:47:27 +0000 (21:47 -0600)]
Use setvbuf() for log writing

Check if we have it - if we do, add a 1MB buffer for the file
output. This further speeds up the log writing.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoiolog: invert log_mask bits
Jens Axboe [Thu, 3 Apr 2014 02:07:28 +0000 (20:07 -0600)]
iolog: invert log_mask bits

Get rid of the all-log-mask.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agocrc: add test.h header to test.c
Jens Axboe [Thu, 3 Apr 2014 02:03:32 +0000 (20:03 -0600)]
crc: add test.h header to test.c

This way the static analyzers know that there's a reason
for the exported function.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoCleanup the parallellized log writing
Jens Axboe [Thu, 3 Apr 2014 02:01:27 +0000 (20:01 -0600)]
Cleanup the parallellized log writing

And move it all to iolog.c, this means we can un-export
some of the log functions, too.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoiolog: don't serialize the writing of all logs
Jens Axboe [Wed, 2 Apr 2014 21:46:58 +0000 (15:46 -0600)]
iolog: don't serialize the writing of all logs

Serialize based on filename, so that independent logs can be
written at the same time. If the logs are big, this can take
a while to flush to disk. It's silly to have all jobs waiting
on each other, when they could write their own logs independently.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoAdd 'f' (Finishing) flag to status output
Jens Axboe [Wed, 2 Apr 2014 21:46:22 +0000 (15:46 -0600)]
Add 'f' (Finishing) flag to status output

Use this for finalizing logs when a thread is done, since
that can take a long time.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agomutex: add open init function and down_trylock() variant
Jens Axboe [Wed, 2 Apr 2014 21:45:25 +0000 (15:45 -0600)]
mutex: add open init function and down_trylock() variant

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoDon't crash when using filehash lock before init
Jens Axboe [Wed, 2 Apr 2014 18:25:16 +0000 (12:25 -0600)]
Don't crash when using filehash lock before init

We might be parsing and adding files (which locks the hash
lock) before we have setup threads. For that case, don't
bother locking, we're serialized at that point.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoAdd missing crc/test.h file
Jens Axboe [Wed, 2 Apr 2014 17:41:29 +0000 (11:41 -0600)]
Add missing crc/test.h file

Commit 10aa136b forgot to add this file, unfortunately.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoFix propagation of error value on failure to connect to fio server
Jens Axboe [Wed, 2 Apr 2014 14:28:49 +0000 (08:28 -0600)]
Fix propagation of error value on failure to connect to fio server

Fio does detect the error and exits, but it doesn't exit with
a non-zero exit value.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoMerge branch 'erwan/clang' of https://github.com/enovance/fio
Jens Axboe [Wed, 2 Apr 2014 14:20:18 +0000 (08:20 -0600)]
Merge branch 'erwan/clang' of https://github.com/enovance/fio

10 years agoMerge branch 'erwan/nobasename' of https://github.com/enovance/fio
Jens Axboe [Wed, 2 Apr 2014 13:42:33 +0000 (07:42 -0600)]
Merge branch 'erwan/nobasename' of https://github.com/enovance/fio

10 years agoio_u: Using initialized local variable
Erwan Velu [Wed, 2 Apr 2014 08:51:16 +0000 (10:51 +0200)]
io_u: Using initialized local variable

ddir was feed with io_u->ddir at init time but didn't got used before
reassign it to the same value or another one.

That was making this init useless.

This patch simplify this portion of code by using the initialized
variable.

10 years agostat: fixing bw_agg reporting
Erwan Velu [Wed, 2 Apr 2014 08:36:40 +0000 (10:36 +0200)]
stat: fixing bw_agg reporting

It was wrongly set to the mean value instead of the agg one.

10 years agoiolog: Keep full path for logs files
Erwan Velu [Wed, 2 Apr 2014 08:00:56 +0000 (10:00 +0200)]
iolog: Keep full path for logs files

The default behavior of fio was to basename() the log filename
preventing relocating it into another directory.

This patch simply removes the basename() that doesn't provides any real
feature but only limit the usage.

Patch tested with genfio with success while relocating to /tmp.

10 years agoCleanup symbols that should be static
Jens Axboe [Wed, 2 Apr 2014 03:10:36 +0000 (21:10 -0600)]
Cleanup symbols that should be static

Run analysis on symbols not used outside of their current file,
turn them into statics.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoFile pre-read lseek error check
Jens Axboe [Tue, 1 Apr 2014 23:01:30 +0000 (17:01 -0600)]
File pre-read lseek error check

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoAdd alloc_new_file()
Jens Axboe [Tue, 1 Apr 2014 22:37:03 +0000 (16:37 -0600)]
Add alloc_new_file()

Hopefully avoid a bug like commit 4db205dc fixed by abstracting
out the allocate-and-initialize part of fio_file allocation.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoEnsure we inherit global latency/bw log settings
Jens Axboe [Tue, 1 Apr 2014 19:34:49 +0000 (13:34 -0600)]
Ensure we inherit global latency/bw log settings

Note that you cannot use a filename with these, it's just
an on/off switch. For tighter control of where the log
is written (and its name), use the job option instead of
the command line on/off switch.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoProperly protect already-allocated file list
Jens Axboe [Tue, 1 Apr 2014 18:28:47 +0000 (12:28 -0600)]
Properly protect already-allocated file list

We need proper locking around it for thread based setups.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoProperly initialize shadow_fd to -1
Jens Axboe [Tue, 1 Apr 2014 18:28:15 +0000 (12:28 -0600)]
Properly initialize shadow_fd to -1

We forget that in one case, causing all sorts of issues when
we end up closing this bogus (STDIN) descriptor.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoFix bug in freeing of duplicated files
Andrey Kuzmin [Tue, 1 Apr 2014 18:27:04 +0000 (12:27 -0600)]
Fix bug in freeing of duplicated files

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoFio 2.1.7 fio-2.1.7
Jens Axboe [Mon, 31 Mar 2014 15:05:54 +0000 (09:05 -0600)]
Fio 2.1.7

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoMerge branch 'master' of ssh://git.kernel.dk/data/git/fio
Jens Axboe [Fri, 28 Mar 2014 14:09:35 +0000 (08:09 -0600)]
Merge branch 'master' of ssh://git.kernel.dk/data/git/fio

10 years agoFix wrong time conversion on --status-interval= command line option
Jens Axboe [Fri, 28 Mar 2014 14:09:10 +0000 (08:09 -0600)]
Fix wrong time conversion on --status-interval= command line option

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoserver: unlink sock file if interrupted early
Jens Axboe [Tue, 25 Mar 2014 22:06:17 +0000 (15:06 -0700)]
server: unlink sock file if interrupted early

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoserver: dump where we attempted to bind in case of failure
Jens Axboe [Tue, 25 Mar 2014 17:50:55 +0000 (10:50 -0700)]
server: dump where we attempted to bind in case of failure

Helps locate what the issue is, instead of having to use
strace and similar tools.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoserver: correct comment typo on port being after ':'
Jens Axboe [Tue, 25 Mar 2014 17:37:56 +0000 (10:37 -0700)]
server: correct comment typo on port being after ':'

We use commas in fio, since that works equally well on IPv4
and IPv6.

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoPass -Wstrict-prototypes -Wold-style-definition, whitespace
Castor Fu [Thu, 20 Mar 2014 17:59:29 +0000 (10:59 -0700)]
Pass -Wstrict-prototypes -Wold-style-definition, whitespace

Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoDon't re-create/unlink write file for append workload
Jens Axboe [Thu, 20 Mar 2014 15:33:13 +0000 (09:33 -0600)]
Don't re-create/unlink write file for append workload

Signed-off-by: Jens Axboe <axboe@fb.com>