Merge branch 'regrow_agg_logs' of https://github.com/pmoust/fio
[fio.git] / server.c
index 0a036a6a5d291de1c3995f06536df05fb5c0110c..1b65297ec25feb166e3f39e6b01b7c081a96fa42 100644 (file)
--- a/server.c
+++ b/server.c
@@ -950,7 +950,7 @@ static int handle_update_job_cmd(struct fio_net_cmd *cmd)
                return 0;
        }
 
-       td = &threads[tnumber - 1];
+       td = tnumber_to_td(tnumber);
        convert_thread_options_to_cpu(&td->o, &pdu->top);
        send_update_job_reply(cmd->tag, 0);
        return 0;
@@ -1463,7 +1463,7 @@ static void convert_gs(struct group_run_stats *dst, struct group_run_stats *src)
 void fio_server_send_ts(struct thread_stat *ts, struct group_run_stats *rs)
 {
        struct cmd_ts_pdu p;
-       int i, j;
+       int i, j, k;
        void *ss_buf;
        uint64_t *ss_iops, *ss_bw;
 
@@ -1499,6 +1499,7 @@ void fio_server_send_ts(struct thread_stat *ts, struct group_run_stats *rs)
        p.ts.majf               = cpu_to_le64(ts->majf);
        p.ts.clat_percentiles   = cpu_to_le32(ts->clat_percentiles);
        p.ts.lat_percentiles    = cpu_to_le32(ts->lat_percentiles);
+       p.ts.slat_percentiles   = cpu_to_le32(ts->slat_percentiles);
        p.ts.percentile_precision = cpu_to_le64(ts->percentile_precision);
 
        for (i = 0; i < FIO_IO_U_LIST_MAX_LEN; i++) {
@@ -1521,9 +1522,10 @@ void fio_server_send_ts(struct thread_stat *ts, struct group_run_stats *rs)
        for (i = 0; i < FIO_IO_U_LAT_M_NR; i++)
                p.ts.io_u_lat_m[i]      = cpu_to_le64(ts->io_u_lat_m[i]);
 
-       for (i = 0; i < DDIR_RWDIR_CNT; i++)
-               for (j = 0; j < FIO_IO_U_PLAT_NR; j++)
-                       p.ts.io_u_plat[i][j] = cpu_to_le64(ts->io_u_plat[i][j]);
+       for (i = 0; i < FIO_LAT_CNT; i++)
+               for (j = 0; j < DDIR_RWDIR_CNT; j++)
+                       for (k = 0; k < FIO_IO_U_PLAT_NR; k++)
+                               p.ts.io_u_plat[i][j][k] = cpu_to_le64(ts->io_u_plat[i][j][k]);
 
        for (j = 0; j < FIO_IO_U_PLAT_NR; j++)
                p.ts.io_u_sync_plat[j] = cpu_to_le64(ts->io_u_sync_plat[j]);
@@ -1574,6 +1576,15 @@ void fio_server_send_ts(struct thread_stat *ts, struct group_run_stats *rs)
        p.ts.cachehit           = cpu_to_le64(ts->cachehit);
        p.ts.cachemiss          = cpu_to_le64(ts->cachemiss);
 
+       for (i = 0; i < DDIR_RWDIR_CNT; i++) {
+               for (j = 0; j < FIO_IO_U_PLAT_NR; j++) {
+                       p.ts.io_u_plat_high_prio[i][j] = cpu_to_le64(ts->io_u_plat_high_prio[i][j]);
+                       p.ts.io_u_plat_low_prio[i][j] = cpu_to_le64(ts->io_u_plat_low_prio[i][j]);
+               }
+               convert_io_stat(&p.ts.clat_high_prio_stat[i], &ts->clat_high_prio_stat[i]);
+               convert_io_stat(&p.ts.clat_low_prio_stat[i], &ts->clat_low_prio_stat[i]);
+       }
+
        convert_gs(&p.rs, rs);
 
        dprint(FD_NET, "ts->ss_state = %d\n", ts->ss_state);
@@ -1998,7 +2009,7 @@ int fio_send_iolog(struct thread_data *td, struct io_log *log, const char *name)
 
                        s->time         = cpu_to_le64(s->time);
                        s->data.val     = cpu_to_le64(s->data.val);
-                       s->__ddir       = cpu_to_le32(s->__ddir);
+                       s->__ddir       = __cpu_to_le32(s->__ddir);
                        s->bs           = cpu_to_le64(s->bs);
 
                        if (log->log_offset) {