*
* It also can act as external C++ engine - compiled with:
*
- * g++ -O2 -g -shared -rdynamic -fPIC -o cpp_null null.c -DFIO_EXTERNAL_ENGINE
+ * g++ -O2 -g -shared -rdynamic -fPIC -o cpp_null null.c \
+ * -include ../config-host.h -DFIO_EXTERNAL_ENGINE
*
* to test it execute:
*
return ret;
}
+static void null_queued(struct thread_data *td, struct null_data *nd)
+{
+ struct timespec now;
+
+ if (!fio_fill_issue_time(td))
+ return;
+
+ fio_gettime(&now, NULL);
+
+ for (int i = 0; i < nd->queued; i++) {
+ struct io_u *io_u = nd->io_us[i];
+
+ memcpy(&io_u->issue_time, &now, sizeof(now));
+ io_u_queued(td, io_u);
+ }
+}
+
static int null_commit(struct thread_data *td, struct null_data *nd)
{
if (!nd->events) {
+ null_queued(td, nd);
+
#ifndef FIO_EXTERNAL_ENGINE
io_u_mark_submit(td, nd->queued);
#endif
return 0;
}
-static enum fio_q_status
-null_queue(struct thread_data *td, struct null_data *nd, struct io_u *io_u)
+static enum fio_q_status null_queue(struct thread_data *td,
+ struct null_data *nd, struct io_u *io_u)
{
fio_ro_check(td, io_u);
if (td->o.iodepth != 1) {
nd->io_us = (struct io_u **) malloc(td->o.iodepth * sizeof(struct io_u *));
memset(nd->io_us, 0, td->o.iodepth * sizeof(struct io_u *));
+ td->io_ops->flags |= FIO_ASYNCIO_SETS_ISSUE_TIME;
} else
td->io_ops->flags |= FIO_SYNCIO;
+ td_set_ioengine_flags(td);
return nd;
}
return null_commit(td, td->io_ops_data);
}
-static enum fio_q_status
-fio_null_queue(struct thread_data *td, struct io_u *io_u)
+static enum fio_q_status fio_null_queue(struct thread_data *td,
+ struct io_u *io_u)
{
return null_queue(td, td->io_ops_data, io_u);
}
return null_commit(td, impl_);
}
- int fio_null_queue(struct thread_data *td, struct io_u *io_u)
+ fio_q_status fio_null_queue(struct thread_data *td, struct io_u *io_u)
{
return null_queue(td, impl_, io_u);
}
return NullData::get(td)->fio_null_commit(td);
}
-static int fio_null_queue(struct thread_data *td, struct io_u *io_u)
+static fio_q_status fio_null_queue(struct thread_data *td, struct io_u *io_u)
{
return NullData::get(td)->fio_null_queue(td, io_u);
}