server: make client connections fork off
[fio.git] / iolog.c
diff --git a/iolog.c b/iolog.c
index c1764bac76f8e56568d77af112353d31ccc3d12f..7b212bb598f124c3ce745e8f08918d4d0efd4f4d 100644 (file)
--- a/iolog.c
+++ b/iolog.c
@@ -176,12 +176,6 @@ void prune_io_piece_log(struct thread_data *td)
        }
 }
 
-static void dump_ipo(struct io_piece *ipo, const char *msg)
-{
-       printf("%s\n", msg);
-       printf("\toffset %llu, len %lu, fl %x, ddir %d\n", ipo->offset, ipo->len, ipo->flags, ipo->ddir);
-}
-
 /*
  * log a successful write, so we can unwind the log for verify
  */
@@ -245,12 +239,7 @@ restart:
                else if (ipo->offset > __ipo->offset)
                        p = &(*p)->rb_right;
                else {
-                       if (ipo->len != __ipo->len) {
-                               log_err("fio: unexpected ipo overlap!\n");
-                               log_err("fio: please report this issue.\n");
-                               dump_ipo(ipo, "ipo");
-                               dump_ipo(__ipo, "__ipo");
-                       }
+                       assert(ipo->len == __ipo->len);
                        td->io_hist_len--;
                        rb_erase(parent, &td->io_hist_tree);
                        remove_trim_entry(td, __ipo);
@@ -503,13 +492,14 @@ int init_iolog(struct thread_data *td)
        return ret;
 }
 
-void setup_log(struct io_log **log, unsigned long avg_msec)
+void setup_log(struct io_log **log, unsigned long avg_msec, int log_type)
 {
        struct io_log *l = malloc(sizeof(*l));
 
        memset(l, 0, sizeof(*l));
        l->nr_samples = 0;
        l->max_samples = 1024;
+       l->log_type = log_type;
        l->log = malloc(l->max_samples * sizeof(struct io_sample));
        l->avg_msec = avg_msec;
        *log = l;
@@ -545,7 +535,13 @@ void finish_log_named(struct thread_data *td, struct io_log *log,
 
        snprintf(file_name, 200, "%s_%s.log", prefix, postfix);
        p = basename(file_name);
-       __finish_log(log, p);
+
+       if (td->client_type == FIO_CLIENT_TYPE_GUI) {
+               fio_send_iolog(td, log, p);
+               free(log->log);
+               free(log);
+       } else
+               __finish_log(log, p);
 }
 
 void finish_log(struct thread_data *td, struct io_log *log, const char *name)