Vincent Fu [Thu, 23 Feb 2023 22:53:34 +0000 (22:53 +0000)]
t/random_seed: python script to test random seed options
This new script tests combinations of randrepeat, allrandrepeat, and
randseed.
Also add this script to t/run-fio-tests.py.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Fri, 24 Mar 2023 18:16:29 +0000 (18:16 +0000)]
init: clean up random seed options
- make allrandrepeat a synonym of randrepeat. allrandrepeat is
superfluous because the seeds set by randrepeat already encompass
random number generators beyond the one used for random offsets.
- allow randseed to override [all]randrepeat: this is what the
documentation implies but was not previously the case
This is a breaking change for users relying on the values of fio's
default random seeds.
Link: https://github.com/axboe/fio/pull/1546
Fixes: https://github.com/axboe/fio/issues/1502
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Fri, 24 Mar 2023 18:08:25 +0000 (18:08 +0000)]
init: get rid of td_fill_rand_seeds_internal
Do all the work of td_fill_rand_seeds_internal in td_fill_rand_seeds
since td_fill_rand_seeds was basically emptied by the previous patch.
No functional change.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Fri, 24 Mar 2023 17:47:14 +0000 (17:47 +0000)]
init: refactor random seed setting
td->rand_seed was modified in three different places. Put all this code
in setup_random_seeds() to make it easier to understand and more
maintanable. Also put setup_random_seeds() next to the other
random-seed-related functions in init.c.
init_rand_seed() was called in three different places for fio's main random
number generators. Also put these three sets of invocations in the same
place.
Always initialize all of fio's main set of random states instead of
skipping some for sequential workloads. This makes debugging easier.
No functional change.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Tue, 21 Feb 2023 22:53:00 +0000 (22:53 +0000)]
rand: print out random seeds for debugging
In order to debug how we handle random seeds let's print out the random
seeds we use in the FD_RANDOM debug output.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Xiaoguang Wang [Thu, 13 Apr 2023 10:47:14 +0000 (18:47 +0800)]
t/io_uring: fix max_blocks calculation in nvme passthrough mode
nvme_id_ns's nsze has already been counted in logical blocks, so
there is no need to divide by bs.
Signed-off-by: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230413104714.57703-1-xiaoguang.wang@linux.alibaba.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Jens Axboe [Mon, 10 Apr 2023 21:40:45 +0000 (15:40 -0600)]
Merge branch 'libaio-hang' of https://github.com/lrumancik/fio
* 'libaio-hang' of https://github.com/lrumancik/fio:
engines/io_uring: update getevents max to reflect previously seen events
Leah Rumancik [Mon, 10 Apr 2023 18:57:15 +0000 (11:57 -0700)]
engines/io_uring: update getevents max to reflect previously seen events
To ensure we don't return more than the requested number of events,
update the max events variable after reaping events before subsequent
calls to io_getevents system call.
Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
Jens Axboe [Fri, 7 Apr 2023 22:42:07 +0000 (16:42 -0600)]
Merge branch 'libaio-hang' of https://github.com/lrumancik/fio
* 'libaio-hang' of https://github.com/lrumancik/fio:
engines/libaio: fix io_getevents min/max events arguments
Leah Rumancik [Fri, 7 Apr 2023 20:41:03 +0000 (13:41 -0700)]
engines/libaio: fix io_getevents min/max events arguments
If the io_getevents system call is interrupted, it can succeed while
returning less than the min_nr requested events. If this occurs during
the final reaping of events, libaio will call io_getevents again wtih
the same minimum events argument. Since some of the events have already
been reaped, this results in a hang. To fix this, update the arguments
for io_getevents based on the previously seen events.
Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
Jens Axboe [Tue, 4 Apr 2023 15:49:19 +0000 (09:49 -0600)]
io_u: fix bad style
Fixes:
4ef1562a0135 ("io_u: Fix bad interaction with --openfiles and non-sequential file selection policy")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Jens Axboe [Tue, 4 Apr 2023 15:11:19 +0000 (09:11 -0600)]
engines/nfs: fix the most egregious style violations
Not sure how this got past review...
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Jens Axboe [Tue, 4 Apr 2023 14:51:31 +0000 (08:51 -0600)]
engines/nvme: cache errno value
It's pretty pointless to do a bunch of things in between getting
a -1/errno value, and then expect errno to still be what you want.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Jens Axboe [Tue, 4 Apr 2023 13:37:37 +0000 (07:37 -0600)]
Merge branch 'master' of https://github.com/SuhoSon/fio
* 'master' of https://github.com/SuhoSon/fio:
thinktime: Fix missing re-init thinktime when using ramptime
Jens Axboe [Fri, 31 Mar 2023 18:52:01 +0000 (12:52 -0600)]
Only expose fadvise_hint=noreuse if supported
At least OSX doesn't have this option or define, just make it
available if it's there on the platform we're building on.
Fixes:
eb314e7072a0 ("fio: add support for POSIX_FADV_NOREUSE")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Yuanchu Xie [Fri, 31 Mar 2023 18:37:03 +0000 (11:37 -0700)]
docs: add noreuse fadvise_hint option
noreuse was added as an fadvise_hint option to apply POSIX_FADV_NOREUSE,
so we add it to the docs as well.
Signed-off-by: Yuanchu Xie <yuanchu@google.com>
Link: https://lore.kernel.org/r/20230331183703.3145788-1-yuanchu@google.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Yuanchu Xie [Fri, 31 Mar 2023 18:37:02 +0000 (11:37 -0700)]
fio: add support for POSIX_FADV_NOREUSE
As of Linux kernel commit
17e810229cb3 ("mm: support
POSIX_FADV_NOREUSE"), POSIX_FADV_NOREUSE hints at the LRU algorithm to
ignore accesses to mapped files with this flag. Previously, it was a
no-op.
Add it in fio as an fadvise_hint option to test the new behavior.
Signed-off-by: Yuanchu Xie <yuanchu@google.com>
Link: https://lore.kernel.org/r/20230331183703.3145788-1-yuanchu@google.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
suho.son [Fri, 31 Mar 2023 07:10:09 +0000 (16:10 +0900)]
thinktime: Fix missing re-init thinktime when using ramptime
Prevent I/O bursts after ramptime due to thinktime.
Each thread generates a certain amount of I/O requests,
configured by thinktime_blocks.
When ramptime ends, thinktime_blocks can't control I/O.
Because thinktime_blocks are not reinitialized after ramptime.
I fixed it by reinitializing last_thinktime and last_thinktime_blocks
when ramptime ended.
Signed-off by: Suho Son <suho.son@samsung.com>
Jens Axboe [Mon, 27 Mar 2023 19:21:25 +0000 (13:21 -0600)]
Merge branch 'trim-support' of https://github.com/ankit-sam/fio
* 'trim-support' of https://github.com/ankit-sam/fio:
io_uring_cmd: suppport for trim operation
fdp: drop expensive modulo operation
Ankit Kumar [Tue, 7 Mar 2023 14:21:06 +0000 (19:51 +0530)]
io_uring_cmd: suppport for trim operation
Add support for trim operation to the io_uring_cmd
ioengine.
Print ZBD zone reset stats for trim operation.
Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Ankit Kumar [Tue, 14 Mar 2023 09:26:26 +0000 (14:56 +0530)]
fdp: drop expensive modulo operation
Remove the usage of expensive modulo operation as the same can be easily
achieved with addition and wrapping around avilable reclaim unit handles.
Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Jens Axboe [Tue, 21 Mar 2023 14:40:14 +0000 (08:40 -0600)]
engines/nvme: cast __u64 to unsigned long long for printing
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Jens Axboe [Tue, 21 Mar 2023 14:38:32 +0000 (08:38 -0600)]
engines/io_uring: use correct type for fio_nvme_get_info()
powerpc64 compiles complain about casting unsigned long long to __u64,
just use the right type to begin with.
Fixes:
b3d5e3fd80e3 ("nvme: add nvme opcodes, structures and helper functions")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Vincent Fu [Mon, 20 Mar 2023 17:45:09 +0000 (13:45 -0400)]
docs: clean up steadystate options
Synchronize HOWTO.rst and fio.1, make a minor edit, and improve the
formatting.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Mon, 20 Mar 2023 15:52:22 +0000 (11:52 -0400)]
steadystate: add some TODO items
We need a better test script that includes test cases for the new
check_interval option. With the new test script we can be more
comfortable doing cleanups.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Mon, 20 Mar 2023 15:45:31 +0000 (11:45 -0400)]
steadystate: fix slope calculation for variable check intervals
There were several more spots where the calculations dependend on the
assumption that measurements were taken once every second. Fix those.
Fixes:
95a2f70c20c28f417f605974ab3b90c032c10024 ("fio: steadystate:
allow for custom check interval")
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Christian Loehle [Tue, 7 Feb 2023 15:06:16 +0000 (16:06 +0100)]
fio: steadystate: allow for custom check interval
Allow for a different steady state check interval than 1s with
a new --ss_interval parameter.
Steady state is reached when the steady state condition (like slope) is
true when comparing the last windows (set with --ss_dur).
The actual values for this comparison is currently calculated for a 1s
interval during the window.
This is especially problematic for slow random devices, where the values do
not converge for such a fine granularity.
Letting the user set this solves this problem, although requires them figuring
out an appropriate value themselves.
--ss=iops:5% --ss_dur=120s should reproduce this for many (slower) devices.
Then adding like --ss_interval=20s may let it converge.
Signed-off-by: Christian Loehle <cloehle@posteo.de>
Damien Le Moal [Fri, 10 Mar 2023 01:28:39 +0000 (10:28 +0900)]
stat: Fix ioprio print
When using per-priority statistics for workloads using multiple
different priority values, the statistics output displays the priority
class and value (level) for each set of statistics. However, this is
done using linux priority values coding, that is, assuming that the
priority level is at most 7 (lower 3-bits). However, this is not always
the case for all OSes. E.g. dragonfly allows IO priorities up to a
value of 10.
Introduce the OS dependent ioprio_class() and ioprio() macros to extract
the fields from an ioprio value according to the OS capabilities. A
generic definition (always returning 0) for these macros in os/os.h is
added and used for all OSes that do not define these macros.
The functions show_ddir_status() and add_ddir_status_json() are modified
to use these new macros to fix per priority statistics output. The
modification includes changes to the loops over the clat_prio array to
reduce indentation levels, making the code a little cleaner.
Fixes:
692dec0cfb4b ("stat: report clat stats on a per priority granularity")
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Jens Axboe [Tue, 14 Mar 2023 20:03:32 +0000 (14:03 -0600)]
t/io_uring: abstract out init_new_io() helper
We do this in 4 different spots, put it in a helper.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Jens Axboe [Tue, 14 Mar 2023 19:59:32 +0000 (13:59 -0600)]
t/io_uring: use the get_offset() code to retrieve pass-through offset
No point in duplicating this code, use the helper.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Jens Axboe [Tue, 14 Mar 2023 19:58:13 +0000 (13:58 -0600)]
t/io_uring: avoid truncation of offset on 32-bit builds
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Jens Axboe [Tue, 14 Mar 2023 12:44:41 +0000 (06:44 -0600)]
Fio 3.34
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Shin'ichiro Kawasaki [Mon, 6 Mar 2023 05:58:40 +0000 (14:58 +0900)]
t/zbd: fix minimum write size to sequential write required zones
ZBC and ZAC require that writes to sequential write required zones shall
be aligned to physical block size. However, the t/zbd/test-zbd-support
script uses logical block size as the minimum write size. When SMR
drives have the physical block size larger than the logical block size,
writes with the logical block size causes unaligned write command error.
To fix it, use correct value as the minimum write size. As for zoned
block devices, introduce a helper function min_seq_write_size(), which
checks sysfs attributes and returns the correct size. Refer the
attribute zone_write_granularity when it is available, which provides the
minimum write size regardless of the device type. If the attribute is
not available, refer the attribute physical_block_size for SMR devices,
and the logical_block_size attribute for other devices. As for SG node
device, refer physical block size that zbc_info command reports.
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Shin'ichiro Kawasaki [Mon, 6 Mar 2023 05:58:39 +0000 (14:58 +0900)]
t/zbd: rename logical_block_size to min_seq_write_size
The test script t/zbd/test-zbd-support assumes that the logical block
size is the minimum size unit to write to sequential write required
zones, then it uses a variable named 'logical_block_size' to keep the
minimum size. The assumption is true for ZNS devices but not for ZBC/ZAC
devices. Rename the variable from 'logical_block_size' to
'min_seq_write_size' to not imply the wrong assumption.
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Jens Axboe [Fri, 3 Mar 2023 17:46:26 +0000 (10:46 -0700)]
Merge branch 'For_Each_Td_Private_Scope' of https://github.com/horshack-dpreview/fio
* 'For_Each_Td_Private_Scope' of https://github.com/horshack-dpreview/fio:
Refactor for_each_td() to catch inappropriate td ptr reuse
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Jens Axboe [Fri, 3 Mar 2023 17:43:05 +0000 (10:43 -0700)]
Merge branch 'Fix_calc_thread_status_ramp_time_check' of https://github.com/horshack-dpreview/fio
* 'Fix_calc_thread_status_ramp_time_check' of https://github.com/horshack-dpreview/fio:
Fix --bandwidth-log segmentation fault when numjobs even multiple of 8
Horshack [Thu, 2 Mar 2023 20:12:54 +0000 (15:12 -0500)]
Refactor for_each_td() to catch inappropriate td ptr reuse
I recently introduced a bug caused by reusing a struct thread_data *td
after the end of a for_each_td() loop construct.
Link: https://github.com/axboe/fio/pull/1521#issuecomment-1448591102
To prevent others from making this same mistake, this commit refactors
for_each_td() so that both the struct thread_data * and the loop index
variable are placed inside their own scope for the loop. This will cause
any reference to those variables outside the for_each_td() to produce an
undeclared identifier error, provided the outer scope doesn't already
reuse those same variable names for other code within the routine (which
is fine because the scopes are separate).
Because C/C++ doesn't let you declare two different variable types
within the scope of a for() loop initializer, creating a scope for both
struct thread_data * and the loop index required explicitly declaring a
scope with a curly brace. This means for_each_td() includes an opening
curly brace to create the scope, which means all uses of for_each_td()
must now end with an invocation of a new macro named end_for_each()
to emit an ending curly brace to match the scope brace created by
for_each_td():
for_each_td(td) {
while (td->runstate < TD_EXITED)
sleep(1);
} end_for_each();
The alternative is to end every for_each_td() construct with an inline
curly brace, which is off-putting since the implementation of an extra
opening curly brace is abstracted in for_each_td():
for_each_td(td) {
while (td->runstate < TD_EXITED)
sleep(1);
}}
Most fio logic only declares "struct thread_data *td" and "int i" for use in
for_each_td(), which means those declarations will now cause -Wunused-variable
warnings since they're not used outside the scope of the refactored
for_each_td(). Those declarations have been removed.
Implementing this change caught a latent bug in eta.c::calc_thread_status()
that accesses the ending value of struct thread_data *td after the end
of for_each_td(), now manifesting as a compile error, so working as
designed :)
Signed-off-by: Adam Horshack (horshack@live.com)
Horshack [Fri, 3 Mar 2023 13:14:53 +0000 (08:14 -0500)]
Fix --bandwidth-log segmentation fault when numjobs even multiple of 8
Segmentation fault occurs when aggregate bandwidth logging is enabled
(--bandwidth-log) and numjobs is an even multiple of 8. Fault occurs
because logic is using the terminating value of struct thread_data *td
from the most recent for_each_td(). This bug was caught by the
refactoring of for_each_td().
Link: https://github.com/axboe/fio/issues/1534
Signed-off-by: Adam Horshack (horshack@live.com)
Vincent Fu [Fri, 3 Mar 2023 00:57:17 +0000 (19:57 -0500)]
Merge branch 'fiologparser-fix' of https://github.com/patrakov/fio
* 'fiologparser-fix' of https://github.com/patrakov/fio:
fix fiologparser.py to work with new logging format
Vincent Fu [Tue, 28 Feb 2023 18:58:58 +0000 (13:58 -0500)]
examples: add fiograph diagram for uring-cmd-fdp.fio
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Tue, 28 Feb 2023 18:01:32 +0000 (13:01 -0500)]
fdp: change the order of includes to fix Windows build error
On Windows fio.h includes some definitions needed by file.h.
fio.h actually includes file.h already but we can retain the file.h
include in fdp.c since it refers to some declarations that were added
there.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Jens Axboe [Tue, 28 Feb 2023 16:08:13 +0000 (09:08 -0700)]
Merge branch 'doc-Clarify_Runtime_Param' of https://github.com/horshack-dpreview/fio
* 'doc-Clarify_Runtime_Param' of https://github.com/horshack-dpreview/fio:
Clarify documentation for runtime parameter
Horshack [Fri, 10 Feb 2023 19:00:11 +0000 (14:00 -0500)]
Clarify documentation for runtime parameter
I realize this is highly subjective but I think the description of the
runtime parameter could be made a bit more precise. I misinterpreted its
meaning after reading the doc and only learned of my mistake by trial and
error using fio. Either I'm just slow or the description could use
just a little more precision :)
Signed-off-by: Adam Horshack (horshack@live.com)
Jens Axboe [Tue, 28 Feb 2023 15:54:36 +0000 (08:54 -0700)]
Revert "ioengines.c:346: td_io_queue: Assertion `res == 0' failed"
This reverts commit
d5a47449ce79001ba233fe6d0499627d0438cb69.
The change to rate-submit.c is clearly bogus, as it's referencing
'td' outside of the actual 'td' loop. It's not valid at that
point.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Jens Axboe [Tue, 28 Feb 2023 15:28:51 +0000 (08:28 -0700)]
fdp: cleanup init
I don't believe we can have a NULL ->io_ops here, but let's just
add an error check and make the static checkers happy as they don't
like the non-NULL check and then a later deref in the other branch.
Add missing braces while at it.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Keith Busch [Mon, 27 Feb 2023 15:51:34 +0000 (07:51 -0800)]
fio: add fdp support for io_uring_cmd nvme engine
Add support for NVMe TP4146 Flexible Data Placemen, allowing placement
identifiers in write commands. The user can enabled this with the new
"fdp=1" parameter for fio's io_uring_cmd ioengine. By default, the fio
jobs will cycle through all the namespace's available placement
identifiers for write commands. The user can limit which placement
identifiers can be used with additional parameter, "fdp_pli=<list,>",
which can be used to separate write intensive jobs from less intensive
ones.
Setting up your namespace for FDP is outside the scope of 'fio', so this
assumes the namespace is already properly configured for the mode.
Link: https://lore.kernel.org/fio/CAKi7+wfX-eaUD5pky5cJ824uCzsQ4sPYMZdp3AuCUZOA1TQrYw@mail.gmail.com/T/#m056018eb07229bed00d4e589f9760b2a2aa009fc
Based-on-a-patch-by: Ankit Kumar <ankit.kumar@samsung.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
[Vincent: fold in sfree fix from Ankit]
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Jens Axboe [Tue, 28 Feb 2023 13:39:58 +0000 (06:39 -0700)]
Merge branch 'Fix_Assert_TdIoQueue_Serialize_Overlap_Offload' of https://github.com/horshack-dpreview/fio
* 'Fix_Assert_TdIoQueue_Serialize_Overlap_Offload' of https://github.com/horshack-dpreview/fio:
ioengines.c:346: td_io_queue: Assertion `res == 0' failed
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Jens Axboe [Tue, 28 Feb 2023 13:38:50 +0000 (06:38 -0700)]
Merge branch 'Fix_Bad_Hdr_Rand_Seed_For_Requeued_IO' of https://github.com/horshack-dpreview/fio
* 'Fix_Bad_Hdr_Rand_Seed_For_Requeued_IO' of https://github.com/horshack-dpreview/fio:
Fix "verify bad_hdr rand_seed" for requeued I/Os
Jens Axboe [Tue, 28 Feb 2023 12:55:55 +0000 (05:55 -0700)]
Merge branch 'master' of https://github.com/Cuelive/fio
* 'master' of https://github.com/Cuelive/fio:
blktrace: fix compilation error on the uos system
Cuelive [Tue, 28 Feb 2023 02:03:21 +0000 (10:03 +0800)]
blktrace: fix compilation error on the uos system
When compiling on uos, it fails with an undefined reference to 'major'. Fix
this by including the correct header for it.
liuyafei <liuyafei@uniontech.com>
Horshack [Sun, 26 Feb 2023 15:12:05 +0000 (10:12 -0500)]
Fix "verify bad_hdr rand_seed" for requeued I/Os
On configurations that can cause I/Os to be internally requeued from
FIO_Q_BUSY such as '--iodepth_batch_complete_max', and the workload has
verify enabled, the subsequent verification of the data fails with a bad
verify rand_seed because the pattern for the I/O is generated twice for
the same I/O, causing the seed to become out of sync when the verify is
later performed. The seed is generate twice because do_io() handles the
I/O twice, first when it originates the I/O and again when it later gets
the same I/O back from get_io_u() after it's is pulled from the requeue
list, which is where the first submission landed due to the workload
reaching '--iodepth_batch_complete_max'.
The fix is for do_io() to track when it has generated the verify pattern
for an I/O via a new io_u flag 'IO_U_F_PATTERN_DONE', avoiding a second
call to populate_verify_io_u() when that flag is detected.
Link: https://github.com/axboe/fio/issues/1526
Signed-off-by: Adam Horshack (horshack@live.com)
Vincent Fu [Fri, 24 Feb 2023 01:17:31 +0000 (20:17 -0500)]
Merge branch 'master' of https://github.com/bvanassche/fio
* 'master' of https://github.com/bvanassche/fio:
zbd: Make an error message more detailed
zbd: Report the zone capacity
io_u: Add a debug message in fill_io_u()
Bart Van Assche [Fri, 13 Jan 2023 22:36:26 +0000 (14:36 -0800)]
zbd: Make an error message more detailed
If zone data is invalid, report in detail why it is invalid.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Bart Van Assche [Wed, 22 Feb 2023 21:54:18 +0000 (13:54 -0800)]
zbd: Report the zone capacity
The zone capacity is important information. Hence report the zone
capacity if ZBD debugging is enabled.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Bart Van Assche [Wed, 22 Feb 2023 21:40:30 +0000 (13:40 -0800)]
io_u: Add a debug message in fill_io_u()
A debug message is logged before each 'return io_u_eof' statement in
fill_io_u() except one. Hence add a debug message in front of that one
return statement.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Alexander Patrakov [Wed, 22 Feb 2023 08:35:59 +0000 (16:35 +0800)]
fix fiologparser.py to work with new logging format
The logging format updates documented in
1a953d97 were never propagated
to fiologparser.py, which since then has been failing with a ValueError
exception.
This commit explicitly limits fiologparser.py to only reading the first
2 columns in the log file, because they are the only columns used.
This is similar to issue #928.
Signed-off-by: Alexander Patrakov <patrakov@gmail.com>
Jens Axboe [Tue, 21 Feb 2023 16:37:09 +0000 (09:37 -0700)]
Merge branch 'Verify_Bad_Hdr_Rand_Seed_Mult_Workload_Iterations_Non_Repeating_Seed' of https://github.com/horshack-dpreview/fio
* 'Verify_Bad_Hdr_Rand_Seed_Mult_Workload_Iterations_Non_Repeating_Seed' of https://github.com/horshack-dpreview/fio:
Bad header rand_seed with time_based or loops with randrepeat=0 verify
Vincent Fu [Mon, 20 Feb 2023 13:28:15 +0000 (08:28 -0500)]
configure: restore dev-dax and libpmem
The commit removing pmemblk inadvertently removed dev-dax and
libpmem ioengines as well.
Tested-by: Yi Zhang yi.zhang@redhat.com
Fixes:
04c1cdc4c108c6537681ab7c50daaed6d2fb4c93 ("pmemblk: remove
pmemblk engine")
Fixes: https://github.com/axboe/fio/issues/1523
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Horshack [Sat, 18 Feb 2023 20:22:54 +0000 (15:22 -0500)]
Bad header rand_seed with time_based or loops with randrepeat=0 verify
Verify fails with "bad header rand_seed" when multiple iterations of
do_io() execute (time_based=1 or loops>0), with verify enabled
and randrepeat=0
The root cause is do_verify() resetting the verify seed back to the
job-init value, which works for verification of the first iteration of
do_io() but fails for subsequent iterations because the seed is left in
its post-do_io() state after the first do_verify(), which means
different rand values for the second iteration of do_io() yet the second
iteration of do_verify() will revert back again to the job-init seed
value.
The fix is to revert the verify seed for randrepeat=0 back to ts state
when do_io() last ran rather than to its job-init value. That will allow
do_verify() to use the correct seed for each iteration while still
retaining a per-iteration unique verify seed.
Link: https://github.com/axboe/fio/issues/1517#issuecomment-1430282533
Signed-off-by: Adam Horshack (horshack@live.com)
Horshack [Sat, 18 Feb 2023 18:07:09 +0000 (13:07 -0500)]
ioengines.c:346: td_io_queue: Assertion `res == 0' failed
Assertion in ioengines.c::td_io_queue() fails for pthread_mutex_unlock()
on overlap_check mutex when serialize_overlap=1, io_submit_mode=offload,
and verify=<any> are used together.
backend.c::fio_io_sync() invokes td_io_queue(), which expects the caller
to have ownership of the overlap_check mutex when serialize_overlap
and offloading are configured, as part of the overlap-check interlock
with IO_U_F_FLIGHT. The mutex is not acquired for this path because it's
not an I/O requiring an overlap check.
The fix is to refine the conditional that triggers td_io_queue() to
release the overlap_check mutex. Rather than using broad config options,
the conditional now uses a new io_u flag named IO_U_F_OVERLAP_LOCK, which
is only set for the offload worker thread path that acquires the mutex.
Link: https://github.com/axboe/fio/issues/1520
Signed-off-by: Adam Horshack (horshack@live.com)
Ankit Kumar [Fri, 17 Feb 2023 07:03:22 +0000 (12:33 +0530)]
backend: fix runtime when used with thinktime
Runtime for fio jobs when used in conjuction with thinktime,
thinktime_iotime and thinktime_spin were sometimes more than
what is specified. Add a fix so that fio doesn't spin or sleep
for any duration beyond runtime.
For the first cycle fio starts by doing I/O for
thinktime + thinktime_iotime, which should just be for
thinktime_iotime. Add a fix for that.
Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Link: https://lore.kernel.org/r/20230217070322.14163-2-ankit.kumar@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Vincent Fu [Fri, 17 Feb 2023 19:55:31 +0000 (14:55 -0500)]
Merge branch 'remove_pmemblk_engine' of github.com:osalyk/fio
* 'remove_pmemblk_engine' of github.com:osalyk/fio:
pmemblk: remove pmemblk engine
Vincent Fu [Fri, 17 Feb 2023 18:22:10 +0000 (13:22 -0500)]
filesetup: don't skip flags for trim workloads
Fio has not been setting O_DIRECT, O_SYNC, O_DSYNC, and O_CREAT for
workloads that include trim commands. Stop doing this and actually set
these flags when requested for workloads that include trim commands.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Jens Axboe [Fri, 17 Feb 2023 18:14:47 +0000 (11:14 -0700)]
Get rid of O_ATOMIC
This feature never went upstream on the Linux kernel side, let's just
get rid of it.
The option is left for now, but we can deprecate that or even probably
remove it as it will never had had any effect.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Vincent Fu [Fri, 10 Feb 2023 18:57:54 +0000 (13:57 -0500)]
iolog: handle trim commands when reading iologs
Add code to process trim commands when we are reading an iolog.
Fixes: https://github.com/axboe/fio/issues/769
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
osalyk [Fri, 17 Feb 2023 07:56:51 +0000 (02:56 -0500)]
pmemblk: remove pmemblk engine
No further support or maintenance of the libpmemblk library is planned.
https://pmem.io/blog/2022/11/update-on-pmdk-and-our-long-term-support-strategy/
https://github.com/pmem/pmdk/pull/5538
Signed-off-by: osalyk <oksana.salyk@intel.com>
Vincent Fu [Wed, 15 Feb 2023 17:49:31 +0000 (12:49 -0500)]
Merge branch 'Read_Stats_Not_Reported_For_Timed_Backlog_Verifies' of github.com:horshack-dpreview/fio
* 'Read_Stats_Not_Reported_For_Timed_Backlog_Verifies' of github.com:horshack-dpreview/fio:
Read stats for backlog verifies not reported for time-expired workloads
Vincent Fu [Tue, 14 Feb 2023 15:47:50 +0000 (10:47 -0500)]
examples: update nbd.fio fiograph diagram
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Richard W.M. Jones [Mon, 13 Feb 2023 13:23:27 +0000 (13:23 +0000)]
examples: Small updates to nbd.fio
Improve the documentation, describing how to use nbdkit with a local
file. Move the suggested test file to /var/tmp since /tmp might be a
tmpfs. Use indenting to make it easier to read.
Use ${uri} instead of ${unixsocket} since nbdkit 1.14 was released
nearly 4 years ago.
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Shin'ichiro Kawasaki [Thu, 9 Feb 2023 07:09:07 +0000 (16:09 +0900)]
t/zbd: add test cases for zone_reset_threshold option
The zone_reset_threshold option works for multiple jobs only when the
jobs have same write range. Add three test cases to confirm that the
option works for multiple jobs as expected. The first test case checks
that different write ranges are reported as an error. The second test
case checks that multiple write jobs work when they have same write
range. The third test case checks that a read job and a write job work
when they have different IO ranges.
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Shin'ichiro Kawasaki [Thu, 9 Feb 2023 07:09:06 +0000 (16:09 +0900)]
zbd: initialize valid data bytes accounting at file setup
The valid data bytes accounting field is initialized at file reset,
after each job started. Each job locks zones to check write pointer
positions of its write target zones. This can cause zone lock contention
with write by other jobs.
To avoid the zone lock contention, move the initialization from file
reset to file setup before job start. It allows to access the write
pointers and the accounting field without locks. Remove the lock and
unlock codes which are no longer required. Ensure the locks are not
required by checking run-state in the struct thread_data. Also rename
the function zbd_set_vdb() to zbd_verify_and_set_vdb() to be consistent
with other functions called in zbd_setup_files().
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Shin'ichiro Kawasaki [Thu, 9 Feb 2023 07:09:05 +0000 (16:09 +0900)]
zbd: check write ranges for zone_reset_threshold option
The valid data bytes accounting is used for zone_reset_threshold option.
This accounting usage has two issues. The first issue is unexpected
zone reset due to different IO ranges. The valid data bytes accounting
is done for all IO ranges per device, and shared by all jobs. On the
other hand, the zone_reset_threshold option is defined as the ratio to
each job's IO range. When a job refers to the accounting value, it
includes writes to IO ranges out of the job's IO range. Then zone reset
is triggered earlier than expected.
The second issue is accounting value initialization. The initialization
of the accounting field is repeated for each job, then the value
initialized by the first job is overwritten by other jobs. This works as
expected for single job or multiple jobs with same write range. However,
when multiple jobs have different write ranges, the overwritten value is
wrong except for the last job.
To ensure that the accounting works as expected for the option, check
that write ranges of all jobs are same. If jobs have different write
ranges, report it as an error. Initialize the accounting field only once
for the first job. All jobs have same write range, then one time
initialization is enough. Update man page to clarify this limitation of
the option.
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Shin'ichiro Kawasaki [Thu, 9 Feb 2023 07:09:04 +0000 (16:09 +0900)]
zbd: account valid data bytes only for zone_reset_threshold option
The valid data bytes accounting is used only for zone_reset_threshold
option. Avoid the accounting when the option is not specified.
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Shin'ichiro Kawasaki [Thu, 9 Feb 2023 07:09:03 +0000 (16:09 +0900)]
doc: fix unit of zone_reset_threshold and relation to other option
The zone_reset_threshold option uses the 'sectors with data' accounting
then it was described to have 'logical block' as its unit. However, the
accounting was implemented with 'byte' unit. Fix the description of the
option.
Also, the zone_reset_threshold option works together with the
zone_reset_frequency option. Describe this relation also.
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Shin'ichiro Kawasaki [Thu, 9 Feb 2023 07:09:02 +0000 (16:09 +0900)]
zbd: rename the accounting 'sectors with data' to 'valid data bytes'
The 'sectors with data' accounting was designed to have 'sector' as its
unit. Then related variables have the word 'sector' in their names. Also
related code comments use the words 'sector' or 'logical blocks'.
However, actually it was implemented to have 'byte' as unit. Rename
related variables and comments to indicate the byte unit. Also replace
the abbreviation swd to vdb.
Fixes:
a7c2b6fc2959 ("Add support for resetting zones periodically")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Shin'ichiro Kawasaki [Thu, 9 Feb 2023 07:09:01 +0000 (16:09 +0900)]
zbd: remove CHECK_SWD feature
The 'sectors with data' accounting had been used for CHECK_SWD debug
feature. It compared expected written data size and actually written
data size for zonemode=zbd. However, this feature has been disabled for
a while and not actively used. Also, the sector with data accounting has
two issues. The first issue is wrong accounting for multiple jobs with
different write ranges. The second issue is job start up failure due to
zone lock contention.
Avoid using the accounting by removing the CHECK_SWD feature and related
code. Also rename the function zbd_process_swd() to zbd_set_swd() to
clarify that it no longer works for CHECK_SWD.
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Shin'ichiro Kawasaki [Thu, 9 Feb 2023 07:09:00 +0000 (16:09 +0900)]
zbd: refer file->last_start[] instead of sectors with data accounting
To decide the first IO direction of randrw workload, the function
zbd_adjust_ddir() refers to the zbd_info->sectors_with_data value which
indicates the number of bytes written to the zoned block devices being
accessed. However, this accounting has two issues. The first issue is
wrong accounting for multiple jobs with different write ranges. The
second issue is job start up failure due to zone lock contention.
Avoid using zbd_info->sectors_with_data and simply refer to file->
last_start[DDIR_WRITE] instead. It is initialized with -1ULL for each
job. After any write operation is done by the job, it keeps valid
offset. If it has valid offset, written data is expected and the first
IO direction can be read.
Also remove zbd_info->sectors_with_data, which is no longer used. Keep
the field zbd_info->wp_sectors_with_data since it is still used for
zones with write pointers.
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Horshack [Fri, 10 Feb 2023 02:47:38 +0000 (21:47 -0500)]
Read stats for backlog verifies not reported for time-expired workloads
When verify_backlog is used on a write-only workload with a runtime= value
and the runtime expires before the workload has written its full dataset,
the read stats for the backlog verifies are not reported, resulting in a
stat result showing only the workload writes (ie, the "read:" results
section is completely missing from fio's stats output)
The logic in thread_main() fails to call update_runtime() for DDIR_READ
because the existing call to update_runtime() for DDIR_READ on write-only
workloads is currently only done after do_verify() is complete, which wont
be called in this scenario because td->terminate is true due to the
expiration of the runtime.
Link: https://github.com/axboe/fio/issues/1515
Signed-off-by: Adam Horshack (horshack@live.com)
Vincent Fu [Fri, 10 Feb 2023 16:49:46 +0000 (11:49 -0500)]
Merge branch 'msg-Modify_QD_Sync_Warning_For_offload' of https://github.com/horshack-dpreview/fio
* 'msg-Modify_QD_Sync_Warning_For_offload' of https://github.com/horshack-dpreview/fio:
Suppress sync engine QD > 1 warning if io_submit_mode is offload
Horshack [Thu, 9 Feb 2023 16:31:55 +0000 (11:31 -0500)]
Suppress sync engine QD > 1 warning if io_submit_mode is offload
The user is warned if iodepth > 1 when using a synchronous I/O engine,
since the engine can only submit one I/O at a time. This warning is not
accounting for the case of the user enabling I/O submission offload
threads via io_submit_mode=offload. Modified the warning conditional to
suppress the warning when this is the case.
Signed-off-by: Adam Horshack (horshack@live.com)
Jens Axboe [Thu, 9 Feb 2023 16:34:32 +0000 (09:34 -0700)]
Merge branch 'Offload_Segfault_Write_Log' of https://github.com/horshack-dpreview/fio
* 'Offload_Segfault_Write_Log' of https://github.com/horshack-dpreview/fio:
SIGSEGV / Exit 139 when write_iolog used with io_submit_mode=offload
Horshack [Thu, 9 Feb 2023 16:03:12 +0000 (11:03 -0500)]
SIGSEGV / Exit 139 when write_iolog used with io_submit_mode=offload
Segmentation fault when log_io_u() attempts to write an entry to a
user-specified write_iolog file, if the I/O is issued from an offload
thread created by io_submit_mode=offload. Call path:
rate-submit.c::io_workqueue_fn() -> td_io_queue() -> log_io_u(td, io_u)
The log file handle in thread_data->iolog_f opened by init_iolog() is not
being copied to the offload thread's private copy of thread_data, causing a
NULL deference when fprintf() is called to write to the log file.
Fix is to copy the main thread's td->iolog_f to the offload thread's td at
creation time. Seems a bit disjointed to be copying individual fields between
these two structures on an as-needed basis rather than having a mechanism to
replicate the entire structure, or at least replicating the I/O submission
specific fields by moving them into a nested structure that's copied wholesale
in io_workqueue_init_worker_fn() - that way future code changes to the I/O
submission path wont cause the same bug for fields needed by both the inline
and offline submission paths.
Signed-off-by: Adam Horshack (horshack@live.com)
Vincent Fu [Tue, 7 Feb 2023 15:44:00 +0000 (10:44 -0500)]
ioengines: clarify FIO_RO_NEEDS_RW_OPEN flag
This flag is only checked in generic_open_file(). So ioengines with the
own open file routines that do not call generic_open_file() will be
unaffected.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Tue, 7 Feb 2023 14:37:29 +0000 (09:37 -0500)]
engines/libzbc: for read workloads always open devices with O_RDONLY flag
libzbc uses the SG_IO ioctl to send commands to devices (instead of
using write() to send commands to character devices). So we don't need
to open character devices with the O_RDWR flag.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Tue, 7 Feb 2023 14:33:55 +0000 (09:33 -0500)]
Revert "engines/libzbc: set FIO_RO_NEEDS_RW_OPEN engine flag"
This reverts commit
6d7f8d9a31f9ecdeab0eed8f23c63b9a94ec61f6.
The FIO_RO_NEEDS_RW_OPEN file affects only generic_open_file but the
libzbc ioengine has its own file open routine. So the flag has no effect
and its presence may be misleading.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Jens Axboe [Mon, 6 Feb 2023 19:36:37 +0000 (12:36 -0700)]
engines/libzbc: set FIO_RO_NEEDS_RW_OPEN engine flag
The libzbc engine also needs a writeable open, even for a read-only
workload.
Fixes:
d72b10e3ca2f ("fio: add FIO_RO_NEEDS_RW_OPEN ioengine flag")
Reported-by: Kanchan Joshi <joshi.k@samsung.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Jens Axboe [Mon, 6 Feb 2023 16:53:16 +0000 (09:53 -0700)]
Merge branch 'perf-Avoid_Clock_Check_For_No_Rate_Check' of https://github.com/horshack-dpreview/fio
* 'perf-Avoid_Clock_Check_For_No_Rate_Check' of https://github.com/horshack-dpreview/fio:
Improve IOPs 50% by avoiding clock sampling when rate options not used
Horshack [Mon, 6 Feb 2023 02:17:31 +0000 (21:17 -0500)]
Improve IOPs 50% by avoiding clock sampling when rate options not used
Profiling revealed thread_main() is spending 50% of its time in calls to
utime_since_now() from rate_ddir(). This call is only necessary if the user
specified a rate option for the job. A conditional was added to avoid the call
if !should_check_rate(). See this link for details and profiling data:
https://github.com/axboe/fio/issues/1501#issuecomment-
1418327049
Signed-off-by: Adam Horshack (horshack@live.com)
Vincent Fu [Fri, 3 Feb 2023 14:54:50 +0000 (09:54 -0500)]
fio: add FIO_RO_NEEDS_RW_OPEN ioengine flag
Some oddball cases like sg/bsg require devices to be opened for writing
in order to do read commands. So fio has been opening character devices
in rw mode for read workloads. However, nvme generic character devices
do not need (and may refuse) a writeable open for read workloads. So
instead of always opening character devices in rw mode, open devices in
rw mode for read workloads only if the ioengine has the
FIO_RO_NEEDS_RW_OPEN flag.
Link: https://lore.kernel.org/fio/20230203123421.126720-1-joshi.k@samsung.com/
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Fri, 3 Feb 2023 17:06:32 +0000 (12:06 -0500)]
Merge branch 'master' of https://github.com/horshack-dpreview/fio
* 'master' of https://github.com/horshack-dpreview/fio:
Add -replay_skip support for fio-generated I/O logs
Horshack [Thu, 2 Feb 2023 16:37:01 +0000 (11:37 -0500)]
Add -replay_skip support for fio-generated I/O logs
-replay_skip is an existing option to specify classes of I/Os to skip
(read, write, etc..) when replaying I/Os via the -read_iolog option.
The code currently only implements -replay_skip for blktrace I/O logs.
This pull request adds -replay_skip support for logs generated by fio
via the -write_iolog feature.
Signed-off-by: Adam Horshack (horshack@live.com)
Vincent Fu [Tue, 31 Jan 2023 15:44:54 +0000 (10:44 -0500)]
lib/pattern: fix formatting
The fix I committed was not formatted nicely. Make the code look nicer.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Tue, 31 Jan 2023 15:43:13 +0000 (10:43 -0500)]
test: add test for lib/pattern segfault issue
Add t/jobs/t0028-
c6cade16.fio to test the ability for the routines in
lib/pattern.c to parse multi-part buffer patterns.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Mon, 30 Jan 2023 15:37:48 +0000 (10:37 -0500)]
lib/pattern: Fix seg fault when calculating pattern length
When --buffer_pattern or --verify_pattern has multiple elements
(0x110x22 or 0xdeadface"abcd"-12'filename') calculating the length
produces a segmentation fault in parse_and_fill_pattern() because it
increments out when out is passed to the parse_* routines it calls.
This patch uses the fix provided in the GitHub issue.
Fixes: https://github.com/axboe/fio/issues/1500
Fixes:
6c9397396eb83a6ce64a998795e7a50552e4337e "lib/pattern: Support
NULL output buffer in parse_and_fill_pattern()"
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Jens Axboe [Wed, 25 Jan 2023 15:01:30 +0000 (08:01 -0700)]
Enable crc32c accelleration for arm64 on OSX
Before:
jensaxboe@Jenss-MacBook-Pro fio % ./fio --crctest=crc32c
crc32c: 440.18 MiB/sec
After:
ensaxboe@Jenss-MacBook-Pro fio % ./fio --crctest=crc32c
crc32c: 23923.00 MiB/sec
We know we have it on osx on arm hardware, enabling it is pretty
straightforward with that assumption.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Jens Axboe [Wed, 25 Jan 2023 03:54:48 +0000 (20:54 -0700)]
Makefile: add -Wno-stringop-truncation for y.tab.o
This file is auto-generated, and it currently spews the following
warning for me:
In function ‘setup_to_parse_string’,
inlined from ‘evaluate_arithmetic_expression’ at y.tab.c:1571:2:
y.tab.c:1559:9: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-truncation]
1559 | strncpy(lexer_input_buffer, string, len);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
y.tab.c:1556:19: note: length computed here
1556 | if (len > strlen(string))
| ^~~~~~~~~~~~~~
when compiled with:
gcc (Debian 12.2.0-14) 12.2.0
Just set -Wno-stringop-truncation unconditionally in the Makefile for
this file, don't think there's any point in checking if this warning
has been enabled manually.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Vincent Fu [Thu, 19 Jan 2023 00:58:08 +0000 (19:58 -0500)]
tools/fiograph: accommodate job files not ending in .fio
For job files not ending in .fio, fiograph will overwrite the job file
with a graphviz script and then delete it if --keep is not specified.
Fix this by creating temporary files to contain the graphviz script and
image file. Then rename or delete the script and image file as directed
by the user specified options.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Thu, 19 Jan 2023 18:10:22 +0000 (13:10 -0500)]
examples: remove test.png
test.png doesn't correspond to any example job files. It seems to have
been inadvertantly added to the repository.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Wed, 18 Jan 2023 16:14:14 +0000 (11:14 -0500)]
tools/fiograph: improve default config file search
When a config file is not explicitly specified the current default is to
search for fiograph.conf only in the current directory. Change this to
try to use fiograph.conf in the directory where fiograph.py is located
when fiograph.conf is not found in the current directory.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Vincent Fu [Wed, 18 Jan 2023 15:52:31 +0000 (10:52 -0500)]
tools/fiograph: improve default output file name
Instead of removing all occurrences of '.fio' in the job filename, only
remove '.fio' when it is at the end of the job filename.
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>