Recent changes (master)

Jens Axboe
2020-01-29T13:00:03Z

The following changes since commit 8178434ccba8e2d06684ce0c730b0eda571c5280:

Merge branch 'filestat1' of https://github.com/kusumi/fio (2020-01-23 11:35:23 -0700)

are available in the Git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to ab45cf076766ce1ed49d28380c059343305cde4a:

Merge branch 'stat-averaging-interval-start-fix' of https://github.com/maciejsszmigiero/fio (2020-01-28 14:15:35 -0700)

----------------------------------------------------------------
Jens Axboe (3):
Merge branch 'no_cpu_clock_no_tls_thread' of https://github.com/bsdkurt/fio
Merge branch 'openbsd_swap' of https://github.com/bsdkurt/fio
Merge branch 'stat-averaging-interval-start-fix' of https://github.com/maciejsszmigiero/fio

Kurt Miller (2):
Fix build on architectures that don't have both cpu clock and __thread support.
Use swap16/32/64 on OpenBSD.

Maciej S. Szmigiero (1):
stat: fix calculation of bw and iops statistics based on samples

gettime.c | 4 ++--
os/os-openbsd.h | 6 +++---
stat.c | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)

---

Diff of recent changes:

diff --git a/gettime.c b/gettime.c
index 272a3e62..c3a4966b 100644
--- a/gettime.c
+++ b/gettime.c
@@ -371,7 +371,7 @@ static int calibrate_cpu_clock(void)
}
#endif // ARCH_HAVE_CPU_CLOCK

-#ifndef CONFIG_TLS_THREAD
+#if defined(ARCH_HAVE_CPU_CLOCK) && !defined(CONFIG_TLS_THREAD)
void fio_local_clock_init(void)
{
struct tv_valid *t;
@@ -398,7 +398,7 @@ void fio_clock_init(void)
if (fio_clock_source == fio_clock_source_inited)
return;

-#ifndef CONFIG_TLS_THREAD
+#if defined(ARCH_HAVE_CPU_CLOCK) && !defined(CONFIG_TLS_THREAD)
if (pthread_key_create(&tv_tls_key, kill_tv_tls_key))
log_err("fio: can't create TLS key\n");
#endif
diff --git a/os/os-openbsd.h b/os/os-openbsd.h
index 085a6f2b..994bf078 100644
--- a/os/os-openbsd.h
+++ b/os/os-openbsd.h
@@ -31,9 +31,9 @@
#define PTHREAD_STACK_MIN 4096
#endif

-#define fio_swap16(x) bswap16(x)
-#define fio_swap32(x) bswap32(x)
-#define fio_swap64(x) bswap64(x)
+#define fio_swap16(x) swap16(x)
+#define fio_swap32(x) swap32(x)
+#define fio_swap64(x) swap64(x)

static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
{
diff --git a/stat.c b/stat.c
index 9d93dcd1..cc1c360e 100644
--- a/stat.c
+++ b/stat.c
@@ -3106,7 +3106,7 @@ static int __add_samples(struct thread_data *td, struct timespec *parent_tv,
stat_io_bytes[ddir] = this_io_bytes[ddir];
}

- timespec_add_msec(parent_tv, avg_time);
+ *parent_tv = *t;

if (needs_lock)
__td_io_u_unlock(td);