Lines Matching defs:opt
63 } opt = {
76 #define OPT(l, s, t, opt, addr, desc) { l, s, t, &opt.addr, desc }
77 OPT("perthread", 'p', arg_none, opt, perthread,
79 OPT("threads", 'n', arg_uint32, opt, threads,
81 OPT("size", 's', arg_uint32, opt, size,
83 OPT("time", 't', arg_uint32, opt, time,
85 OPT("operation", 'o', arg_string, opt, op,
87 OPT("interrupt", 'i', arg_string, opt, intr,
89 OPT("flags", 'f', arg_string, opt, flags,
96 { arg_string, &opt.dev, "namespace-id" },
104 .ctx_size = sizeof(opt),
147 if (opt.op == NULL)
149 if (opt.flags != NULL && strcmp(opt.flags, "refthread") == 0)
151 if (opt.intr != NULL) {
152 if (strcmp(opt.intr, "bio") == 0 ||
153 strcmp(opt.intr, "wait") == 0)
155 else if (strcmp(opt.intr, "io") == 0 ||
156 strcmp(opt.intr, "intr") == 0)
159 fprintf(stderr, "Unknown interrupt test type %s\n", opt.intr);
163 if (opt.threads <= 0 || opt.threads > 128) {
164 fprintf(stderr, "Bad number of threads %d\n", opt.threads);
167 io_test.num_threads = opt.threads;
168 if (strcasecmp(opt.op, "read") == 0)
170 else if (strcasecmp(opt.op, "write") == 0)
173 fprintf(stderr, "\"%s\" not valid opcode.\n", opt.op);
176 if (opt.time == 0) {
180 io_test.time = opt.time;
181 io_test.size = opt.size;
182 open_dev(opt.dev, &fd, 1, 1);
187 print_perftest(&io_test, opt.perthread);