Merge branch 'no-unittest-dep' of https://github.com/parallel-fs-utils/fio
authorJens Axboe <axboe@kernel.dk>
Mon, 10 Sep 2018 15:56:11 +0000 (09:56 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 10 Sep 2018 15:56:11 +0000 (09:56 -0600)
* 'no-unittest-dep' of https://github.com/parallel-fs-utils/fio:
  remove dependency on unittest2 module

25 files changed:
Makefile
backend.c
client.c
client.h
configure
engines/fusion-aw.c [deleted file]
examples/fio-rand-RW.fio [new file with mode: 0644]
examples/fio-rand-RW.job [deleted file]
examples/fio-rand-read.fio [new file with mode: 0644]
examples/fio-rand-read.job [deleted file]
examples/fio-rand-write.fio [new file with mode: 0644]
examples/fio-rand-write.job [deleted file]
examples/fio-seq-RW.fio [new file with mode: 0644]
examples/fio-seq-RW.job [deleted file]
examples/fio-seq-read.fio [new file with mode: 0644]
examples/fio-seq-read.job [deleted file]
examples/fio-seq-write.fio [new file with mode: 0644]
examples/fio-seq-write.job [deleted file]
examples/fusion-aw-sync.fio [deleted file]
init.c
iolog.c
lib/num2str.c
options.c
os/windows/examples.wxs
stat.c

index 7e87b2f..42e5205 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -86,9 +86,6 @@ endif
 ifdef CONFIG_GUASI
   SOURCE += engines/guasi.c
 endif
-ifdef CONFIG_FUSION_AW
-  SOURCE += engines/fusion-aw.c
-endif
 ifdef CONFIG_SOLARISAIO
   SOURCE += engines/solarisaio.c
 endif
index 8fec1ce..bb8bd13 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -2213,18 +2213,22 @@ static void run_threads(struct sk_out *sk_out)
        }
 
        if (output_format & FIO_OUTPUT_NORMAL) {
-               log_info("Starting ");
+               struct buf_output out;
+
+               buf_output_init(&out);
+               __log_buf(&out, "Starting ");
                if (nr_thread)
-                       log_info("%d thread%s", nr_thread,
+                       __log_buf(&out, "%d thread%s", nr_thread,
                                                nr_thread > 1 ? "s" : "");
                if (nr_process) {
                        if (nr_thread)
-                               log_info(" and ");
-                       log_info("%d process%s", nr_process,
+                               __log_buf(&out, " and ");
+                       __log_buf(&out, "%d process%s", nr_process,
                                                nr_process > 1 ? "es" : "");
                }
-               log_info("\n");
-               log_info_flush();
+               __log_buf(&out, "\n");
+               log_info_buf(out.buf, out.buflen);
+               buf_output_free(&out);
        }
 
        todo = thread_number;
index 31c7c64..3248906 100644 (file)
--- a/client.c
+++ b/client.c
@@ -198,14 +198,23 @@ static void fio_client_json_init(void)
 
 static void fio_client_json_fini(void)
 {
-       if (!(output_format & FIO_OUTPUT_JSON))
+       struct buf_output out;
+
+       if (!root)
                return;
 
-       log_info("\n");
-       json_print_object(root, NULL);
-       log_info("\n");
+       buf_output_init(&out);
+
+       __log_buf(&out, "\n");
+       json_print_object(root, &out);
+       __log_buf(&out, "\n");
+       log_info_buf(out.buf, out.buflen);
+
+       buf_output_free(&out);
+
        json_free_object(root);
        root = NULL;
+       job_opt_object = NULL;
        clients_array = NULL;
        du_array = NULL;
 }
@@ -233,6 +242,9 @@ void fio_put_client(struct fio_client *client)
        if (--client->refs)
                return;
 
+       log_info_buf(client->buf.buf, client->buf.buflen);
+       buf_output_free(&client->buf);
+
        free(client->hostname);
        if (client->argv)
                free(client->argv);
@@ -351,9 +363,7 @@ void fio_client_add_cmd_option(void *cookie, const char *opt)
        }
 }
 
