Merge branch 'master' into gfio
authorJens Axboe <axboe@kernel.dk>
Thu, 11 Oct 2012 03:43:46 +0000 (21:43 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 11 Oct 2012 03:43:46 +0000 (21:43 -0600)
14 files changed:
FIO-VERSION-GEN
HOWTO
backend.c
client.c
diskutil.c
engines/net.c
fio.1
io_u.c
options.c
os/os-solaris.h
os/os.h
os/windows/install.wxs
os/windows/posix.c
stat.c

index 08729ba813567b3e4875cae6e2d3e82287f5a29f..cc7eb83cca8e589b5a5f85b682049db1e4707dc6 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 GVF=FIO-VERSION-FILE
-DEF_VER=fio-2.0.9
+DEF_VER=fio-2.0.10
 
 LF='
 '
diff --git a/HOWTO b/HOWTO
index b0d0a1fc6ca7831e30f603d3614398764ca7a61a..1fb30db656e4c722dab850c8de6863ec62fe3f97 100644 (file)
--- a/HOWTO
+++ b/HOWTO
@@ -1053,22 +1053,22 @@ wait_for_previous Wait for preceeding jobs in the job file to exit, before
                points in the job file. A stone wall also implies starting
                a new reporting group.
 
-new_group      Start a new reporting group. If this option isn't given,
-               jobs in a file will be part of the same reporting group
-               unless separated by a stone wall (or if it's a group
-               by itself, with the numjobs option).
+new_group      Start a new reporting group. See: group_reporting.
 
 numjobs=int    Create the specified number of clones of this job. May be
                used to setup a larger number of threads/processes doing
-               the same thing. We regard that grouping of jobs as a
-               specific group.
-
-group_reporting        If 'numjobs' is set, it may be interesting to display
-               statistics for the group as a whole instead of for each
-               individual job. This is especially true of 'numjobs' is
-               large, looking at individual thread/process output quickly
-               becomes unwieldy. If 'group_reporting' is specified, fio
-               will show the final report per-group instead of per-job.
+               the same thing. Each thread is reported separately; to see
+               statistics for all clones as a whole, use group_reporting in
+               conjunction with new_group.
+
+group_reporting        It may sometimes be interesting to display statistics for
+               groups of jobs as a whole instead of for each individual job.
+               This is especially true if 'numjobs' is used; looking at
+               individual thread/process output quickly becomes unwieldy.
+               To see the final report per-group instead of per-job, use
+               'group_reporting'. Jobs in a file will be part of the same
+               reporting group, unless if separated by a stonewall, or by
+               using 'new_group'.
 
 thread         fio defaults to forking jobs, however if this option is
                given, fio will use pthread_create(3) to create threads
@@ -1327,7 +1327,7 @@ that defines them is selected.
 [net] proto=str        The network protocol to use. Accepted values are:
 
                        tcp     Transmission control protocol
-                       udp     Unreliable datagram protocol
+                       udp     User datagram protocol
                        unix    UNIX domain socket
 
                When the protocol is TCP or UDP, the port must also be given,
index 3a1df299fd80f920ee97d8f1ecb79b525726a838..974384c17fb04d1dc10bea616835595496a29fe4 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -108,6 +108,14 @@ static void set_sig_handlers(void)
        act.sa_flags = SA_RESTART;
        sigaction(SIGTERM, &act, NULL);
 
+/* Windows uses SIGBREAK as a quit signal from other applications */
+#ifdef WIN32
+       memset(&act, 0, sizeof(act));
+       act.sa_handler = sig_int;
+       act.sa_flags = SA_RESTART;
+       sigaction(SIGBREAK, &act, NULL);
+#endif
+
        memset(&act, 0, sizeof(act));
        act.sa_handler = sig_show_status;
        act.sa_flags = SA_RESTART;
index 47a2380c129c64b529c8bb3a887bcb4e8462f1be..7b8dc61e4365aa4fd191d4ad0adf084b950ba037 100644 (file)
--- a/client.c
+++ b/client.c
@@ -437,6 +437,14 @@ static void client_signal_handler(void)
        act.sa_flags = SA_RESTART;
        sigaction(SIGTERM, &act, NULL);
 
+/* Windows uses SIGBREAK as a quit signal from other applications */
+#ifdef WIN32
+       memset(&act, 0, sizeof(act));
+       act.sa_handler = sig_int;
+       act.sa_flags = SA_RESTART;
+       sigaction(SIGBREAK, &act, NULL);
+#endif
+
        memset(&act, 0, sizeof(act));
        act.sa_handler = sig_show_status;
        act.sa_flags = SA_RESTART;
index d98e39a50b0d6423febdf0457f5097718ad53382..fbc4268e800f9068d6bfcf5f3a6bb7a4a54cb4cc 100644 (file)
@@ -658,7 +658,7 @@ void show_disk_util(int terse, struct json_object *parent)
        if (!terse)
                log_info("\nDisk stats (read/write):\n");
 
-       if (terse && terse_version == 4) {
+       if (output_format == FIO_OUTPUT_JSON) {
                array = json_create_array();
                json_object_add_value_array(parent, "disk_util", array);
        }
@@ -667,7 +667,7 @@ void show_disk_util(int terse, struct json_object *parent)
                du = flist_entry(entry, struct disk_util, list);
 
                aggregate_slaves_stats(du);
-               if (terse && terse_version == 4)
+               if (output_format == FIO_OUTPUT_JSON)
                        print_disk_util_json(du, array);
                else
                        print_disk_util(&du->dus, &du->agg, terse);
index 636939ea932c86025a8aa733a1327a313e374b92..468bc7c81746a8f73935903e8c99d3990c2286e1 100644 (file)
@@ -85,7 +85,7 @@ static struct fio_option options[] = {
                          },
                          { .ival = "udp",
                            .oval = FIO_TYPE_UDP,
-                           .help = "Unreliable Datagram Protocol",
+                           .help = "User Datagram Protocol",
                          },
                          { .ival = "unix",
                            .oval = FIO_TYPE_UNIX,
@@ -152,7 +152,7 @@ static int fio_netio_prep(struct thread_data *td, struct io_u *io_u)
                td_verror(td, EINVAL, "bad direction");
                return 1;
        }
-               
+
        return 0;
 }
 
@@ -695,6 +695,11 @@ static int fio_netio_init(struct thread_data *td)
        struct netio_options *o = td->eo;
        int ret;
 
+#ifdef WIN32
+       WSADATA wsd;
+       WSAStartup(MAKEWORD(2,2), &wsd);
+#endif
+
        if (td_random(td)) {
                log_err("fio: network IO can't be random\n");
                return 1;
diff --git a/fio.1 b/fio.1
index d42516a912bb0ad3bbc7a772317d9ac57918a58f..13abb94fd27715cae1377c250d643ba6c3e58953 100644 (file)
--- a/fio.1
+++ b/fio.1
@@ -1079,7 +1079,7 @@ The network protocol to use. Accepted values are:
 Transmission control protocol
 .TP
 .B udp
-Unreliable datagram protocol
+User datagram protocol
 .TP
 .B unix
 UNIX domain socket
diff --git a/io_u.c b/io_u.c
index a4802fec66ead13be34fe7c6bc0429978f695497..347e1159fa5d5d69e48faebe31965ea508aef60c 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -1096,7 +1096,7 @@ again:
 
                io_u->error = 0;
                flist_del(&io_u->list);
-               flist_add(&io_u->list, &td->io_u_busylist);
+               flist_add_tail(&io_u->list, &td->io_u_busylist);
                td->cur_depth++;
                io_u->flags |= IO_U_F_IN_CUR_DEPTH;
        } else if (td->o.verify_async) {
index 14a983115ce75ee2c0dfe6b13be24a6620fc90bd..eb7c596a1b96d04f3e2d387fd3ee0eefc337cd66 100644 (file)
--- a/options.c
+++ b/options.c
@@ -2993,7 +2993,7 @@ void fio_keywords_init(void)
        char buf[128];
        long l;
 
-       sprintf(buf, "%lu", page_size);
+       sprintf(buf, "%lu", (unsigned long) page_size);
        fio_keywords[0].replace = strdup(buf);
 
        mb_memory = os_phys_mem() / (1024 * 1024);
index d97643d02c71394211e915e429ee91b1d6addf1f..e7a544e1a0bc37c4766a2dc303da9701a1421efa 100644 (file)
@@ -49,6 +49,9 @@ struct solaris_rand_seed {
 #define POSIX_MADV_RANDOM      MADV_RANDOM
 #endif
 
+#define os_ctime_r(x, y, z)     ctime_r((x), (y), (z))
+#define FIO_OS_HAS_CTIME_R
+
 typedef psetid_t os_cpu_mask_t;
 typedef struct solaris_rand_seed os_random_state_t;
 
diff --git a/os/os.h b/os/os.h
index dc798c373a751b6f41f814448cfa95f2a5300439..e2c188f1235cc5c0e85d280582ba0ed0a4b18483 100644 (file)
--- a/os/os.h
+++ b/os/os.h
@@ -142,6 +142,10 @@ typedef unsigned long os_cpu_mask_t;
 typedef socklen_t fio_socklen_t;
 #endif
 
+#ifndef FIO_OS_HAS_CTIME_R
+#define os_ctime_r(x, y, z)     ctime_r((x), (y))
+#endif
+
 #ifdef FIO_USE_GENERIC_SWAP
 static inline uint16_t fio_swap16(uint16_t val)
 {
index 571492ed3545c03677cf1d153e5dacc240eab32f..e02347e4b4c0c50da9671c0c3bc00fe659100102 100755 (executable)
@@ -10,7 +10,7 @@
        <Product Id="2BA394F9-0D9E-4597-BB9D-6B18097D64BB"\r
          Codepage="1252" Language="1033"\r
          Manufacturer="fio" Name="fio"\r
-         UpgradeCode="2338A332-5511-43cf-b9BD-5C60496CCFCC" Version="2.0.9">\r
+         UpgradeCode="2338A332-5511-43cf-b9BD-5C60496CCFCC" Version="2.0.10">\r
                <Package \r
                  Comments="Contact: Your local administrator"\r
                  Description="Flexible IO Tester"\r
index ce41ef8edfb75cb4df615ca5006fb39218434428..11500e480bf85a1c5b2f45c7defa2d63f81a56bb 100755 (executable)
@@ -234,10 +234,10 @@ void syslog(int priority, const char *message, ... /* argument */)
        va_start(v, message);
        len = _vscprintf(message, v);
        output = malloc(len + sizeof(char));
-       vsprintf_s(output, len + sizeof(char), message, v);
+       vsprintf(output, message, v);
        WriteFile(log_file, output, len, &bytes_written, NULL);
        va_end(v);
-    free(output);
+       free(output);
 }
 
 int kill(pid_t pid, int sig)
@@ -411,6 +411,9 @@ int posix_fallocate(int fd, off_t offset, off_t len)
                        break;
                }
 
+               /* Don't allow Windows to cache the write: flush it to disk */
+               _commit(fd);
+
                bytes_remaining -= bytes_written;
        }
 
@@ -628,11 +631,11 @@ int poll(struct pollfd fds[], nfds_t nfds, int timeout)
        int i;
        int rc;
 
-       if (timeout != -1)
+       if (timeout != -1) {
                to = &tv;
-
-       to->tv_sec = timeout / 1000;
-       to->tv_usec = (timeout % 1000) * 1000;
+               to->tv_sec = timeout / 1000;
+               to->tv_usec = (timeout % 1000) * 1000;
+       }
 
        FD_ZERO(&readfds);
        FD_ZERO(&writefds);
@@ -811,9 +814,15 @@ const char* inet_ntop(int af, const void *restrict src,
                errno = ENOSPC;
 
        WSACleanup();
+
        return ret;
 }
 
+int inet_aton(const char *cp, struct in_addr *inp)
+{
+       return inet_pton(AF_INET, cp, inp);
+}
+
 int inet_pton(int af, const char *restrict src, void *restrict dst)
 {
        INT status = SOCKET_ERROR;
diff --git a/stat.c b/stat.c
index edeae877f817e77c05d4d95cc1f058e92b5770e4..4a881d4fedf75b22b6283cffa2fdd0236cf82dda 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -495,7 +495,7 @@ void show_thread_status(struct thread_stat *ts, struct group_run_stats *rs)
                return;
 
        time(&time_p);
-       ctime_r((const time_t *) &time_p, time_buf);
+       os_ctime_r((const time_t *) &time_p, time_buf, sizeof(time_buf));
 
        if (!ts->error) {
                log_info("%s: (groupid=%d, jobs=%d): err=%2d: pid=%d: %s",