Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-#ifndef FIO_HAVE_CPU_AFFINITY
- if (td->o.gtod_cpu) {
- log_err("fio: platform must support CPU affinity for"
- "gettimeofday() offloading\n");
- return 1;
- }
-#endif
-
-#if 0
- if (read_only && td_write(td)) {
- log_err("fio: job <%s> has write bit set, but fio is in"
- " read-only mode\n", td->o.name);
- return 1;
- }
-#endif
-
if (o->write_iolog_file && o->read_iolog_file) {
log_err("fio: read iolog overrides write_iolog\n");
free(o->write_iolog_file);
if (o->write_iolog_file && o->read_iolog_file) {
log_err("fio: read iolog overrides write_iolog\n");
free(o->write_iolog_file);
+static int gtod_cpu_rw_verify(struct fio_option *o, void *data)
+{
+ struct thread_data *td = data;
+
+#ifndef FIO_HAVE_CPU_AFFINITY
+ if (td->o.gtod_cpu) {
+ log_err("fio: platform must support CPU affinity for"
+ "gettimeofday() offloading\n");
+ return 1;
+ }
+#endif
+
+ return 0;
+}
+
#define __stringify_1(x) #x
#define __stringify(x) __stringify_1(x)
#define __stringify_1(x) #x
#define __stringify(x) __stringify_1(x)
.type = FIO_OPT_INT,
.cb = str_gtod_cpu_cb,
.help = "Setup dedicated gettimeofday() thread on this CPU",
.type = FIO_OPT_INT,
.cb = str_gtod_cpu_cb,
.help = "Setup dedicated gettimeofday() thread on this CPU",
+ .verify = gtod_cpu_verify,
},
{
.name = "continue_on_error",
},
{
.name = "continue_on_error",