-struct fio_client *fio_client_add_explicit(struct client_ops *ops,
-                                          const char *hostname, int type,
-                                          int port)
+static struct fio_client *get_new_client(void)
 {
        struct fio_client *client;
 
@@ -366,6 +376,19 @@ struct fio_client *fio_client_add_explicit(struct client_ops *ops,
        INIT_FLIST_HEAD(&client->eta_list);
        INIT_FLIST_HEAD(&client->cmd_list);
 
+       buf_output_init(&client->buf);
+
+       return client;
+}
+
+struct fio_client *fio_client_add_explicit(struct client_ops *ops,
+                                          const char *hostname, int type,
+                                          int port)
+{
+       struct fio_client *client;
+
+       client = get_new_client();
+
        client->hostname = strdup(hostname);
 
        if (type == Fio_client_socket)
@@ -441,14 +464,7 @@ int fio_client_add(struct client_ops *ops, const char *hostname, void **cookie)
                }
        }
 
-       client = malloc(sizeof(*client));
-       memset(client, 0, sizeof(*client));
-
-       INIT_FLIST_HEAD(&client->list);
-       INIT_FLIST_HEAD(&client->hash_list);
-       INIT_FLIST_HEAD(&client->arg_list);
-       INIT_FLIST_HEAD(&client->eta_list);
-       INIT_FLIST_HEAD(&client->cmd_list);
+       client = get_new_client();
 
        if (fio_server_parse_string(hostname, &client->hostname,
                                        &client->is_sock, &client->port,
@@ -1059,13 +1075,10 @@ static void handle_ts(struct fio_client *client, struct fio_net_cmd *cmd)
        struct flist_head *opt_list = NULL;
        struct json_object *tsobj;
 
-       if (output_format & FIO_OUTPUT_TERSE)
-               return;
-
        if (client->opt_lists && p->ts.thread_number <= client->jobs)
                opt_list = &client->opt_lists[p->ts.thread_number - 1];
 
-       tsobj = show_thread_status(&p->ts, &p->rs, opt_list, NULL);
+       tsobj = show_thread_status(&p->ts, &p->rs, opt_list, &client->buf);
        client->did_stat = true;
        if (tsobj) {
                json_object_add_client_info(tsobj, client);
@@ -1086,7 +1099,7 @@ static void handle_ts(struct fio_client *client, struct fio_net_cmd *cmd)
 
        if (++sum_stat_nr == sum_stat_clients) {
                strcpy(client_ts.name, "All clients");
-               tsobj = show_thread_status(&client_ts, &client_gs, NULL, NULL);
+               tsobj = show_thread_status(&client_ts, &client_gs, NULL, &client->buf);
                if (tsobj) {
                        json_object_add_client_info(tsobj, client);
                        json_array_add_value_object(clients_array, tsobj);
@@ -1098,11 +1111,8 @@ static void handle_gs(struct fio_client *client, struct fio_net_cmd *cmd)
 {
        struct group_run_stats *gs = (struct group_run_stats *) cmd->payload;
 
-       if (output_format & FIO_OUTPUT_TERSE)
-               return;
-
        if (output_format & FIO_OUTPUT_NORMAL)
-               show_group_stats(gs, NULL);
+               show_group_stats(gs, &client->buf);
 }
 
 static void handle_job_opt(struct fio_client *client, struct fio_net_cmd *cmd)
@@ -1144,13 +1154,17 @@ static void handle_text(struct fio_client *client, struct fio_net_cmd *cmd)
        const char *buf = (const char *) pdu->buf;
        const char *name;
        int fio_unused ret;
+       struct buf_output out;
+
+       buf_output_init(&out);
 
        name = client->name ? client->name : client->hostname;
 
        if (!client->skip_newline && !(output_format & FIO_OUTPUT_TERSE))
-               fprintf(f_out, "<%s> ", name);
-       ret = fwrite(buf, pdu->buf_len, 1, f_out);
-       fflush(f_out);
+               __log_buf(&out, "<%s> ", name);
+       __log_buf(&out, "%s", buf);
+       log_info_buf(out.buf, out.buflen);
+       buf_output_free(&out);
        client->skip_newline = strchr(buf, '\n') == NULL;
 }
 
@@ -1191,23 +1205,21 @@ static void handle_du(struct fio_client *client, struct fio_net_cmd *cmd)
 {
        struct cmd_du_pdu *du = (struct cmd_du_pdu *) cmd->payload;
 
-       if (output_format & FIO_OUTPUT_TERSE)
-               return;
-
-       if (!client->disk_stats_shown) {
+       if (!client->disk_stats_shown)
                client->disk_stats_shown = true;
-               if (!(output_format & FIO_OUTPUT_JSON))
-                       log_info("\nDisk stats (read/write):\n");
-       }
 
        if (output_format & FIO_OUTPUT_JSON) {
                struct json_object *duobj;
+
                json_array_add_disk_util(&du->dus, &du->agg, du_array);
                duobj = json_array_last_value_object(du_array);
                json_object_add_client_info(duobj, client);
+       } else if (output_format & FIO_OUTPUT_TERSE)
+               print_disk_util(&du->dus, &du->agg, 1, &client->buf);
+       else if (output_format & FIO_OUTPUT_NORMAL) {
+               __log_buf(&client->buf, "\nDisk stats (read/write):\n");
+               print_disk_util(&du->dus, &du->agg, 0, &client->buf);
        }
-       if (output_format & FIO_OUTPUT_NORMAL)
-               print_disk_util(&du->dus, &du->agg, 0, NULL);
 }
 
 static void convert_jobs_eta(struct jobs_eta *je)
@@ -1465,9 +1477,6 @@ static void handle_probe(struct fio_client *client, struct fio_net_cmd *cmd)
        const char *os, *arch;
        char bit[16];
 
-       if (output_format & FIO_OUTPUT_TERSE)
-               return;
-
        os = fio_get_os_string(probe->os);
        if (!os)
                os = "unknown";
@@ -1479,10 +1488,11 @@ static void handle_probe(struct fio_client *client, struct fio_net_cmd *cmd)
        sprintf(bit, "%d-bit", probe->bpp * 8);
        probe->flags = le64_to_cpu(probe->flags);
 
-       if (!(output_format & FIO_OUTPUT_JSON))
+       if (output_format & FIO_OUTPUT_NORMAL) {
                log_info("hostname=%s, be=%u, %s, os=%s, arch=%s, fio=%s, flags=%lx\n",
                        probe->hostname, probe->bigendian, bit, os, arch,
                        probe->fio_version, (unsigned long) probe->flags);
+       }
 
        if (!client->name)
                client->name = strdup((char *) probe->hostname);
index a597449..8033325 100644 (file)
--- a/client.h
+++ b/client.h
@@ -74,6 +74,8 @@ struct fio_client {
 
        struct client_file *files;
        unsigned int nr_files;
+
+       struct buf_output buf;
 };
 
 typedef void (client_cmd_op)(struct fio_client *, struct fio_net_cmd *);
index 5e11195..26c345b 100755 (executable)
--- a/configure
+++ b/configure
@@ -1148,28 +1148,6 @@ if compile_prog "" "" "guasi"; then
 fi
 print_config "GUASI" "$guasi"
 
-##########################################
-# fusion-aw probe
-if test "$fusion_aw" != "yes" ; then
-  fusion_aw="no"
-fi
-cat > $TMPC << EOF
-#include <nvm/nvm_primitives.h>
-int main(int argc, char **argv)
-{
-  nvm_version_t ver_info;
-  nvm_handle_t handle;
-
-  handle = nvm_get_handle(0, &ver_info);
-  return nvm_atomic_write(handle, 0, 0, 0);
-}
-EOF
-if compile_prog "" "-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread" "fusion-aw"; then
-  LIBS="-L/usr/lib/fio -L/usr/lib/nvm -lnvm-primitives -ldl -lpthread $LIBS"
-  fusion_aw="yes"
-fi
-print_config "Fusion-io atomic engine" "$fusion_aw"
-
 ##########################################
 # libnuma probe
 if test "$libnuma" != "yes" ; then
@@ -2405,9 +2383,6 @@ fi
 if test "$guasi" = "yes" ; then
   output_sym "CONFIG_GUASI"
 fi
-if test "$fusion_aw" = "yes" ; then
-  output_sym "CONFIG_FUSION_AW"
-fi
 if test "$libnuma_v2" = "yes" ; then
   output_sym "CONFIG_LIBNUMA"
 fi
diff --git a/engines/fusion-aw.c b/engines/fusion-aw.c
deleted file mode 100644 (file)
index eb5fdf5..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Custom fio(1) engine that submits synchronous atomic writes to file.
- *
- * Copyright (C) 2013 Fusion-io, Inc.
- * Author: Santhosh Kumar Koundinya (skoundinya@fusionio.com).
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; under version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License version
- * 2 for more details.
- *
- * You should have received a copy of the GNU General Public License Version 2
- * along with this program; if not see <http://www.gnu.org/licenses/>
- */
-
-#include <stdlib.h>
-#include <stdint.h>
-
-#include "../fio.h"
-
-#include <nvm/nvm_primitives.h>
-
-#define NUM_ATOMIC_CAPABILITIES (5)
-
-struct fas_data {
-       nvm_handle_t nvm_handle;
-       size_t xfer_buf_align;
-       size_t xfer_buflen_align;
-       size_t xfer_buflen_max;
-       size_t sector_size;
-};
-
-static enum fio_q_status queue(struct thread_data *td, struct io_u *io_u)
-{
-       struct fas_data *d = FILE_ENG_DATA(io_u->file);
-       int rc;
-
-       if (io_u->ddir != DDIR_WRITE) {
-               td_vmsg(td, EINVAL, "only writes supported", "io_u->ddir");
-               rc = -EINVAL;
-               goto out;
-       }
-
-       if ((size_t) io_u->xfer_buf % d->xfer_buf_align) {
-               td_vmsg(td, EINVAL, "unaligned data buffer", "io_u->xfer_buf");
-               rc = -EINVAL;
-               goto out;
-       }
-
-       if (io_u->xfer_buflen % d->xfer_buflen_align) {
-               td_vmsg(td, EINVAL, "unaligned data size", "io_u->xfer_buflen");
-               rc = -EINVAL;
-               goto out;
-       }
-
-       if (io_u->xfer_buflen > d->xfer_buflen_max) {
-               td_vmsg(td, EINVAL, "data too big", "io_u->xfer_buflen");
-               rc = -EINVAL;
-               goto out;
-       }
-
-       rc = nvm_atomic_write(d->nvm_handle, (uint64_t) io_u->xfer_buf,
-               io_u->xfer_buflen, io_u->offset / d->sector_size);
-       if (rc == -1) {
-               td_verror(td, errno, "nvm_atomic_write");
-               rc = -errno;
-               goto out;
-       }
-       rc = FIO_Q_COMPLETED;
-out:
-       if (rc < 0)
-               io_u->error = -rc;
-
-       return rc;
-}
-
-static int open_file(struct thread_data *td, struct fio_file *f)
-{
-       int rc;
-       int fio_unused close_file_rc;
-       struct fas_data *d;
-       nvm_version_t nvm_version;
-       nvm_capability_t nvm_capability[NUM_ATOMIC_CAPABILITIES];
-
-
-       d = malloc(sizeof(*d));
-       if (!d) {
-               td_verror(td, ENOMEM, "malloc");
-               rc = ENOMEM;
-               goto error;
-       }
-       d->nvm_handle = -1;
-       FILE_SET_ENG_DATA(f, d);
-
-       rc = generic_open_file(td, f);
-
-       if (rc)
-               goto free_engine_data;
-
-       /* Set the version of the library as seen when engine is compiled */
-       nvm_version.major = NVM_PRIMITIVES_API_MAJOR;
-       nvm_version.minor = NVM_PRIMITIVES_API_MINOR;
-       nvm_version.micro = NVM_PRIMITIVES_API_MICRO;
-
-       d->nvm_handle = nvm_get_handle(f->fd, &nvm_version);
-       if (d->nvm_handle == -1) {
-               td_vmsg(td, errno, "nvm_get_handle failed", "nvm_get_handle");
-               rc = errno;
-               goto close_file;
-       }
-
-       nvm_capability[0].cap_id = NVM_CAP_ATOMIC_WRITE_START_ALIGN_ID;
-       nvm_capability[1].cap_id = NVM_CAP_ATOMIC_WRITE_MULTIPLICITY_ID;
-       nvm_capability[2].cap_id = NVM_CAP_ATOMIC_WRITE_MAX_VECTOR_SIZE_ID;
-       nvm_capability[3].cap_id = NVM_CAP_SECTOR_SIZE_ID;
-       nvm_capability[4].cap_id = NVM_CAP_ATOMIC_MAX_IOV_ID;
-       rc = nvm_get_capabilities(d->nvm_handle, nvm_capability,
-                                  NUM_ATOMIC_CAPABILITIES, false);
-       if (rc == -1) {
-               td_vmsg(td, errno, "error in getting atomic write capabilities", "nvm_get_capabilities");
-               rc = errno;
-               goto close_file;
-       } else if (rc < NUM_ATOMIC_CAPABILITIES) {
-               td_vmsg(td, EINVAL, "couldn't get all the atomic write capabilities" , "nvm_get_capabilities");
-               rc = ECANCELED;
-               goto close_file;
-       }
-       /* Reset rc to 0 because we got all capabilities we needed */
-       rc = 0;
-       d->xfer_buf_align = nvm_capability[0].cap_value;
-       d->xfer_buflen_align = nvm_capability[1].cap_value;
-       d->xfer_buflen_max = d->xfer_buflen_align * nvm_capability[2].cap_value * nvm_capability[4].cap_value;
-       d->sector_size = nvm_capability[3].cap_value;
-
-out:
-       return rc;
-close_file:
-       close_file_rc = generic_close_file(td, f);
-free_engine_data:
-       free(d);
-error:
-       f->fd = -1;
-       FILE_SET_ENG_DATA(f, NULL);
-       goto out;
-}
-
-static int close_file(struct thread_data *td, struct fio_file *f)
-{
-       struct fas_data *d = FILE_ENG_DATA(f);
-
-       if (d) {
-               if (d->nvm_handle != -1)
-                       nvm_release_handle(d->nvm_handle);
-               free(d);
-               FILE_SET_ENG_DATA(f, NULL);
-       }
-
-       return generic_close_file(td, f);
-}
-
-static struct ioengine_ops ioengine = {
-       .name = "fusion-aw-sync",
-       .version = FIO_IOOPS_VERSION,
-       .queue = queue,
-       .open_file = open_file,
-       .close_file = close_file,
-       .get_file_size = generic_get_file_size,
-       .flags = FIO_SYNCIO | FIO_RAWIO | FIO_MEMALIGN
-};
-
-static void fio_init fio_fusion_aw_init(void)
-{
-       register_ioengine(&ioengine);
-}
-
-static void fio_exit fio_fusion_aw_exit(void)
-{
-       unregister_ioengine(&ioengine);
-}
diff --git a/examples/fio-rand-RW.fio b/examples/fio-rand-RW.fio
new file mode 100644 (file)
index 0000000..0df0bc1
--- /dev/null
@@ -0,0 +1,18 @@
+; fio-rand-RW.job for fiotest
+
+[global]
+name=fio-rand-RW
+filename=fio-rand-RW
+rw=randrw
+rwmixread=60
+rwmixwrite=40
+bs=4K
+direct=0
+numjobs=4
+time_based=1
+runtime=900
+
+[file1]
+size=10G
+ioengine=libaio
+iodepth=16
diff --git a/examples/fio-rand-RW.job b/examples/fio-rand-RW.job
deleted file mode 100644 (file)
index 0df0bc1..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-; fio-rand-RW.job for fiotest
-
-[global]
-name=fio-rand-RW
-filename=fio-rand-RW
-rw=randrw
-rwmixread=60
-rwmixwrite=40
-bs=4K
-direct=0
-numjobs=4
-time_based=1
-runtime=900
-
-[file1]
-size=10G
-ioengine=libaio
-iodepth=16
diff --git a/examples/fio-rand-read.fio b/examples/fio-rand-read.fio
new file mode 100644 (file)
index 0000000..bc15466
--- /dev/null
@@ -0,0 +1,16 @@
+; fio-rand-read.job for fiotest
+
+[global]
+name=fio-rand-read
+filename=fio-rand-read
+rw=randread
+bs=4K
+direct=0
+numjobs=1
+time_based=1
+runtime=900
+
+[file1]
+size=10G
+ioengine=libaio
+iodepth=16
diff --git a/examples/fio-rand-read.job b/examples/fio-rand-read.job
deleted file mode 100644 (file)
index bc15466..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-; fio-rand-read.job for fiotest
-
-[global]
-name=fio-rand-read
-filename=fio-rand-read
-rw=randread
-bs=4K
-direct=0
-numjobs=1
-time_based=1
-runtime=900
-
-[file1]
-size=10G
-ioengine=libaio
-iodepth=16
diff --git a/examples/fio-rand-write.fio b/examples/fio-rand-write.fio
new file mode 100644 (file)
index 0000000..bd1b73a
--- /dev/null
@@ -0,0 +1,16 @@
+; fio-rand-write.job for fiotest
+
+[global]
+name=fio-rand-write
+filename=fio-rand-write
+rw=randwrite
+bs=4K
+direct=0
+numjobs=4
+time_based=1
+runtime=900
+
+[file1]
+size=10G
+ioengine=libaio
+iodepth=16
diff --git a/examples/fio-rand-write.job b/examples/fio-rand-write.job
deleted file mode 100644 (file)
index bd1b73a..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-; fio-rand-write.job for fiotest
-
-[global]
-name=fio-rand-write
-filename=fio-rand-write
-rw=randwrite
-bs=4K
-direct=0
-numjobs=4
-time_based=1
-runtime=900
-
-[file1]
-size=10G
-ioengine=libaio
-iodepth=16
diff --git a/examples/fio-seq-RW.fio b/examples/fio-seq-RW.fio
new file mode 100644 (file)
index 0000000..8f7090f
--- /dev/null
@@ -0,0 +1,18 @@
+; fio-seq-RW.job for fiotest
+
+[global]
+name=fio-seq-RW
+filename=fio-seq-RW
+rw=rw
+rwmixread=60
+rwmixwrite=40
+bs=256K
+direct=0
+numjobs=4
+time_based=1
+runtime=900
+
+[file1]
+size=10G
+ioengine=libaio
+iodepth=16
diff --git a/examples/fio-seq-RW.job b/examples/fio-seq-RW.job
deleted file mode 100644 (file)
index 8f7090f..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-; fio-seq-RW.job for fiotest
-
-[global]
-name=fio-seq-RW
-filename=fio-seq-RW
-rw=rw
-rwmixread=60
-rwmixwrite=40
-bs=256K
-direct=0
-numjobs=4
-time_based=1
-runtime=900
-
-[file1]
-size=10G
-ioengine=libaio
-iodepth=16
diff --git a/examples/fio-seq-read.fio b/examples/fio-seq-read.fio
new file mode 100644 (file)
index 0000000..28de93c
--- /dev/null
@@ -0,0 +1,14 @@
+[global]
+name=fio-seq-reads
+filename=fio-seq-reads
+rw=read
+bs=256K
+direct=1
+numjobs=1
+time_based=1
+runtime=900
+
+[file1]
+size=10G
+ioengine=libaio
+iodepth=16
diff --git a/examples/fio-seq-read.job b/examples/fio-seq-read.job
deleted file mode 100644 (file)
index 28de93c..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-[global]
-name=fio-seq-reads
-filename=fio-seq-reads
-rw=read
-bs=256K
-direct=1
-numjobs=1
-time_based=1
-runtime=900
-
-[file1]
-size=10G
-ioengine=libaio
-iodepth=16
diff --git a/examples/fio-seq-write.fio b/examples/fio-seq-write.fio
new file mode 100644 (file)
index 0000000..b291a15
--- /dev/null
@@ -0,0 +1,16 @@
+; fio-seq-write.job for fiotest
+
+[global]
+name=fio-seq-write
+filename=fio-seq-write
+rw=write
+bs=256K
+direct=0
+numjobs=1
+time_based=1
+runtime=900
+
+[file1]
+size=10G
+ioengine=libaio
+iodepth=16
diff --git a/examples/fio-seq-write.job b/examples/fio-seq-write.job
deleted file mode 100644 (file)
index b291a15..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-; fio-seq-write.job for fiotest
-
-[global]
-name=fio-seq-write
-filename=fio-seq-write
-rw=write
-bs=256K
-direct=0
-numjobs=1
-time_based=1
-runtime=900
-
-[file1]
-size=10G
-ioengine=libaio
-iodepth=16
diff --git a/examples/fusion-aw-sync.fio b/examples/fusion-aw-sync.fio
deleted file mode 100644 (file)
index f2ca313..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-# Example Job File that randomly writes 8k worth of data atomically for
-# 60 seconds.
-[rw_aw_file_sync]
-rw=randwrite
-ioengine=fusion-aw-sync
-blocksize=8k
-blockalign=8k
-
-# if file system supports atomic write
-filename=/mnt/fs/file
-# or test on a direct block device instead
-#filename=/dev/fioa
-randrepeat=1
-fallocate=none
-direct=1
-invalidate=0
-runtime=60
-time_based
diff --git a/init.c b/init.c
index 09f58a3..c235b05 100644 (file)
--- a/init.c
+++ b/init.c
@@ -1681,6 +1681,7 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num,
                                char *c1, *c2, *c3, *c4;
                                char *c5 = NULL, *c6 = NULL;
                                int i2p = is_power_of_2(o->kb_base);
+                               struct buf_output out;
 
                                c1 = num2str(o->min_bs[DDIR_READ], o->sig_figs, 1, i2p, N2S_BYTE);
                                c2 = num2str(o->max_bs[DDIR_READ], o->sig_figs, 1, i2p, N2S_BYTE);
@@ -1692,19 +1693,22 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num,
                                        c6 = num2str(o->max_bs[DDIR_TRIM], o->sig_figs, 1, i2p, N2S_BYTE);
                                }
 
-                               log_info("%s: (g=%d): rw=%s, ", td->o.name,
+                               buf_output_init(&out);
+                               __log_buf(&out, "%s: (g=%d): rw=%s, ", td->o.name,
                                                        td->groupid,
                                                        ddir_str(o->td_ddir));
 
                                if (o->bs_is_seq_rand)
-                                       log_info("bs=(R) %s-%s, (W) %s-%s, bs_is_seq_rand, ",
+                                       __log_buf(&out, "bs=(R) %s-%s, (W) %s-%s, bs_is_seq_rand, ",
                                                        c1, c2, c3, c4);
                                else
-                                       log_info("bs=(R) %s-%s, (W) %s-%s, (T) %s-%s, ",
+                                       __log_buf(&out, "bs=(R) %s-%s, (W) %s-%s, (T) %s-%s, ",
                                                        c1, c2, c3, c4, c5, c6);
 
-                               log_info("ioengine=%s, iodepth=%u\n",
+                               __log_buf(&out, "ioengine=%s, iodepth=%u\n",
                                                td->io_ops->name, o->iodepth);
+                               log_info_buf(out.buf, out.buflen);
+                               buf_output_free(&out);
 
                                free(c1);
                                free(c2);
diff --git a/iolog.c b/iolog.c
index f3eedb5..26c3458 100644 (file)
--- a/iolog.c
+++ b/iolog.c
@@ -580,7 +580,10 @@ static int open_socket(const char *path)
        if (fd < 0)
                return fd;
        addr.sun_family = AF_UNIX;
-       strncpy(addr.sun_path, path, sizeof(addr.sun_path));
+       if (snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", path) >=
+           sizeof(addr.sun_path))
+               log_err("%s: path name %s is too long for a Unix socket\n",
+                       __func__, path);
        if (connect(fd, (const struct sockaddr *)&addr, strlen(path) + sizeof(addr.sun_family)) == 0)
                return fd;
        else
index 40fb3ae..1abe22f 100644 (file)
@@ -30,7 +30,7 @@ char *num2str(uint64_t num, int maxlen, int base, int pow2, enum n2s_unit units)
                [N2S_BYTEPERSEC]= "B/s",
                [N2S_BITPERSEC] = "bit/s"
        };
-       const unsigned int thousand[] = { 1000, 1024 };
+       const unsigned int thousand = pow2 ? 1024 : 1000;
        unsigned int modulo;
        int post_index, carry = 0;
        char tmp[32], fmt[32];
@@ -49,7 +49,7 @@ char *num2str(uint64_t num, int maxlen, int base, int pow2, enum n2s_unit units)
                unitprefix = sistr;
 
        for (post_index = 0; base > 1; post_index++)
-               base /= thousand[!!pow2];
+               base /= thousand;
 
        switch (units) {
        case N2S_NONE:
@@ -72,14 +72,14 @@ char *num2str(uint64_t num, int maxlen, int base, int pow2, enum n2s_unit units)
         * Divide by K/Ki until string length of num <= maxlen.
         */
        modulo = -1U;
-       while (post_index < sizeof(sistr)) {
+       while (post_index < ARRAY_SIZE(sistr)) {
                sprintf(tmp, "%llu", (unsigned long long) num);
                if (strlen(tmp) <= maxlen)
                        break;
 
-               modulo = num % thousand[!!pow2];
-               num /= thousand[!!pow2];
-               carry = modulo >= thousand[!!pow2] / 2;
+               modulo = num % thousand;
+               num /= thousand;
+               carry = modulo >= thousand / 2;
                post_index++;
        }
 
@@ -110,9 +110,9 @@ done:
         * Fill in everything and return the result.
         */
        assert(maxlen - strlen(tmp) - 1 > 0);
-       assert(modulo < thousand[!!pow2]);
+       assert(modulo < thousand);
        sprintf(fmt, "%%.%df", (int)(maxlen - strlen(tmp) - 1));
-       sprintf(tmp, fmt, (double)modulo / (double)thousand[!!pow2]);
+       sprintf(tmp, fmt, (double)modulo / (double)thousand);
 
        sprintf(buf, "%llu.%s%s%s", (unsigned long long) num, &tmp[2],
                        unitprefix[post_index], unitstr[units]);
index 534233b..6bd7455 100644 (file)
--- a/options.c
+++ b/options.c
@@ -1828,11 +1828,6 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                            .help = "RDMA IO engine",
                          },
 #endif
-#ifdef CONFIG_FUSION_AW
-                         { .ival = "fusion-aw-sync",
-                           .help = "Fusion-io atomic write engine",
-                         },
-#endif
 #ifdef CONFIG_LINUX_EXT4_MOVE_EXTENT
                          { .ival = "e4defrag",
                            .help = "ext4 defrag engine",
index e8580d9..9308ba8 100755 (executable)
                   <File Source="..\..\examples\filecreate-ioengine.fio" />
                 </Component>
                 <Component>
-                  <File Source="..\..\examples\fio-rand-read.job" />
+                  <File Source="..\..\examples\fio-rand-read.fio" />
                 </Component>
                 <Component>
-                  <File Source="..\..\examples\fio-rand-RW.job" />
+                  <File Source="..\..\examples\fio-rand-RW.fio" />
                 </Component>
                 <Component>
-                  <File Source="..\..\examples\fio-rand-write.job" />
+                  <File Source="..\..\examples\fio-rand-write.fio" />
                 </Component>
                 <Component>
-                  <File Source="..\..\examples\fio-seq-read.job" />
+                  <File Source="..\..\examples\fio-seq-read.fio" />
                 </Component>
                 <Component>
-                  <File Source="..\..\examples\fio-seq-RW.job" />
+                  <File Source="..\..\examples\fio-seq-RW.fio" />
                 </Component>
                 <Component>
-                  <File Source="..\..\examples\fio-seq-write.job" />
+                  <File Source="..\..\examples\fio-seq-write.fio" />
                 </Component>
                 <Component>
                   <File Source="..\..\examples\fixed-rate-submission.fio" />
@@ -74,9 +74,6 @@
                 <Component>
                   <File Source="..\..\examples\ftruncate.fio" />
                 </Component>
-                <Component>
-                  <File Source="..\..\examples\fusion-aw-sync.fio" />
-                </Component>
                 <Component>
                   <File Source="..\..\examples\gfapi.fio" />
                 </Component>
             <ComponentRef Id="enospc_pressure.fio" />
             <ComponentRef Id="falloc.fio" />
             <ComponentRef Id="filecreate_ioengine.fio"/>
-            <ComponentRef Id="fio_rand_read.job"/>
-            <ComponentRef Id="fio_rand_RW.job"/>
-            <ComponentRef Id="fio_rand_write.job"/>
-            <ComponentRef Id="fio_seq_read.job"/>
-            <ComponentRef Id="fio_seq_RW.job"/>
-            <ComponentRef Id="fio_seq_write.job"/>
+            <ComponentRef Id="fio_rand_read.fio"/>
+            <ComponentRef Id="fio_rand_RW.fio"/>
+            <ComponentRef Id="fio_rand_write.fio"/>
+            <ComponentRef Id="fio_seq_read.fio"/>
+            <ComponentRef Id="fio_seq_RW.fio"/>
+            <ComponentRef Id="fio_seq_write.fio"/>
             <ComponentRef Id="fixed_rate_submission.fio" />
             <ComponentRef Id="flow.fio" />
             <ComponentRef Id="fsx.fio" />
             <ComponentRef Id="ftruncate.fio"/>
-            <ComponentRef Id="fusion_aw_sync.fio" />
             <ComponentRef Id="gfapi.fio" />
             <ComponentRef Id="gpudirect_rdmaio_client.fio"/>
             <ComponentRef Id="gpudirect_rdmaio_server.fio"/>
diff --git a/stat.c b/stat.c
index 1a9c553..5fca998 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -1928,8 +1928,6 @@ void __show_run_stats(void)
                if (is_backend) {
                        fio_server_send_job_options(opt_lists[i], i);
                        fio_server_send_ts(ts, rs);
-                       if (output_format & FIO_OUTPUT_TERSE)
-                               show_thread_status_terse(ts, rs, &output[__FIO_OUTPUT_TERSE]);
                } else {
                        if (output_format & FIO_OUTPUT_TERSE)
                                show_thread_status_terse(ts, rs, &output[__FIO_OUTPUT_TERSE]);