histogram: style and list fixups
authorJens Axboe <axboe@fb.com>
Tue, 16 Aug 2016 20:51:41 +0000 (14:51 -0600)
committerJens Axboe <axboe@fb.com>
Tue, 16 Aug 2016 20:51:41 +0000 (14:51 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
iolog.c
iolog.h
stat.c

diff --git a/iolog.c b/iolog.c
index 3cb12ab..d4213db 100644 (file)
--- a/iolog.c
+++ b/iolog.c
@@ -596,7 +596,7 @@ void setup_log(struct io_log **log, struct log_params *p,
         * with initial io_u_plat of all zeros:
         */
        for (i = 0; i < DDIR_RWDIR_CNT; i++) {
-               list = &l->hist_window[i].list.list;
+               list = &l->hist_window[i].list;
                INIT_FLIST_HEAD(list);
                entry = calloc(1, sizeof(struct io_u_plat_entry));
                flist_add(&entry->list, list);
@@ -708,22 +708,23 @@ static void flush_hist_samples(FILE *f, int hist_coarseness, void *samples,
 
        for (i = 0; i < nr_samples; i++) {
                s = __get_sample(samples, log_offset, i);
-               
+
                entry = (struct io_u_plat_entry *) s->val;
                io_u_plat = entry->io_u_plat;
-               
+
                entry_before = flist_first_entry(&entry->list, struct io_u_plat_entry, list);
                io_u_plat_before = entry_before->io_u_plat;
-               
-               fprintf(f, "%lu, %u, %u, ", (unsigned long)s->time,
-                       io_sample_ddir(s), s->bs);
+
+               fprintf(f, "%lu, %u, %u, ", (unsigned long) s->time,
+                                               io_sample_ddir(s), s->bs);
                for (j = 0; j < FIO_IO_U_PLAT_NR - stride; j += stride) {
-                       fprintf(f, "%lu, ", hist_sum(j, stride, io_u_plat, io_u_plat_before));
+                       fprintf(f, "%lu, ", hist_sum(j, stride, io_u_plat,
+                                               io_u_plat_before));
                }
-               fprintf(f, "%lu\n", (unsigned long) 
+               fprintf(f, "%lu\n", (unsigned long)
                        hist_sum(FIO_IO_U_PLAT_NR - stride, stride, io_u_plat,
-                                io_u_plat_before));
-               
+                                       io_u_plat_before));
+
                flist_del(&entry_before->list);
                free(entry_before);
        }
diff --git a/iolog.h b/iolog.h
index 93a9536..ca344f1 100644 (file)
--- a/iolog.h
+++ b/iolog.h
@@ -18,14 +18,10 @@ struct io_stat {
        fio_fp64_t S;
 };
 
-struct io_u_plat_list {
-       struct flist_head list;
-};
-
 struct io_hist {
        uint64_t samples;
        unsigned long hist_last;
-       struct io_u_plat_list list;
+       struct flist_head list;
 };
 
 /*
diff --git a/stat.c b/stat.c
index a3fa836..5e7c593 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -2234,7 +2234,7 @@ void add_clat_sample(struct thread_data *td, enum fio_ddir ddir,
                        dst = malloc(sizeof(struct io_u_plat_entry));
                        memcpy(&(dst->io_u_plat), io_u_plat,
                                FIO_IO_U_PLAT_NR * sizeof(unsigned int));
-                       flist_add(&dst->list, &hw->list.list);
+                       flist_add(&dst->list, &hw->list);
                        __add_log_sample(iolog, (unsigned long)dst, ddir, bs,
                                                elapsed, offset);