The following changes since commit ecc35cf45f60e658856c6f0cbd5b7785753981bb: Merge branch 'master' of ssh://brick.kernel.dk/data/git/fio (2012-02-06 22:00:06 +0100) are available in the git repository at: git://git.kernel.dk/fio.git master Jens Axboe (6): mac: remove unused timer_create() Merge branch 'master' of ssh://brick.kernel.dk/data/git/fio Add regression test job file for commit 52c58027 Fio 2.0.3 stat: NaN fixes stat: fix typo Steven Lang (2): Optimize pattern verify Enable completion latency stat collection on verify fio_version.h | 2 +- io_u.c | 3 ++- options.c | 8 ++++++++ os/os-mac.h | 14 ++------------ os/windows/install.wxs | 2 +- os/windows/version.h | 2 +- stat.c | 19 +++++++++++++------ t/jobs/t0001-52c58027 | 6 ++++++ verify.c | 19 ++++++++++++++++--- 9 files changed, 50 insertions(+), 25 deletions(-) create mode 100644 t/jobs/t0001-52c58027 --- Diff of recent changes: diff --git a/fio_version.h b/fio_version.h index 36a72d3..c6783d7 100644 --- a/fio_version.h +++ b/fio_version.h @@ -3,6 +3,6 @@ #define FIO_MAJOR 2 #define FIO_MINOR 0 -#define FIO_PATCH 2 +#define FIO_PATCH 3 #endif diff --git a/io_u.c b/io_u.c index 8a03348..d794f01 100644 --- a/io_u.c +++ b/io_u.c @@ -1375,7 +1375,8 @@ static void io_completed(struct thread_data *td, struct io_u *io_u, } } - if (ramp_time_over(td) && td->runstate == TD_RUNNING) { + if (ramp_time_over(td) && (td->runstate == TD_RUNNING || + td->runstate == TD_VERIFYING)) { account_io_completion(td, io_u, icd, idx, bytes); if (__should_check_rate(td, idx)) { diff --git a/options.c b/options.c index 8fb93ca..c3fdb56 100644 --- a/options.c +++ b/options.c @@ -698,6 +698,14 @@ static int str_verify_pattern_cb(void *data, const char *input) memcpy(&td->o.verify_pattern[i], &td->o.verify_pattern[0], i); i *= 2; } + if (i == 1) { + /* + * The code in verify_io_u_pattern assumes a single byte pattern + * fills the whole verify pattern buffer. + */ + memset(td->o.verify_pattern, td->o.verify_pattern[0], + MAX_PATTERN_SIZE); + } td->o.verify_pattern_bytes = i; diff --git a/os/os-mac.h b/os/os-mac.h index 9f19b8a..aec30f9 100644 --- a/os/os-mac.h +++ b/os/os-mac.h @@ -69,17 +69,6 @@ struct itimerspec { static struct sigevent fio_timers[MAX_TIMERS]; static unsigned int num_timers = 0; -static inline int timer_create(clockid_t clockid, struct sigevent *restrict evp, - timer_t *restrict timerid) -{ - int current_timer = num_timers; - fio_timers[current_timer] = *evp; - num_timers++; - - *timerid = current_timer; - return 0; -} - static void sig_alrm(int signum) { union sigval sv; @@ -96,7 +85,8 @@ static void sig_alrm(int signum) } static inline int timer_settime(timer_t timerid, int flags, - const struct itimerspec *value, struct itimerspec *ovalue) + const struct itimerspec *value, + struct itimerspec *ovalue) { struct sigaction sa; struct itimerval tv; diff --git a/os/windows/install.wxs b/os/windows/install.wxs index 5e703be..b853e4b 100755 --- a/os/windows/install.wxs +++ b/os/windows/install.wxs @@ -3,7 +3,7 @@ <?define VersionMajor = 2?> <?define VersionMinor = 0?> -<?define VersionBuild = 2?> +<?define VersionBuild = 3?> <Product Id="*" Codepage="1252" Language="1033" diff --git a/os/windows/version.h b/os/windows/version.h index 545ff5e..192e391 100644 --- a/os/windows/version.h +++ b/os/windows/version.h @@ -3,4 +3,4 @@ #define FIO_VERSION_MAJOR FIO_MAJOR #define FIO_VERSION_MINOR FIO_MINOR #define FIO_VERSION_BUILD FIO_PATCH -#define FIO_VERSION_STRING "2.0.2" +#define FIO_VERSION_STRING "2.0.3" diff --git a/stat.c b/stat.c index 851cc2c..7e3b979 100644 --- a/stat.c +++ b/stat.c @@ -440,12 +440,14 @@ static void show_ddir_status(struct group_run_stats *rs, struct thread_stat *ts, ts->percentile_list); } if (calc_lat(&ts->bw_stat[ddir], &min, &max, &mean, &dev)) { - double p_of_agg; + double p_of_agg = 100.0; const char *bw_str = "KB"; - p_of_agg = mean * 100 / (double) rs->agg[ddir]; - if (p_of_agg > 100.0) - p_of_agg = 100.0; + if (rs->agg[ddir]) { + p_of_agg = mean * 100 / (double) rs->agg[ddir]; + if (p_of_agg > 100.0) + p_of_agg = 100.0; + } if (mean > 999999.9) { min /= 1000.0; @@ -653,9 +655,14 @@ static void show_ddir_status_terse(struct thread_stat *ts, free(ovals); if (calc_lat(&ts->bw_stat[ddir], &min, &max, &mean, &dev)) { - double p_of_agg; + double p_of_agg = 100.0; + + if (rs->agg[ddir]) { + p_of_agg = mean * 100 / (double) rs->agg[ddir]; + if (p_of_agg > 100.0) + p_of_agg = 100.0; + } - p_of_agg = mean * 100 / (double) rs->agg[ddir]; log_info(";%lu;%lu;%f%%;%f;%f", min, max, p_of_agg, mean, dev); } else log_info(";%lu;%lu;%f%%;%f;%f", 0UL, 0UL, 0.0, 0.0, 0.0); diff --git a/t/jobs/t0001-52c58027 b/t/jobs/t0001-52c58027 new file mode 100644 index 0000000..49b7d11 --- /dev/null +++ b/t/jobs/t0001-52c58027 @@ -0,0 +1,6 @@ +#Commit 52c580272d87d2b9b8a65d317bf7c2d432a30fec +[foo] +size=20000 +bsrange=1k-4k +rw=randread +ioengine=null diff --git a/verify.c b/verify.c index 9ee3bc4..eb8eddc 100644 --- a/verify.c +++ b/verify.c @@ -322,14 +322,27 @@ static int verify_io_u_pattern(struct verify_header *hdr, struct vcont *vc) struct io_u *io_u = vc->io_u; char *buf, *pattern; unsigned int header_size = __hdr_size(td->o.verify); - unsigned int len, mod, i; + unsigned int len, mod, i, size, pattern_size; pattern = td->o.verify_pattern; + pattern_size = td->o.verify_pattern_bytes; + if (pattern_size <= 1) + pattern_size = MAX_PATTERN_SIZE; buf = (void *) hdr + header_size; len = get_hdr_inc(td, io_u) - header_size; - mod = header_size % td->o.verify_pattern_bytes; + mod = header_size % pattern_size; + + for (i = 0; i < len; i += size) { + size = pattern_size - mod; + if (size > (len - i)) + size = len - i; + if (memcmp(buf + i, pattern + mod, size)) + // Let the slow compare find the first mismatch byte. + break; + mod = 0; + } - for (i = 0; i < len; i++) { + for (; i < len; i++) { if (buf[i] != pattern[mod]) { unsigned int bits; -- To unsubscribe from this list: send the line "unsubscribe fio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html