.export = "/tmp",
.protocol = "tcp",
.run_once = 0,
+ .allow_scsi_writes = 0,
+ .trunc_io = 0,
};
static struct timeval tv_start;
int j;
setlinebuf(stdout);
+ srandom(getpid() ^ time(NULL));
for (j=0;j<options.clients_per_process;j++) {
nb_ops->setup(&children[i*options.clients_per_process + j]);
"disable name resolution simulation", NULL },
{ "clients-per-process", 0, POPT_ARG_INT, &options.clients_per_process, 0,
"number of clients per process", NULL },
+ { "trunc-io", 0, POPT_ARG_INT, &options.trunc_io, 0,
+ "truncate all io to this size", NULL },
{ "one-byte-write-fix", 0, POPT_ARG_NONE, &options.one_byte_write_fix, 0,
"try to fix 1 byte writes", NULL },
{ "stat-check", 0, POPT_ARG_NONE, &options.stat_check, 0,
"protocol", NULL },
{ "run-once", 0, POPT_ARG_NONE, &options.run_once, 0,
"Stop once reaching the end of the loadfile", NULL},
+ { "scsi", 0, POPT_ARG_STRING, &options.scsi_dev, 0,
+ "scsi device", NULL },
+ { "allow-scsi-writes", 0, POPT_ARG_NONE, &options.allow_scsi_writes, 0,
+ "Allow SCSI write command to the device", NULL},
+ { "warmup", 0, POPT_ARG_INT, &options.warmup, 0,
+ "How meny seconds of warmup to run", NULL },
POPT_TABLEEND
};
poptContext pc;
options.backend = "sockio";
} else if (strstr(argv[0], "nfsbench")) {
options.backend = "nfs";
+ } else if (strstr(argv[0], "scsibench")) {
+ options.backend = "scsi";
}
process_opts(argc, argv);
} else if (strcmp(options.backend, "nfs") == 0) {
extern struct nb_operations nfs_ops;
nb_ops = &nfs_ops;
+#ifdef HAVE_LINUX_SCSI_SG
+ } else if (strcmp(options.backend, "scsi") == 0) {
+ extern struct nb_operations scsi_ops;
+ nb_ops = &scsi_ops;
+#endif /* HAVE_LINUX_SCSI_SG */
} else {
printf("Unknown backend '%s'\n", options.backend);
exit(1);