Add more job info
[fio.git] / server.c
index a2db9dd..490c277 100644 (file)
--- a/server.c
+++ b/server.c
@@ -52,6 +52,7 @@ static const char *fio_server_ops[FIO_NET_CMD_NR] = {
        "STOP",
        "DISK_UTIL",
        "RUN",
+       "ADD_JOB",
 };
 
 const char *fio_server_op(unsigned int op)
@@ -801,6 +802,28 @@ void fio_server_send_du(void)
        }
 }
 
+void fio_server_send_add_job(struct thread_options *o, const char *ioengine)
+{
+       struct cmd_add_job_pdu pdu;
+       int i;
+
+       strcpy((char *) pdu.jobname, o->name);
+       strcpy((char *) pdu.ioengine, ioengine);
+
+       pdu.iodepth             = cpu_to_le32(o->iodepth);
+       pdu.rw                  = cpu_to_le32(o->td_ddir);
+
+       for (i = 0; i < 2; i++) {
+               pdu.min_bs[i]   = cpu_to_le32(o->min_bs[i]);
+               pdu.max_bs[i]   = cpu_to_le32(o->max_bs[i]);
+       }
+
+       pdu.numjobs             = cpu_to_le32(o->numjobs);
+       pdu.group_reporting     = cpu_to_le32(o->group_reporting);
+
+       fio_net_send_cmd(server_fd, FIO_NET_CMD_ADD_JOB, &pdu, sizeof(pdu), 0);
+}
+
 int fio_server_log(const char *format, ...)
 {
        char buffer[1024];