blob: 87515ef13313da1d0cd0c2282306e75e6cf011ed [file] [log] [blame]
Jens Axboe214e1ec2007-03-15 10:48:13 +01001#include <stdio.h>
2#include <stdlib.h>
3#include <unistd.h>
4#include <ctype.h>
5#include <string.h>
6#include <getopt.h>
7#include <assert.h>
Jens Axboe921c7662008-03-26 09:17:55 +01008#include <libgen.h>
Jens Axboe5921e802008-05-30 15:02:38 +02009#include <fcntl.h>
10#include <sys/types.h>
11#include <sys/stat.h>
Jens Axboe214e1ec2007-03-15 10:48:13 +010012
13#include "fio.h"
Jens Axboe4f5af7b2009-06-03 08:45:40 +020014#include "verify.h"
Jens Axboe214e1ec2007-03-15 10:48:13 +010015#include "parse.h"
Jens Axboeeef32352008-06-02 13:31:26 +020016#include "lib/fls.h"
Jens Axboe214e1ec2007-03-15 10:48:13 +010017
Jens Axboe2dc1bbe2007-03-15 15:01:33 +010018#define td_var_offset(var) ((size_t) &((struct thread_options *)0)->var)
Jens Axboe214e1ec2007-03-15 10:48:13 +010019
20/*
21 * Check if mmap/mmaphuge has a :/foo/bar/file at the end. If so, return that.
22 */
23static char *get_opt_postfix(const char *str)
24{
25 char *p = strstr(str, ":");
26
27 if (!p)
28 return NULL;
29
30 p++;
31 strip_blank_front(&p);
32 strip_blank_end(p);
33 return strdup(p);
34}
35
Jens Axboe564ca972007-12-14 12:21:19 +010036static int bs_cmp(const void *p1, const void *p2)
37{
38 const struct bssplit *bsp1 = p1;
39 const struct bssplit *bsp2 = p2;
40
41 return bsp1->perc < bsp2->perc;
42}
43
Jens Axboe720e84a2009-04-21 08:29:55 +020044static int bssplit_ddir(struct thread_data *td, int ddir, char *str)
Jens Axboe564ca972007-12-14 12:21:19 +010045{
Jens Axboe720e84a2009-04-21 08:29:55 +020046 struct bssplit *bssplit;
Jens Axboe564ca972007-12-14 12:21:19 +010047 unsigned int i, perc, perc_missing;
48 unsigned int max_bs, min_bs;
49 long long val;
Jens Axboe720e84a2009-04-21 08:29:55 +020050 char *fname;
Jens Axboe564ca972007-12-14 12:21:19 +010051
Jens Axboe720e84a2009-04-21 08:29:55 +020052 td->o.bssplit_nr[ddir] = 4;
53 bssplit = malloc(4 * sizeof(struct bssplit));
Jens Axboe564ca972007-12-14 12:21:19 +010054
55 i = 0;
56 max_bs = 0;
57 min_bs = -1;
58 while ((fname = strsep(&str, ":")) != NULL) {
59 char *perc_str;
60
61 if (!strlen(fname))
62 break;
63
64 /*
65 * grow struct buffer, if needed
66 */
Jens Axboe720e84a2009-04-21 08:29:55 +020067 if (i == td->o.bssplit_nr[ddir]) {
68 td->o.bssplit_nr[ddir] <<= 1;
69 bssplit = realloc(bssplit, td->o.bssplit_nr[ddir]
Jens Axboe5ec10ea2008-03-06 15:42:00 +010070 * sizeof(struct bssplit));
Jens Axboe564ca972007-12-14 12:21:19 +010071 }
72
73 perc_str = strstr(fname, "/");
74 if (perc_str) {
75 *perc_str = '\0';
76 perc_str++;
77 perc = atoi(perc_str);
78 if (perc > 100)
79 perc = 100;
80 else if (!perc)
81 perc = -1;
82 } else
83 perc = -1;
84
85 if (str_to_decimal(fname, &val, 1)) {
86 log_err("fio: bssplit conversion failed\n");
87 free(td->o.bssplit);
88 return 1;
89 }
90
91 if (val > max_bs)
92 max_bs = val;
93 if (val < min_bs)
94 min_bs = val;
95
Jens Axboe720e84a2009-04-21 08:29:55 +020096 bssplit[i].bs = val;
97 bssplit[i].perc = perc;
Jens Axboe564ca972007-12-14 12:21:19 +010098 i++;
99 }
100
Jens Axboe720e84a2009-04-21 08:29:55 +0200101 td->o.bssplit_nr[ddir] = i;
Jens Axboe564ca972007-12-14 12:21:19 +0100102
103 /*
104 * Now check if the percentages add up, and how much is missing
105 */
106 perc = perc_missing = 0;
Jens Axboe720e84a2009-04-21 08:29:55 +0200107 for (i = 0; i < td->o.bssplit_nr[ddir]; i++) {
108 struct bssplit *bsp = &bssplit[i];
Jens Axboe564ca972007-12-14 12:21:19 +0100109
110 if (bsp->perc == (unsigned char) -1)
111 perc_missing++;
112 else
113 perc += bsp->perc;
114 }
115
116 if (perc > 100) {
117 log_err("fio: bssplit percentages add to more than 100%%\n");
Jens Axboe720e84a2009-04-21 08:29:55 +0200118 free(bssplit);
Jens Axboe564ca972007-12-14 12:21:19 +0100119 return 1;
120 }
121 /*
122 * If values didn't have a percentage set, divide the remains between
123 * them.
124 */
125 if (perc_missing) {
Jens Axboe720e84a2009-04-21 08:29:55 +0200126 for (i = 0; i < td->o.bssplit_nr[ddir]; i++) {
127 struct bssplit *bsp = &bssplit[i];
Jens Axboe564ca972007-12-14 12:21:19 +0100128
129 if (bsp->perc == (unsigned char) -1)
130 bsp->perc = (100 - perc) / perc_missing;
131 }
132 }
133
Jens Axboe720e84a2009-04-21 08:29:55 +0200134 td->o.min_bs[ddir] = min_bs;
135 td->o.max_bs[ddir] = max_bs;
Jens Axboe564ca972007-12-14 12:21:19 +0100136
137 /*
138 * now sort based on percentages, for ease of lookup
139 */
Jens Axboe720e84a2009-04-21 08:29:55 +0200140 qsort(bssplit, td->o.bssplit_nr[ddir], sizeof(struct bssplit), bs_cmp);
141 td->o.bssplit[ddir] = bssplit;
142 return 0;
143
144}
145
146static int str_bssplit_cb(void *data, const char *input)
147{
148 struct thread_data *td = data;
149 char *str, *p, *odir;
150 int ret = 0;
151
152 p = str = strdup(input);
153
154 strip_blank_front(&str);
155 strip_blank_end(str);
156
157 odir = strchr(str, ',');
158 if (odir) {
159 ret = bssplit_ddir(td, DDIR_WRITE, odir + 1);
160 if (!ret) {
161 *odir = '\0';
162 ret = bssplit_ddir(td, DDIR_READ, str);
163 }
164 } else {
165 char *op;
166
167 op = strdup(str);
168
169 ret = bssplit_ddir(td, DDIR_READ, str);
170 if (!ret)
171 ret = bssplit_ddir(td, DDIR_WRITE, op);
172
173 free(op);
174 }
Jens Axboe564ca972007-12-14 12:21:19 +0100175
176 free(p);
Jens Axboe720e84a2009-04-21 08:29:55 +0200177 return ret;
Jens Axboe564ca972007-12-14 12:21:19 +0100178}
179
Jens Axboe211097b2007-03-22 18:56:45 +0100180static int str_rw_cb(void *data, const char *str)
181{
182 struct thread_data *td = data;
183 char *nr = get_opt_postfix(str);
184
Jens Axboefafdba32007-03-26 10:09:12 +0200185 td->o.ddir_nr = 1;
Jens Axboe182ec6e2008-11-14 13:06:06 +0100186 if (nr) {
Jens Axboe211097b2007-03-22 18:56:45 +0100187 td->o.ddir_nr = atoi(nr);
Jens Axboe182ec6e2008-11-14 13:06:06 +0100188 free(nr);
189 }
Jens Axboe211097b2007-03-22 18:56:45 +0100190
Jens Axboe211097b2007-03-22 18:56:45 +0100191 return 0;
192}
193
Jens Axboe214e1ec2007-03-15 10:48:13 +0100194static int str_mem_cb(void *data, const char *mem)
195{
196 struct thread_data *td = data;
197
Jens Axboe2dc1bbe2007-03-15 15:01:33 +0100198 if (td->o.mem_type == MEM_MMAPHUGE || td->o.mem_type == MEM_MMAP) {
Jens Axboe214e1ec2007-03-15 10:48:13 +0100199 td->mmapfile = get_opt_postfix(mem);
Jens Axboe2dc1bbe2007-03-15 15:01:33 +0100200 if (td->o.mem_type == MEM_MMAPHUGE && !td->mmapfile) {
Jens Axboe214e1ec2007-03-15 10:48:13 +0100201 log_err("fio: mmaphuge:/path/to/file\n");
202 return 1;
203 }
204 }
205
206 return 0;
207}
208
209static int str_lockmem_cb(void fio_unused *data, unsigned long *val)
210{
211 mlock_size = *val;
212 return 0;
213}
214
Jens Axboecb499fc2008-05-28 10:33:32 +0200215static int str_rwmix_read_cb(void *data, unsigned int *val)
216{
217 struct thread_data *td = data;
218
219 td->o.rwmix[DDIR_READ] = *val;
220 td->o.rwmix[DDIR_WRITE] = 100 - *val;
221 return 0;
222}
223
224static int str_rwmix_write_cb(void *data, unsigned int *val)
225{
226 struct thread_data *td = data;
227
228 td->o.rwmix[DDIR_WRITE] = *val;
229 td->o.rwmix[DDIR_READ] = 100 - *val;
230 return 0;
231}
232
Jens Axboe214e1ec2007-03-15 10:48:13 +0100233#ifdef FIO_HAVE_IOPRIO
234static int str_prioclass_cb(void *data, unsigned int *val)
235{
236 struct thread_data *td = data;
Jens Axboe6cefbe32007-04-18 12:46:56 +0200237 unsigned short mask;
238
239 /*
240 * mask off old class bits, str_prio_cb() may have set a default class
241 */
242 mask = (1 << IOPRIO_CLASS_SHIFT) - 1;
243 td->ioprio &= mask;
Jens Axboe214e1ec2007-03-15 10:48:13 +0100244
245 td->ioprio |= *val << IOPRIO_CLASS_SHIFT;
Jens Axboeac684782007-11-08 08:29:07 +0100246 td->ioprio_set = 1;
Jens Axboe214e1ec2007-03-15 10:48:13 +0100247 return 0;
248}
249
250static int str_prio_cb(void *data, unsigned int *val)
251{
252 struct thread_data *td = data;
253
254 td->ioprio |= *val;
Jens Axboe6cefbe32007-04-18 12:46:56 +0200255
256 /*
257 * If no class is set, assume BE
258 */
259 if ((td->ioprio >> IOPRIO_CLASS_SHIFT) == 0)
260 td->ioprio |= IOPRIO_CLASS_BE << IOPRIO_CLASS_SHIFT;
261
Jens Axboeac684782007-11-08 08:29:07 +0100262 td->ioprio_set = 1;
Jens Axboe214e1ec2007-03-15 10:48:13 +0100263 return 0;
264}
265#endif
266
267static int str_exitall_cb(void)
268{
269 exitall_on_terminate = 1;
270 return 0;
271}
272
Jens Axboe214e1ec2007-03-15 10:48:13 +0100273#ifdef FIO_HAVE_CPU_AFFINITY
Jens Axboe214e1ec2007-03-15 10:48:13 +0100274static int str_cpumask_cb(void *data, unsigned int *val)
275{
276 struct thread_data *td = data;
Jens Axboed2e268b2007-06-15 10:33:49 +0200277 unsigned int i;
Jens Axboeb03daaf2008-12-08 20:31:43 +0100278 long max_cpu;
Jens Axboed2ce18b2008-12-12 20:51:40 +0100279 int ret;
Jens Axboe214e1ec2007-03-15 10:48:13 +0100280
Jens Axboed2ce18b2008-12-12 20:51:40 +0100281 ret = fio_cpuset_init(&td->o.cpumask);
282 if (ret < 0) {
283 log_err("fio: cpuset_init failed\n");
284 td_verror(td, ret, "fio_cpuset_init");
285 return 1;
286 }
287
Jens Axboeb03daaf2008-12-08 20:31:43 +0100288 max_cpu = sysconf(_SC_NPROCESSORS_ONLN);
Jens Axboed2e268b2007-06-15 10:33:49 +0200289
Jens Axboe62a72732008-12-08 11:37:01 +0100290 for (i = 0; i < sizeof(int) * 8; i++) {
291 if ((1 << i) & *val) {
Jens Axboeb03daaf2008-12-08 20:31:43 +0100292 if (i > max_cpu) {
293 log_err("fio: CPU %d too large (max=%ld)\n", i,
294 max_cpu);
295 return 1;
296 }
Jens Axboe62a72732008-12-08 11:37:01 +0100297 dprint(FD_PARSE, "set cpu allowed %d\n", i);
Jens Axboe6d459ee2008-12-12 20:02:58 +0100298 fio_cpu_set(&td->o.cpumask, i);
Jens Axboe62a72732008-12-08 11:37:01 +0100299 }
300 }
Jens Axboed2e268b2007-06-15 10:33:49 +0200301
Jens Axboe375b2692007-05-22 09:13:02 +0200302 td->o.cpumask_set = 1;
Jens Axboe214e1ec2007-03-15 10:48:13 +0100303 return 0;
304}
305
Jens Axboed2e268b2007-06-15 10:33:49 +0200306static int str_cpus_allowed_cb(void *data, const char *input)
307{
308 struct thread_data *td = data;
309 char *cpu, *str, *p;
Jens Axboeb03daaf2008-12-08 20:31:43 +0100310 long max_cpu;
Jens Axboe19608d62008-12-08 15:03:12 +0100311 int ret = 0;
Jens Axboed2e268b2007-06-15 10:33:49 +0200312
Jens Axboed2ce18b2008-12-12 20:51:40 +0100313 ret = fio_cpuset_init(&td->o.cpumask);
314 if (ret < 0) {
315 log_err("fio: cpuset_init failed\n");
316 td_verror(td, ret, "fio_cpuset_init");
317 return 1;
318 }
Jens Axboed2e268b2007-06-15 10:33:49 +0200319
320 p = str = strdup(input);
321
322 strip_blank_front(&str);
323 strip_blank_end(str);
324
Jens Axboeb03daaf2008-12-08 20:31:43 +0100325 max_cpu = sysconf(_SC_NPROCESSORS_ONLN);
326
Jens Axboed2e268b2007-06-15 10:33:49 +0200327 while ((cpu = strsep(&str, ",")) != NULL) {
Jens Axboe62a72732008-12-08 11:37:01 +0100328 char *str2, *cpu2;
329 int icpu, icpu2;
330
Jens Axboed2e268b2007-06-15 10:33:49 +0200331 if (!strlen(cpu))
332 break;
Jens Axboe62a72732008-12-08 11:37:01 +0100333
334 str2 = cpu;
335 icpu2 = -1;
336 while ((cpu2 = strsep(&str2, "-")) != NULL) {
337 if (!strlen(cpu2))
338 break;
339
340 icpu2 = atoi(cpu2);
341 }
342
343 icpu = atoi(cpu);
344 if (icpu2 == -1)
345 icpu2 = icpu;
346 while (icpu <= icpu2) {
Jens Axboe6d459ee2008-12-12 20:02:58 +0100347 if (icpu >= FIO_MAX_CPUS) {
Jens Axboe19608d62008-12-08 15:03:12 +0100348 log_err("fio: your OS only supports up to"
Jens Axboe6d459ee2008-12-12 20:02:58 +0100349 " %d CPUs\n", (int) FIO_MAX_CPUS);
Jens Axboe19608d62008-12-08 15:03:12 +0100350 ret = 1;
351 break;
352 }
Jens Axboeb03daaf2008-12-08 20:31:43 +0100353 if (icpu > max_cpu) {
354 log_err("fio: CPU %d too large (max=%ld)\n",
355 icpu, max_cpu);
356 ret = 1;
357 break;
358 }
359
Jens Axboe62a72732008-12-08 11:37:01 +0100360 dprint(FD_PARSE, "set cpu allowed %d\n", icpu);
Jens Axboe6d459ee2008-12-12 20:02:58 +0100361 fio_cpu_set(&td->o.cpumask, icpu);
Jens Axboe62a72732008-12-08 11:37:01 +0100362 icpu++;
363 }
Jens Axboe19608d62008-12-08 15:03:12 +0100364 if (ret)
365 break;
Jens Axboed2e268b2007-06-15 10:33:49 +0200366 }
367
368 free(p);
Jens Axboe19608d62008-12-08 15:03:12 +0100369 if (!ret)
370 td->o.cpumask_set = 1;
371 return ret;
Jens Axboed2e268b2007-06-15 10:33:49 +0200372}
373#endif
374
Jens Axboe214e1ec2007-03-15 10:48:13 +0100375static int str_fst_cb(void *data, const char *str)
376{
377 struct thread_data *td = data;
378 char *nr = get_opt_postfix(str);
379
380 td->file_service_nr = 1;
Jens Axboe182ec6e2008-11-14 13:06:06 +0100381 if (nr) {
Jens Axboe214e1ec2007-03-15 10:48:13 +0100382 td->file_service_nr = atoi(nr);
Jens Axboe182ec6e2008-11-14 13:06:06 +0100383 free(nr);
384 }
Jens Axboe214e1ec2007-03-15 10:48:13 +0100385
386 return 0;
387}
388
Jens Axboe921c7662008-03-26 09:17:55 +0100389static int check_dir(struct thread_data *td, char *fname)
390{
391 char file[PATH_MAX], *dir;
Jens Axboebc838912008-04-07 09:00:54 +0200392 int elen = 0;
Jens Axboe921c7662008-03-26 09:17:55 +0100393
Jens Axboebc838912008-04-07 09:00:54 +0200394 if (td->o.directory) {
395 strcpy(file, td->o.directory);
Jens Axboefcef0b32008-05-26 14:53:24 +0200396 strcat(file, "/");
Jens Axboebc838912008-04-07 09:00:54 +0200397 elen = strlen(file);
398 }
399
Jens Axboefcef0b32008-05-26 14:53:24 +0200400 sprintf(file + elen, "%s", fname);
Jens Axboe921c7662008-03-26 09:17:55 +0100401 dir = dirname(file);
402
Jens Axboefcef0b32008-05-26 14:53:24 +0200403#if 0
404 {
405 struct stat sb;
406 /*
407 * We can't do this on FIO_DISKLESSIO engines. The engine isn't loaded
408 * yet, so we can't do this check right here...
409 */
Jens Axboe921c7662008-03-26 09:17:55 +0100410 if (lstat(dir, &sb) < 0) {
411 int ret = errno;
412
413 log_err("fio: %s is not a directory\n", dir);
414 td_verror(td, ret, "lstat");
415 return 1;
416 }
417
418 if (!S_ISDIR(sb.st_mode)) {
419 log_err("fio: %s is not a directory\n", dir);
420 return 1;
421 }
Jens Axboefcef0b32008-05-26 14:53:24 +0200422 }
423#endif
Jens Axboe921c7662008-03-26 09:17:55 +0100424
425 return 0;
426}
427
Jens Axboe214e1ec2007-03-15 10:48:13 +0100428static int str_filename_cb(void *data, const char *input)
429{
430 struct thread_data *td = data;
431 char *fname, *str, *p;
432
433 p = str = strdup(input);
434
435 strip_blank_front(&str);
436 strip_blank_end(str);
437
438 if (!td->files_index)
Jens Axboe2dc1bbe2007-03-15 15:01:33 +0100439 td->o.nr_files = 0;
Jens Axboe214e1ec2007-03-15 10:48:13 +0100440
441 while ((fname = strsep(&str, ":")) != NULL) {
442 if (!strlen(fname))
443 break;
Jens Axboe921c7662008-03-26 09:17:55 +0100444 if (check_dir(td, fname)) {
445 free(p);
446 return 1;
447 }
Jens Axboe214e1ec2007-03-15 10:48:13 +0100448 add_file(td, fname);
Jens Axboe2dc1bbe2007-03-15 15:01:33 +0100449 td->o.nr_files++;
Jens Axboe214e1ec2007-03-15 10:48:13 +0100450 }
451
452 free(p);
453 return 0;
454}
455
456static int str_directory_cb(void *data, const char fio_unused *str)
457{
458 struct thread_data *td = data;
459 struct stat sb;
460
Jens Axboe2dc1bbe2007-03-15 15:01:33 +0100461 if (lstat(td->o.directory, &sb) < 0) {
Jens Axboe921c7662008-03-26 09:17:55 +0100462 int ret = errno;
463
Jens Axboe2dc1bbe2007-03-15 15:01:33 +0100464 log_err("fio: %s is not a directory\n", td->o.directory);
Jens Axboe921c7662008-03-26 09:17:55 +0100465 td_verror(td, ret, "lstat");
Jens Axboe214e1ec2007-03-15 10:48:13 +0100466 return 1;
467 }
468 if (!S_ISDIR(sb.st_mode)) {
Jens Axboe2dc1bbe2007-03-15 15:01:33 +0100469 log_err("fio: %s is not a directory\n", td->o.directory);
Jens Axboe214e1ec2007-03-15 10:48:13 +0100470 return 1;
471 }
472
473 return 0;
474}
475
476static int str_opendir_cb(void *data, const char fio_unused *str)
477{
478 struct thread_data *td = data;
479
480 if (!td->files_index)
Jens Axboe2dc1bbe2007-03-15 15:01:33 +0100481 td->o.nr_files = 0;
Jens Axboe214e1ec2007-03-15 10:48:13 +0100482
Jens Axboe2dc1bbe2007-03-15 15:01:33 +0100483 return add_dir_files(td, td->o.opendir);
Jens Axboe214e1ec2007-03-15 10:48:13 +0100484}
485
Jens Axboea59e1702007-07-30 08:53:27 +0200486static int str_verify_offset_cb(void *data, unsigned int *off)
Shawn Lewis546a9142007-07-28 21:11:37 +0200487{
488 struct thread_data *td = data;
Jens Axboea59e1702007-07-30 08:53:27 +0200489
Shawn Lewis546a9142007-07-28 21:11:37 +0200490 if (*off && *off < sizeof(struct verify_header)) {
Jens Axboea59e1702007-07-30 08:53:27 +0200491 log_err("fio: verify_offset too small\n");
Shawn Lewis546a9142007-07-28 21:11:37 +0200492 return 1;
493 }
Jens Axboea59e1702007-07-30 08:53:27 +0200494
495 td->o.verify_offset = *off;
Shawn Lewis546a9142007-07-28 21:11:37 +0200496 return 0;
497}
498
Shawn Lewise28218f2008-01-16 11:01:33 +0100499static int str_verify_pattern_cb(void *data, unsigned int *off)
Jens Axboe90059d62007-07-30 09:33:12 +0200500{
501 struct thread_data *td = data;
Shawn Lewise28218f2008-01-16 11:01:33 +0100502 unsigned int msb;
Jens Axboe90059d62007-07-30 09:33:12 +0200503
Jens Axboe3c48c2c2008-06-02 12:22:30 +0200504 msb = __fls(*off);
Jens Axboe90059d62007-07-30 09:33:12 +0200505 if (msb <= 8)
506 td->o.verify_pattern_bytes = 1;
507 else if (msb <= 16)
508 td->o.verify_pattern_bytes = 2;
509 else if (msb <= 24)
510 td->o.verify_pattern_bytes = 3;
511 else
512 td->o.verify_pattern_bytes = 4;
513
Shawn Lewise28218f2008-01-16 11:01:33 +0100514 td->o.verify_pattern = *off;
Jens Axboe90059d62007-07-30 09:33:12 +0200515 return 0;
516}
Jens Axboe214e1ec2007-03-15 10:48:13 +0100517
Jens Axboe4d4e80f2008-03-04 10:18:56 +0100518static int str_lockfile_cb(void *data, const char *str)
519{
520 struct thread_data *td = data;
521 char *nr = get_opt_postfix(str);
522
523 td->o.lockfile_batch = 1;
Jens Axboe182ec6e2008-11-14 13:06:06 +0100524 if (nr) {
Jens Axboe4d4e80f2008-03-04 10:18:56 +0100525 td->o.lockfile_batch = atoi(nr);
Jens Axboe182ec6e2008-11-14 13:06:06 +0100526 free(nr);
527 }
Jens Axboe4d4e80f2008-03-04 10:18:56 +0100528
529 return 0;
530}
531
Jens Axboee3cedca2008-11-19 19:57:52 +0100532static int str_write_bw_log_cb(void *data, const char *str)
533{
534 struct thread_data *td = data;
535
536 if (str)
537 td->o.bw_log_file = strdup(str);
538
539 td->o.write_bw_log = 1;
540 return 0;
541}
542
543static int str_write_lat_log_cb(void *data, const char *str)
544{
545 struct thread_data *td = data;
546
547 if (str)
548 td->o.lat_log_file = strdup(str);
549
550 td->o.write_lat_log = 1;
551 return 0;
552}
553
Jens Axboe993bf482008-11-14 13:04:53 +0100554static int str_gtod_reduce_cb(void *data, int *il)
555{
556 struct thread_data *td = data;
557 int val = *il;
558
559 td->o.disable_clat = !!val;
560 td->o.disable_slat = !!val;
561 td->o.disable_bw = !!val;
562 if (val)
563 td->tv_cache_mask = 63;
564
565 return 0;
566}
567
Jens Axboebe4ecfd2008-12-08 14:10:52 +0100568static int str_gtod_cpu_cb(void *data, int *il)
569{
570 struct thread_data *td = data;
571 int val = *il;
572
573 td->o.gtod_cpu = val;
574 td->o.gtod_offload = 1;
575 return 0;
576}
577
Jens Axboe896cac22009-07-01 10:38:35 +0200578static int rw_verify(struct fio_option *o, void *data)
579{
580 struct thread_data *td = data;
581
582 if (read_only && td_write(td)) {
583 log_err("fio: job <%s> has write bit set, but fio is in"
584 " read-only mode\n", td->o.name);
585 return 1;
586 }
587
588 return 0;
589}
590
Jens Axboe276ca4f2009-07-01 10:43:05 +0200591static int gtod_cpu_verify(struct fio_option *o, void *data)
Jens Axboe29d43ff2009-07-01 10:42:18 +0200592{
Jens Axboe276ca4f2009-07-01 10:43:05 +0200593#ifndef FIO_HAVE_CPU_AFFINITY
Jens Axboe29d43ff2009-07-01 10:42:18 +0200594 struct thread_data *td = data;
595
Jens Axboe29d43ff2009-07-01 10:42:18 +0200596 if (td->o.gtod_cpu) {
597 log_err("fio: platform must support CPU affinity for"
598 "gettimeofday() offloading\n");
599 return 1;
600 }
601#endif
602
603 return 0;
604}
605
Jens Axboe214e1ec2007-03-15 10:48:13 +0100606#define __stringify_1(x) #x
607#define __stringify(x) __stringify_1(x)
608
609/*
610 * Map of job/command line options
611 */
612static struct fio_option options[] = {
613 {
614 .name = "description",
615 .type = FIO_OPT_STR_STORE,
616 .off1 = td_var_offset(description),
617 .help = "Text job description",
618 },
619 {
620 .name = "name",
621 .type = FIO_OPT_STR_STORE,
622 .off1 = td_var_offset(name),
623 .help = "Name of this job",
624 },
625 {
626 .name = "directory",
627 .type = FIO_OPT_STR_STORE,
628 .off1 = td_var_offset(directory),
629 .cb = str_directory_cb,
630 .help = "Directory to store files in",
631 },
632 {
633 .name = "filename",
634 .type = FIO_OPT_STR_STORE,
635 .off1 = td_var_offset(filename),
636 .cb = str_filename_cb,
Jens Axboef0d524b2009-04-27 08:00:48 +0200637 .prio = -1, /* must come after "directory" */
Jens Axboe214e1ec2007-03-15 10:48:13 +0100638 .help = "File(s) to use for the workload",
639 },
640 {
Jens Axboe29c13492008-03-01 19:25:20 +0100641 .name = "lockfile",
Jens Axboe4d4e80f2008-03-04 10:18:56 +0100642 .type = FIO_OPT_STR,
643 .cb = str_lockfile_cb,
644 .off1 = td_var_offset(file_lock_mode),
Jens Axboe29c13492008-03-01 19:25:20 +0100645 .help = "Lock file when doing IO to it",
646 .parent = "filename",
Jens Axboe4d4e80f2008-03-04 10:18:56 +0100647 .def = "none",
648 .posval = {
649 { .ival = "none",
650 .oval = FILE_LOCK_NONE,
651 .help = "No file locking",
652 },
653 { .ival = "exclusive",
654 .oval = FILE_LOCK_EXCLUSIVE,
655 .help = "Exclusive file lock",
656 },
657 {
658 .ival = "readwrite",
659 .oval = FILE_LOCK_READWRITE,
660 .help = "Read vs write lock",
661 },
662 },
Jens Axboe29c13492008-03-01 19:25:20 +0100663 },
664 {
Jens Axboe214e1ec2007-03-15 10:48:13 +0100665 .name = "opendir",
666 .type = FIO_OPT_STR_STORE,
667 .off1 = td_var_offset(opendir),
668 .cb = str_opendir_cb,
669 .help = "Recursively add files from this directory and down",
670 },
671 {
672 .name = "rw",
Jens Axboed3aad8f2007-03-15 14:12:05 +0100673 .alias = "readwrite",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100674 .type = FIO_OPT_STR,
Jens Axboe211097b2007-03-22 18:56:45 +0100675 .cb = str_rw_cb,
Jens Axboe214e1ec2007-03-15 10:48:13 +0100676 .off1 = td_var_offset(td_ddir),
677 .help = "IO direction",
678 .def = "read",
Jens Axboe896cac22009-07-01 10:38:35 +0200679 .verify = rw_verify,
Jens Axboe214e1ec2007-03-15 10:48:13 +0100680 .posval = {
681 { .ival = "read",
682 .oval = TD_DDIR_READ,
683 .help = "Sequential read",
684 },
685 { .ival = "write",
686 .oval = TD_DDIR_WRITE,
687 .help = "Sequential write",
688 },
689 { .ival = "randread",
690 .oval = TD_DDIR_RANDREAD,
691 .help = "Random read",
692 },
693 { .ival = "randwrite",
694 .oval = TD_DDIR_RANDWRITE,
695 .help = "Random write",
696 },
697 { .ival = "rw",
698 .oval = TD_DDIR_RW,
699 .help = "Sequential read and write mix",
700 },
701 { .ival = "randrw",
702 .oval = TD_DDIR_RANDRW,
703 .help = "Random read and write mix"
704 },
705 },
706 },
707 {
708 .name = "ioengine",
709 .type = FIO_OPT_STR_STORE,
710 .off1 = td_var_offset(ioengine),
711 .help = "IO engine to use",
712 .def = "sync",
713 .posval = {
714 { .ival = "sync",
715 .help = "Use read/write",
716 },
gurudas paia31041e2007-10-23 15:12:30 +0200717 { .ival = "psync",
718 .help = "Use pread/pwrite",
719 },
Jens Axboe1d2af022008-02-04 10:59:07 +0100720 { .ival = "vsync",
721 .help = "Use readv/writev",
722 },
Jens Axboe214e1ec2007-03-15 10:48:13 +0100723#ifdef FIO_HAVE_LIBAIO
724 { .ival = "libaio",
725 .help = "Linux native asynchronous IO",
726 },
727#endif
728#ifdef FIO_HAVE_POSIXAIO
729 { .ival = "posixaio",
730 .help = "POSIX asynchronous IO",
731 },
732#endif
Jens Axboe417f0062008-06-02 11:59:30 +0200733#ifdef FIO_HAVE_SOLARISAIO
734 { .ival = "solarisaio",
735 .help = "Solaris native asynchronous IO",
736 },
737#endif
Jens Axboe214e1ec2007-03-15 10:48:13 +0100738 { .ival = "mmap",
739 .help = "Memory mapped IO",
740 },
741#ifdef FIO_HAVE_SPLICE
742 { .ival = "splice",
743 .help = "splice/vmsplice based IO",
744 },
Jens Axboe9cce02e2007-06-22 15:42:21 +0200745 { .ival = "netsplice",
746 .help = "splice/vmsplice to/from the network",
747 },
Jens Axboe214e1ec2007-03-15 10:48:13 +0100748#endif
749#ifdef FIO_HAVE_SGIO
750 { .ival = "sg",
751 .help = "SCSI generic v3 IO",
752 },
753#endif
754 { .ival = "null",
755 .help = "Testing engine (no data transfer)",
756 },
757 { .ival = "net",
758 .help = "Network IO",
759 },
760#ifdef FIO_HAVE_SYSLET
761 { .ival = "syslet-rw",
762 .help = "syslet enabled async pread/pwrite IO",
763 },
764#endif
765 { .ival = "cpuio",
766 .help = "CPU cycler burner engine",
767 },
Jens Axboeb8c82a42007-03-21 08:48:26 +0100768#ifdef FIO_HAVE_GUASI
769 { .ival = "guasi",
770 .help = "GUASI IO engine",
771 },
772#endif
Jens Axboe214e1ec2007-03-15 10:48:13 +0100773 { .ival = "external",
774 .help = "Load external engine (append name)",
775 },
776 },
777 },
778 {
779 .name = "iodepth",
780 .type = FIO_OPT_INT,
781 .off1 = td_var_offset(iodepth),
782 .help = "Amount of IO buffers to keep in flight",
Jens Axboe757aff42007-12-12 19:42:13 +0100783 .minval = 1,
Jens Axboe214e1ec2007-03-15 10:48:13 +0100784 .def = "1",
785 },
786 {
787 .name = "iodepth_batch",
Jens Axboe49504212008-06-05 09:03:30 +0200788 .alias = "iodepth_batch_submit",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100789 .type = FIO_OPT_INT,
790 .off1 = td_var_offset(iodepth_batch),
Jens Axboed65db442009-01-16 19:15:33 +0100791 .help = "Number of IO buffers to submit in one go",
Jens Axboeafdf9352007-07-31 16:14:34 +0200792 .parent = "iodepth",
Jens Axboea2e6f8a2008-01-18 10:28:11 +0100793 .minval = 1,
794 .def = "1",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100795 },
796 {
Jens Axboe49504212008-06-05 09:03:30 +0200797 .name = "iodepth_batch_complete",
798 .type = FIO_OPT_INT,
799 .off1 = td_var_offset(iodepth_batch_complete),
Jens Axboed65db442009-01-16 19:15:33 +0100800 .help = "Number of IO buffers to retrieve in one go",
Jens Axboe49504212008-06-05 09:03:30 +0200801 .parent = "iodepth",
802 .minval = 0,
803 .def = "1",
804 },
805 {
Jens Axboe214e1ec2007-03-15 10:48:13 +0100806 .name = "iodepth_low",
807 .type = FIO_OPT_INT,
808 .off1 = td_var_offset(iodepth_low),
809 .help = "Low water mark for queuing depth",
Jens Axboeafdf9352007-07-31 16:14:34 +0200810 .parent = "iodepth",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100811 },
812 {
813 .name = "size",
814 .type = FIO_OPT_STR_VAL,
Jens Axboe2dc1bbe2007-03-15 15:01:33 +0100815 .off1 = td_var_offset(size),
Jens Axboec3edbdb2007-07-20 14:25:31 +0200816 .minval = 1,
Jens Axboe214e1ec2007-03-15 10:48:13 +0100817 .help = "Total size of device or files",
818 },
819 {
Shawn Lewisaa31f1f2008-01-11 09:45:11 +0100820 .name = "fill_device",
821 .type = FIO_OPT_BOOL,
822 .off1 = td_var_offset(fill_device),
823 .help = "Write until an ENOSPC error occurs",
824 .def = "0",
825 },
826 {
Jens Axboe214e1ec2007-03-15 10:48:13 +0100827 .name = "filesize",
828 .type = FIO_OPT_STR_VAL,
829 .off1 = td_var_offset(file_size_low),
830 .off2 = td_var_offset(file_size_high),
Jens Axboec3edbdb2007-07-20 14:25:31 +0200831 .minval = 1,
Jens Axboe214e1ec2007-03-15 10:48:13 +0100832 .help = "Size of individual files",
833 },
834 {
Jens Axboe67a10002007-07-31 23:12:16 +0200835 .name = "offset",
836 .alias = "fileoffset",
837 .type = FIO_OPT_STR_VAL,
838 .off1 = td_var_offset(start_offset),
839 .help = "Start IO from this offset",
840 .def = "0",
841 },
842 {
Jens Axboe214e1ec2007-03-15 10:48:13 +0100843 .name = "bs",
Jens Axboed3aad8f2007-03-15 14:12:05 +0100844 .alias = "blocksize",
Jens Axboee01b22b2009-06-09 15:43:25 +0200845 .type = FIO_OPT_INT,
Jens Axboe214e1ec2007-03-15 10:48:13 +0100846 .off1 = td_var_offset(bs[DDIR_READ]),
847 .off2 = td_var_offset(bs[DDIR_WRITE]),
Jens Axboec3edbdb2007-07-20 14:25:31 +0200848 .minval = 1,
Jens Axboe214e1ec2007-03-15 10:48:13 +0100849 .help = "Block size unit",
850 .def = "4k",
Jens Axboe67a10002007-07-31 23:12:16 +0200851 .parent = "rw",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100852 },
853 {
Jens Axboe2b7a01d2009-03-11 11:00:13 +0100854 .name = "ba",
855 .alias = "blockalign",
Jens Axboee01b22b2009-06-09 15:43:25 +0200856 .type = FIO_OPT_INT,
Jens Axboe2b7a01d2009-03-11 11:00:13 +0100857 .off1 = td_var_offset(ba[DDIR_READ]),
858 .off2 = td_var_offset(ba[DDIR_WRITE]),
859 .minval = 1,
860 .help = "IO block offset alignment",
861 .parent = "rw",
862 },
863 {
Jens Axboe214e1ec2007-03-15 10:48:13 +0100864 .name = "bsrange",
Jens Axboed3aad8f2007-03-15 14:12:05 +0100865 .alias = "blocksize_range",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100866 .type = FIO_OPT_RANGE,
867 .off1 = td_var_offset(min_bs[DDIR_READ]),
868 .off2 = td_var_offset(max_bs[DDIR_READ]),
869 .off3 = td_var_offset(min_bs[DDIR_WRITE]),
870 .off4 = td_var_offset(max_bs[DDIR_WRITE]),
Jens Axboec3edbdb2007-07-20 14:25:31 +0200871 .minval = 1,
Jens Axboe214e1ec2007-03-15 10:48:13 +0100872 .help = "Set block size range (in more detail than bs)",
Jens Axboe67a10002007-07-31 23:12:16 +0200873 .parent = "rw",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100874 },
875 {
Jens Axboe564ca972007-12-14 12:21:19 +0100876 .name = "bssplit",
877 .type = FIO_OPT_STR,
878 .cb = str_bssplit_cb,
879 .help = "Set a specific mix of block sizes",
880 .parent = "rw",
881 },
882 {
Jens Axboe214e1ec2007-03-15 10:48:13 +0100883 .name = "bs_unaligned",
Jens Axboed3aad8f2007-03-15 14:12:05 +0100884 .alias = "blocksize_unaligned",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100885 .type = FIO_OPT_STR_SET,
886 .off1 = td_var_offset(bs_unaligned),
887 .help = "Don't sector align IO buffer sizes",
Jens Axboe67a10002007-07-31 23:12:16 +0200888 .parent = "rw",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100889 },
890 {
891 .name = "randrepeat",
892 .type = FIO_OPT_BOOL,
893 .off1 = td_var_offset(rand_repeatable),
894 .help = "Use repeatable random IO pattern",
895 .def = "1",
Jens Axboe67a10002007-07-31 23:12:16 +0200896 .parent = "rw",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100897 },
898 {
899 .name = "norandommap",
900 .type = FIO_OPT_STR_SET,
901 .off1 = td_var_offset(norandommap),
902 .help = "Accept potential duplicate random blocks",
Jens Axboe67a10002007-07-31 23:12:16 +0200903 .parent = "rw",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100904 },
905 {
Jens Axboe2b386d22008-03-26 10:32:57 +0100906 .name = "softrandommap",
907 .type = FIO_OPT_BOOL,
908 .off1 = td_var_offset(softrandommap),
Jens Axboef66ab3c2008-06-05 11:48:22 +0200909 .help = "Set norandommap if randommap allocation fails",
Jens Axboe2b386d22008-03-26 10:32:57 +0100910 .parent = "norandommap",
911 .def = "0",
912 },
913 {
Jens Axboe214e1ec2007-03-15 10:48:13 +0100914 .name = "nrfiles",
915 .type = FIO_OPT_INT,
916 .off1 = td_var_offset(nr_files),
917 .help = "Split job workload between this number of files",
918 .def = "1",
919 },
920 {
921 .name = "openfiles",
922 .type = FIO_OPT_INT,
923 .off1 = td_var_offset(open_files),
924 .help = "Number of files to keep open at the same time",
925 },
926 {
927 .name = "file_service_type",
928 .type = FIO_OPT_STR,
929 .cb = str_fst_cb,
930 .off1 = td_var_offset(file_service_type),
931 .help = "How to select which file to service next",
932 .def = "roundrobin",
933 .posval = {
934 { .ival = "random",
935 .oval = FIO_FSERVICE_RANDOM,
936 .help = "Choose a file at random",
937 },
938 { .ival = "roundrobin",
939 .oval = FIO_FSERVICE_RR,
940 .help = "Round robin select files",
941 },
Jens Axboea086c252009-03-04 08:27:37 +0100942 { .ival = "sequential",
943 .oval = FIO_FSERVICE_SEQ,
944 .help = "Finish one file before moving to the next",
945 },
Jens Axboe214e1ec2007-03-15 10:48:13 +0100946 },
Jens Axboe67a10002007-07-31 23:12:16 +0200947 .parent = "nrfiles",
948 },
949 {
950 .name = "fadvise_hint",
951 .type = FIO_OPT_BOOL,
952 .off1 = td_var_offset(fadvise_hint),
953 .help = "Use fadvise() to advise the kernel on IO pattern",
954 .def = "1",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100955 },
956 {
957 .name = "fsync",
958 .type = FIO_OPT_INT,
959 .off1 = td_var_offset(fsync_blocks),
960 .help = "Issue fsync for writes every given number of blocks",
961 .def = "0",
962 },
963 {
Jens Axboe5f9099e2009-06-16 22:40:26 +0200964 .name = "fdatasync",
965 .type = FIO_OPT_INT,
966 .off1 = td_var_offset(fdatasync_blocks),
967 .help = "Issue fdatasync for writes every given number of blocks",
968 .def = "0",
969 },
970 {
Jens Axboe214e1ec2007-03-15 10:48:13 +0100971 .name = "direct",
972 .type = FIO_OPT_BOOL,
973 .off1 = td_var_offset(odirect),
974 .help = "Use O_DIRECT IO (negates buffered)",
975 .def = "0",
976 },
977 {
978 .name = "buffered",
979 .type = FIO_OPT_BOOL,
980 .off1 = td_var_offset(odirect),
981 .neg = 1,
982 .help = "Use buffered IO (negates direct)",
983 .def = "1",
984 },
985 {
986 .name = "overwrite",
987 .type = FIO_OPT_BOOL,
988 .off1 = td_var_offset(overwrite),
989 .help = "When writing, set whether to overwrite current data",
990 .def = "0",
991 },
992 {
993 .name = "loops",
994 .type = FIO_OPT_INT,
995 .off1 = td_var_offset(loops),
996 .help = "Number of times to run the job",
997 .def = "1",
998 },
999 {
1000 .name = "numjobs",
1001 .type = FIO_OPT_INT,
1002 .off1 = td_var_offset(numjobs),
1003 .help = "Duplicate this job this many times",
1004 .def = "1",
1005 },
1006 {
1007 .name = "startdelay",
1008 .type = FIO_OPT_INT,
1009 .off1 = td_var_offset(start_delay),
1010 .help = "Only start job when this period has passed",
1011 .def = "0",
1012 },
1013 {
1014 .name = "runtime",
1015 .alias = "timeout",
1016 .type = FIO_OPT_STR_VAL_TIME,
1017 .off1 = td_var_offset(timeout),
1018 .help = "Stop workload when this amount of time has passed",
1019 .def = "0",
1020 },
1021 {
Jens Axboecf4464c2007-04-17 20:14:42 +02001022 .name = "time_based",
1023 .type = FIO_OPT_STR_SET,
1024 .off1 = td_var_offset(time_based),
1025 .help = "Keep running until runtime/timeout is met",
1026 },
1027 {
Jens Axboe721938a2008-09-10 09:46:16 +02001028 .name = "ramp_time",
1029 .type = FIO_OPT_STR_VAL_TIME,
1030 .off1 = td_var_offset(ramp_time),
1031 .help = "Ramp up time before measuring performance",
1032 },
1033 {
Jens Axboe214e1ec2007-03-15 10:48:13 +01001034 .name = "mem",
Jens Axboed3aad8f2007-03-15 14:12:05 +01001035 .alias = "iomem",
Jens Axboe214e1ec2007-03-15 10:48:13 +01001036 .type = FIO_OPT_STR,
1037 .cb = str_mem_cb,
1038 .off1 = td_var_offset(mem_type),
1039 .help = "Backing type for IO buffers",
1040 .def = "malloc",
1041 .posval = {
1042 { .ival = "malloc",
1043 .oval = MEM_MALLOC,
1044 .help = "Use malloc(3) for IO buffers",
1045 },
Jens Axboeb370e462007-03-19 10:51:49 +01001046 { .ival = "shm",
1047 .oval = MEM_SHM,
1048 .help = "Use shared memory segments for IO buffers",
Jens Axboe214e1ec2007-03-15 10:48:13 +01001049 },
1050#ifdef FIO_HAVE_HUGETLB
Jens Axboe37c8cdf2007-03-19 13:14:03 +01001051 { .ival = "shmhuge",
1052 .oval = MEM_SHMHUGE,
1053 .help = "Like shm, but use huge pages",
Jens Axboe214e1ec2007-03-15 10:48:13 +01001054 },
1055#endif
Jens Axboeb370e462007-03-19 10:51:49 +01001056 { .ival = "mmap",
1057 .oval = MEM_MMAP,
1058 .help = "Use mmap(2) (file or anon) for IO buffers",
1059 },
Jens Axboe37c8cdf2007-03-19 13:14:03 +01001060#ifdef FIO_HAVE_HUGETLB
1061 { .ival = "mmaphuge",
1062 .oval = MEM_MMAPHUGE,
1063 .help = "Like mmap, but use huge pages",
1064 },
1065#endif
Jens Axboe214e1ec2007-03-15 10:48:13 +01001066 },
1067 },
1068 {
Jens Axboed529ee12009-07-01 10:33:03 +02001069 .name = "iomem_align",
1070 .alias = "mem_align",
1071 .type = FIO_OPT_INT,
1072 .off1 = td_var_offset(mem_align),
1073 .minval = 0,
1074 .help = "IO memory buffer offset alignment",
1075 .def = "0",
1076 .parent = "iomem",
1077 },
1078 {
Jens Axboe214e1ec2007-03-15 10:48:13 +01001079 .name = "verify",
1080 .type = FIO_OPT_STR,
1081 .off1 = td_var_offset(verify),
1082 .help = "Verify data written",
1083 .def = "0",
1084 .posval = {
1085 { .ival = "0",
1086 .oval = VERIFY_NONE,
1087 .help = "Don't do IO verification",
1088 },
Jens Axboefcca4b52007-07-27 15:42:00 +02001089 { .ival = "md5",
1090 .oval = VERIFY_MD5,
1091 .help = "Use md5 checksums for verification",
1092 },
Jens Axboed77a7af2007-07-27 15:35:06 +02001093 { .ival = "crc64",
1094 .oval = VERIFY_CRC64,
1095 .help = "Use crc64 checksums for verification",
1096 },
Jens Axboe214e1ec2007-03-15 10:48:13 +01001097 { .ival = "crc32",
1098 .oval = VERIFY_CRC32,
1099 .help = "Use crc32 checksums for verification",
1100 },
Jens Axboeaf497e62008-08-04 15:40:35 +02001101 { .ival = "crc32c-intel",
1102 .oval = VERIFY_CRC32C_INTEL,
1103 .help = "Use hw crc32c checksums for verification",
1104 },
Jens Axboebac39e02008-06-11 20:46:19 +02001105 { .ival = "crc32c",
1106 .oval = VERIFY_CRC32C,
1107 .help = "Use crc32c checksums for verification",
1108 },
Jens Axboe969f7ed2007-07-27 09:07:17 +02001109 { .ival = "crc16",
1110 .oval = VERIFY_CRC16,
1111 .help = "Use crc16 checksums for verification",
1112 },
Jens Axboe1e154bd2007-07-27 09:52:40 +02001113 { .ival = "crc7",
1114 .oval = VERIFY_CRC7,
1115 .help = "Use crc7 checksums for verification",
1116 },
Jens Axboecd14cc12007-07-30 10:59:33 +02001117 { .ival = "sha256",
1118 .oval = VERIFY_SHA256,
1119 .help = "Use sha256 checksums for verification",
1120 },
1121 { .ival = "sha512",
1122 .oval = VERIFY_SHA512,
1123 .help = "Use sha512 checksums for verification",
1124 },
Shawn Lewis7437ee82007-08-02 21:05:58 +02001125 { .ival = "meta",
1126 .oval = VERIFY_META,
1127 .help = "Use io information",
1128 },
Jens Axboe36690c92007-03-26 10:23:34 +02001129 {
1130 .ival = "null",
1131 .oval = VERIFY_NULL,
1132 .help = "Pretend to verify",
1133 },
Jens Axboe214e1ec2007-03-15 10:48:13 +01001134 },
1135 },
1136 {
Jens Axboe005c5652007-08-02 22:21:36 +02001137 .name = "do_verify",
Jens Axboe68e1f292007-08-10 10:32:14 +02001138 .type = FIO_OPT_BOOL,
Jens Axboe005c5652007-08-02 22:21:36 +02001139 .off1 = td_var_offset(do_verify),
1140 .help = "Run verification stage after write",
1141 .def = "1",
1142 .parent = "verify",
1143 },
1144 {
Jens Axboe160b9662007-03-27 10:59:49 +02001145 .name = "verifysort",
1146 .type = FIO_OPT_BOOL,
1147 .off1 = td_var_offset(verifysort),
1148 .help = "Sort written verify blocks for read back",
1149 .def = "1",
Jens Axboec83f2df2007-07-31 22:51:47 +02001150 .parent = "verify",
Jens Axboe160b9662007-03-27 10:59:49 +02001151 },
1152 {
Jens Axboea59e1702007-07-30 08:53:27 +02001153 .name = "verify_interval",
Jens Axboee01b22b2009-06-09 15:43:25 +02001154 .type = FIO_OPT_INT,
Jens Axboea59e1702007-07-30 08:53:27 +02001155 .off1 = td_var_offset(verify_interval),
Jens Axboe819a9682007-07-28 21:30:31 +02001156 .minval = 2 * sizeof(struct verify_header),
Jens Axboea59e1702007-07-30 08:53:27 +02001157 .help = "Store verify buffer header every N bytes",
Jens Axboeafdf9352007-07-31 16:14:34 +02001158 .parent = "verify",
Shawn Lewis3f9f4e22007-07-28 21:10:37 +02001159 },
1160 {
Jens Axboea59e1702007-07-30 08:53:27 +02001161 .name = "verify_offset",
Jens Axboee01b22b2009-06-09 15:43:25 +02001162 .type = FIO_OPT_INT,
Jens Axboea59e1702007-07-30 08:53:27 +02001163 .help = "Offset verify header location by N bytes",
Shawn Lewis546a9142007-07-28 21:11:37 +02001164 .def = "0",
Jens Axboe5ec10ea2008-03-06 15:42:00 +01001165 .cb = str_verify_offset_cb,
Jens Axboeafdf9352007-07-31 16:14:34 +02001166 .parent = "verify",
Shawn Lewis546a9142007-07-28 21:11:37 +02001167 },
1168 {
Shawn Lewise28218f2008-01-16 11:01:33 +01001169 .name = "verify_pattern",
1170 .type = FIO_OPT_INT,
1171 .cb = str_verify_pattern_cb,
1172 .help = "Fill pattern for IO buffers",
1173 .parent = "verify",
1174 },
1175 {
Jens Axboea12a3b42007-08-09 10:20:54 +02001176 .name = "verify_fatal",
Jens Axboe68e1f292007-08-10 10:32:14 +02001177 .type = FIO_OPT_BOOL,
Jens Axboea12a3b42007-08-09 10:20:54 +02001178 .off1 = td_var_offset(verify_fatal),
1179 .def = "0",
1180 .help = "Exit on a single verify failure, don't continue",
1181 .parent = "verify",
1182 },
1183 {
Jens Axboe214e1ec2007-03-15 10:48:13 +01001184 .name = "write_iolog",
1185 .type = FIO_OPT_STR_STORE,
1186 .off1 = td_var_offset(write_iolog_file),
1187 .help = "Store IO pattern to file",
1188 },
1189 {
1190 .name = "read_iolog",
1191 .type = FIO_OPT_STR_STORE,
1192 .off1 = td_var_offset(read_iolog_file),
1193 .help = "Playback IO pattern from file",
1194 },
1195 {
1196 .name = "exec_prerun",
1197 .type = FIO_OPT_STR_STORE,
1198 .off1 = td_var_offset(exec_prerun),
1199 .help = "Execute this file prior to running job",
1200 },
1201 {
1202 .name = "exec_postrun",
1203 .type = FIO_OPT_STR_STORE,
1204 .off1 = td_var_offset(exec_postrun),
1205 .help = "Execute this file after running job",
1206 },
1207#ifdef FIO_HAVE_IOSCHED_SWITCH
1208 {
1209 .name = "ioscheduler",
1210 .type = FIO_OPT_STR_STORE,
1211 .off1 = td_var_offset(ioscheduler),
1212 .help = "Use this IO scheduler on the backing device",
1213 },
1214#endif
1215 {
1216 .name = "zonesize",
1217 .type = FIO_OPT_STR_VAL,
1218 .off1 = td_var_offset(zone_size),
1219 .help = "Give size of an IO zone",
1220 .def = "0",
1221 },
1222 {
1223 .name = "zoneskip",
1224 .type = FIO_OPT_STR_VAL,
1225 .off1 = td_var_offset(zone_skip),
1226 .help = "Space between IO zones",
1227 .def = "0",
1228 },
1229 {
1230 .name = "lockmem",
1231 .type = FIO_OPT_STR_VAL,
1232 .cb = str_lockmem_cb,
1233 .help = "Lock down this amount of memory",
1234 .def = "0",
1235 },
1236 {
Jens Axboe214e1ec2007-03-15 10:48:13 +01001237 .name = "rwmixread",
1238 .type = FIO_OPT_INT,
Jens Axboecb499fc2008-05-28 10:33:32 +02001239 .cb = str_rwmix_read_cb,
Jens Axboe214e1ec2007-03-15 10:48:13 +01001240 .maxval = 100,
1241 .help = "Percentage of mixed workload that is reads",
1242 .def = "50",
1243 },
1244 {
1245 .name = "rwmixwrite",
1246 .type = FIO_OPT_INT,
Jens Axboecb499fc2008-05-28 10:33:32 +02001247 .cb = str_rwmix_write_cb,
Jens Axboe214e1ec2007-03-15 10:48:13 +01001248 .maxval = 100,
1249 .help = "Percentage of mixed workload that is writes",
1250 .def = "50",
1251 },
1252 {
Jens Axboeafdf9352007-07-31 16:14:34 +02001253 .name = "rwmixcycle",
Jens Axboe15ca1502008-04-07 09:26:02 +02001254 .type = FIO_OPT_DEPRECATED,
Jens Axboeafdf9352007-07-31 16:14:34 +02001255 },
1256 {
Jens Axboe214e1ec2007-03-15 10:48:13 +01001257 .name = "nice",
1258 .type = FIO_OPT_INT,
1259 .off1 = td_var_offset(nice),
1260 .help = "Set job CPU nice value",
1261 .minval = -19,
1262 .maxval = 20,
1263 .def = "0",
1264 },
1265#ifdef FIO_HAVE_IOPRIO
1266 {
1267 .name = "prio",
1268 .type = FIO_OPT_INT,
1269 .cb = str_prio_cb,
1270 .help = "Set job IO priority value",
1271 .minval = 0,
1272 .maxval = 7,
1273 },
1274 {
1275 .name = "prioclass",
1276 .type = FIO_OPT_INT,
1277 .cb = str_prioclass_cb,
1278 .help = "Set job IO priority class",
1279 .minval = 0,
1280 .maxval = 3,
1281 },
1282#endif
1283 {
1284 .name = "thinktime",
1285 .type = FIO_OPT_INT,
1286 .off1 = td_var_offset(thinktime),
1287 .help = "Idle time between IO buffers (usec)",
1288 .def = "0",
1289 },
1290 {
1291 .name = "thinktime_spin",
1292 .type = FIO_OPT_INT,
1293 .off1 = td_var_offset(thinktime_spin),
1294 .help = "Start think time by spinning this amount (usec)",
1295 .def = "0",
Jens Axboeafdf9352007-07-31 16:14:34 +02001296 .parent = "thinktime",
Jens Axboe214e1ec2007-03-15 10:48:13 +01001297 },
1298 {
1299 .name = "thinktime_blocks",
1300 .type = FIO_OPT_INT,
1301 .off1 = td_var_offset(thinktime_blocks),
1302 .help = "IO buffer period between 'thinktime'",
1303 .def = "1",
Jens Axboeafdf9352007-07-31 16:14:34 +02001304 .parent = "thinktime",
Jens Axboe214e1ec2007-03-15 10:48:13 +01001305 },
1306 {
1307 .name = "rate",
Jens Axboee01b22b2009-06-09 15:43:25 +02001308 .type = FIO_OPT_INT,
Jens Axboe581e7142009-06-09 12:47:16 +02001309 .off1 = td_var_offset(rate[0]),
1310 .off2 = td_var_offset(rate[1]),
Jens Axboe214e1ec2007-03-15 10:48:13 +01001311 .help = "Set bandwidth rate",
1312 },
1313 {
1314 .name = "ratemin",
Jens Axboee01b22b2009-06-09 15:43:25 +02001315 .type = FIO_OPT_INT,
Jens Axboe581e7142009-06-09 12:47:16 +02001316 .off1 = td_var_offset(ratemin[0]),
1317 .off2 = td_var_offset(ratemin[1]),
Jens Axboe4e991c22007-03-15 11:41:11 +01001318 .help = "Job must meet this rate or it will be shutdown",
Jens Axboeafdf9352007-07-31 16:14:34 +02001319 .parent = "rate",
Jens Axboe4e991c22007-03-15 11:41:11 +01001320 },
1321 {
1322 .name = "rate_iops",
Jens Axboee01b22b2009-06-09 15:43:25 +02001323 .type = FIO_OPT_INT,
Jens Axboe581e7142009-06-09 12:47:16 +02001324 .off1 = td_var_offset(rate_iops[0]),
1325 .off2 = td_var_offset(rate_iops[1]),
Jens Axboe4e991c22007-03-15 11:41:11 +01001326 .help = "Limit IO used to this number of IO operations/sec",
1327 },
1328 {
1329 .name = "rate_iops_min",
Jens Axboee01b22b2009-06-09 15:43:25 +02001330 .type = FIO_OPT_INT,
Jens Axboe581e7142009-06-09 12:47:16 +02001331 .off1 = td_var_offset(rate_iops_min[0]),
1332 .off2 = td_var_offset(rate_iops_min[1]),
Jens Axboe4e991c22007-03-15 11:41:11 +01001333 .help = "Job must meet this rate or it will be shutdown",
Jens Axboeafdf9352007-07-31 16:14:34 +02001334 .parent = "rate_iops",
Jens Axboe214e1ec2007-03-15 10:48:13 +01001335 },
1336 {
1337 .name = "ratecycle",
1338 .type = FIO_OPT_INT,
1339 .off1 = td_var_offset(ratecycle),
1340 .help = "Window average for rate limits (msec)",
1341 .def = "1000",
Jens Axboeafdf9352007-07-31 16:14:34 +02001342 .parent = "rate",
Jens Axboe214e1ec2007-03-15 10:48:13 +01001343 },
1344 {
1345 .name = "invalidate",
1346 .type = FIO_OPT_BOOL,
1347 .off1 = td_var_offset(invalidate_cache),
1348 .help = "Invalidate buffer/page cache prior to running job",
1349 .def = "1",
1350 },
1351 {
1352 .name = "sync",
1353 .type = FIO_OPT_BOOL,
1354 .off1 = td_var_offset(sync_io),
1355 .help = "Use O_SYNC for buffered writes",
1356 .def = "0",
Jens Axboe67a10002007-07-31 23:12:16 +02001357 .parent = "buffered",
Jens Axboe214e1ec2007-03-15 10:48:13 +01001358 },
1359 {
1360 .name = "bwavgtime",
1361 .type = FIO_OPT_INT,
1362 .off1 = td_var_offset(bw_avg_time),
Jens Axboe5ec10ea2008-03-06 15:42:00 +01001363 .help = "Time window over which to calculate bandwidth"
1364 " (msec)",
Jens Axboe214e1ec2007-03-15 10:48:13 +01001365 .def = "500",
1366 },
1367 {
1368 .name = "create_serialize",
1369 .type = FIO_OPT_BOOL,
1370 .off1 = td_var_offset(create_serialize),
1371 .help = "Serialize creating of job files",
1372 .def = "1",
1373 },
1374 {
1375 .name = "create_fsync",
1376 .type = FIO_OPT_BOOL,
1377 .off1 = td_var_offset(create_fsync),
1378 .help = "Fsync file after creation",
1379 .def = "1",
1380 },
1381 {
Jens Axboe814452b2009-03-04 12:53:13 +01001382 .name = "create_on_open",
1383 .type = FIO_OPT_BOOL,
1384 .off1 = td_var_offset(create_on_open),
1385 .help = "Create files when they are opened for IO",
1386 .def = "0",
1387 },
Zhang, Yanminafad68f2009-05-20 11:30:55 +02001388 {
1389 .name = "pre_read",
1390 .type = FIO_OPT_BOOL,
1391 .off1 = td_var_offset(pre_read),
1392 .help = "Preread files before starting official testing",
1393 .def = "0",
1394 },
Jens Axboe814452b2009-03-04 12:53:13 +01001395 {
Jens Axboe214e1ec2007-03-15 10:48:13 +01001396 .name = "cpuload",
1397 .type = FIO_OPT_INT,
1398 .off1 = td_var_offset(cpuload),
1399 .help = "Use this percentage of CPU",
1400 },
1401 {
1402 .name = "cpuchunks",
1403 .type = FIO_OPT_INT,
1404 .off1 = td_var_offset(cpucycle),
1405 .help = "Length of the CPU burn cycles (usecs)",
1406 .def = "50000",
Jens Axboe67a10002007-07-31 23:12:16 +02001407 .parent = "cpuload",
Jens Axboe214e1ec2007-03-15 10:48:13 +01001408 },
1409#ifdef FIO_HAVE_CPU_AFFINITY
1410 {
1411 .name = "cpumask",
1412 .type = FIO_OPT_INT,
1413 .cb = str_cpumask_cb,
1414 .help = "CPU affinity mask",
1415 },
Jens Axboed2e268b2007-06-15 10:33:49 +02001416 {
1417 .name = "cpus_allowed",
1418 .type = FIO_OPT_STR,
1419 .cb = str_cpus_allowed_cb,
1420 .help = "Set CPUs allowed",
1421 },
Jens Axboe214e1ec2007-03-15 10:48:13 +01001422#endif
1423 {
1424 .name = "end_fsync",
1425 .type = FIO_OPT_BOOL,
1426 .off1 = td_var_offset(end_fsync),
1427 .help = "Include fsync at the end of job",
1428 .def = "0",
1429 },
1430 {
1431 .name = "fsync_on_close",
1432 .type = FIO_OPT_BOOL,
1433 .off1 = td_var_offset(fsync_on_close),
1434 .help = "fsync files on close",
1435 .def = "0",
1436 },
1437 {
1438 .name = "unlink",
1439 .type = FIO_OPT_BOOL,
1440 .off1 = td_var_offset(unlink),
1441 .help = "Unlink created files after job has completed",
1442 .def = "0",
1443 },
1444 {
1445 .name = "exitall",
1446 .type = FIO_OPT_STR_SET,
1447 .cb = str_exitall_cb,
1448 .help = "Terminate all jobs when one exits",
1449 },
1450 {
1451 .name = "stonewall",
1452 .type = FIO_OPT_STR_SET,
1453 .off1 = td_var_offset(stonewall),
1454 .help = "Insert a hard barrier between this job and previous",
1455 },
1456 {
Jens Axboeb3d62a72007-03-20 14:23:26 +01001457 .name = "new_group",
1458 .type = FIO_OPT_STR_SET,
1459 .off1 = td_var_offset(new_group),
1460 .help = "Mark the start of a new group (for reporting)",
1461 },
1462 {
Jens Axboe214e1ec2007-03-15 10:48:13 +01001463 .name = "thread",
1464 .type = FIO_OPT_STR_SET,
1465 .off1 = td_var_offset(use_thread),
1466 .help = "Use threads instead of forks",
1467 },
1468 {
1469 .name = "write_bw_log",
Jens Axboee3cedca2008-11-19 19:57:52 +01001470 .type = FIO_OPT_STR,
Jens Axboe214e1ec2007-03-15 10:48:13 +01001471 .off1 = td_var_offset(write_bw_log),
Jens Axboee3cedca2008-11-19 19:57:52 +01001472 .cb = str_write_bw_log_cb,
Jens Axboe214e1ec2007-03-15 10:48:13 +01001473 .help = "Write log of bandwidth during run",
1474 },
1475 {
1476 .name = "write_lat_log",
Jens Axboee3cedca2008-11-19 19:57:52 +01001477 .type = FIO_OPT_STR,
Jens Axboe214e1ec2007-03-15 10:48:13 +01001478 .off1 = td_var_offset(write_lat_log),
Jens Axboee3cedca2008-11-19 19:57:52 +01001479 .cb = str_write_lat_log_cb,
Jens Axboe214e1ec2007-03-15 10:48:13 +01001480 .help = "Write log of latency during run",
1481 },
1482 {
1483 .name = "hugepage-size",
Jens Axboee01b22b2009-06-09 15:43:25 +02001484 .type = FIO_OPT_INT,
Jens Axboe214e1ec2007-03-15 10:48:13 +01001485 .off1 = td_var_offset(hugepage_size),
1486 .help = "When using hugepages, specify size of each page",
1487 .def = __stringify(FIO_HUGE_PAGE),
1488 },
1489 {
1490 .name = "group_reporting",
1491 .type = FIO_OPT_STR_SET,
1492 .off1 = td_var_offset(group_reporting),
1493 .help = "Do reporting on a per-group basis",
1494 },
1495 {
Jens Axboee9459e52007-04-17 15:46:32 +02001496 .name = "zero_buffers",
1497 .type = FIO_OPT_STR_SET,
1498 .off1 = td_var_offset(zero_buffers),
1499 .help = "Init IO buffers to all zeroes",
1500 },
Jens Axboe5973caf2008-05-21 19:52:35 +02001501 {
1502 .name = "refill_buffers",
1503 .type = FIO_OPT_STR_SET,
1504 .off1 = td_var_offset(refill_buffers),
1505 .help = "Refill IO buffers on every IO submit",
1506 },
Jens Axboe0a839f32007-04-26 09:02:34 +02001507#ifdef FIO_HAVE_DISK_UTIL
1508 {
1509 .name = "disk_util",
1510 .type = FIO_OPT_BOOL,
1511 .off1 = td_var_offset(do_disk_util),
Jens Axboef66ab3c2008-06-05 11:48:22 +02001512 .help = "Log disk utilization statistics",
Jens Axboe0a839f32007-04-26 09:02:34 +02001513 .def = "1",
1514 },
1515#endif
Jens Axboee9459e52007-04-17 15:46:32 +02001516 {
Jens Axboe993bf482008-11-14 13:04:53 +01001517 .name = "gtod_reduce",
1518 .type = FIO_OPT_BOOL,
1519 .help = "Greatly reduce number of gettimeofday() calls",
1520 .cb = str_gtod_reduce_cb,
1521 .def = "0",
1522 },
1523 {
Jens Axboe9520ebb2008-10-16 21:03:27 +02001524 .name = "disable_clat",
1525 .type = FIO_OPT_BOOL,
1526 .off1 = td_var_offset(disable_clat),
1527 .help = "Disable completion latency numbers",
Jens Axboe993bf482008-11-14 13:04:53 +01001528 .parent = "gtod_reduce",
Jens Axboe9520ebb2008-10-16 21:03:27 +02001529 .def = "0",
1530 },
1531 {
1532 .name = "disable_slat",
1533 .type = FIO_OPT_BOOL,
1534 .off1 = td_var_offset(disable_slat),
1535 .help = "Disable submissionn latency numbers",
Jens Axboe993bf482008-11-14 13:04:53 +01001536 .parent = "gtod_reduce",
Jens Axboe9520ebb2008-10-16 21:03:27 +02001537 .def = "0",
1538 },
1539 {
1540 .name = "disable_bw_measurement",
1541 .type = FIO_OPT_BOOL,
1542 .off1 = td_var_offset(disable_bw),
1543 .help = "Disable bandwidth logging",
Jens Axboe993bf482008-11-14 13:04:53 +01001544 .parent = "gtod_reduce",
Jens Axboe9520ebb2008-10-16 21:03:27 +02001545 .def = "0",
1546 },
1547 {
Jens Axboebe4ecfd2008-12-08 14:10:52 +01001548 .name = "gtod_cpu",
1549 .type = FIO_OPT_INT,
1550 .cb = str_gtod_cpu_cb,
1551 .help = "Setup dedicated gettimeofday() thread on this CPU",
Jens Axboe29d43ff2009-07-01 10:42:18 +02001552 .verify = gtod_cpu_verify,
Jens Axboebe4ecfd2008-12-08 14:10:52 +01001553 },
1554 {
Radha Ramachandranf2bba182009-06-15 08:40:16 +02001555 .name = "continue_on_error",
1556 .type = FIO_OPT_BOOL,
1557 .off1 = td_var_offset(continue_on_error),
1558 .help = "Continue on non-fatal errors during I/O",
1559 .def = "0",
1560 },
1561 {
Jens Axboe214e1ec2007-03-15 10:48:13 +01001562 .name = NULL,
1563 },
1564};
1565
1566void fio_options_dup_and_init(struct option *long_options)
1567{
1568 struct fio_option *o;
1569 unsigned int i;
1570
1571 options_init(options);
1572
1573 i = 0;
1574 while (long_options[i].name)
1575 i++;
1576
1577 o = &options[0];
1578 while (o->name) {
Jens Axboe5921e802008-05-30 15:02:38 +02001579 long_options[i].name = (char *) o->name;
Jens Axboe214e1ec2007-03-15 10:48:13 +01001580 long_options[i].val = FIO_GETOPT_JOB;
1581 if (o->type == FIO_OPT_STR_SET)
1582 long_options[i].has_arg = no_argument;
1583 else
1584 long_options[i].has_arg = required_argument;
1585
1586 i++;
1587 o++;
1588 assert(i < FIO_NR_OPTIONS);
1589 }
1590}
1591
Jens Axboe3b8b7132008-06-10 19:46:23 +02001592int fio_options_parse(struct thread_data *td, char **opts, int num_opts)
Jens Axboe214e1ec2007-03-15 10:48:13 +01001593{
Jens Axboe3b8b7132008-06-10 19:46:23 +02001594 int i, ret;
1595
1596 sort_options(opts, options, num_opts);
1597
1598 for (ret = 0, i = 0; i < num_opts; i++)
1599 ret |= parse_option(opts[i], options, td);
1600
1601 return ret;
Jens Axboe214e1ec2007-03-15 10:48:13 +01001602}
1603
1604int fio_cmd_option_parse(struct thread_data *td, const char *opt, char *val)
1605{
1606 return parse_cmd_option(opt, val, options, td);
1607}
1608
1609void fio_fill_default_options(struct thread_data *td)
1610{
1611 fill_default_options(td, options);
1612}
1613
1614int fio_show_option_help(const char *opt)
1615{
1616 return show_cmd_help(options, opt);
1617}
Jens Axboed23bb322007-03-23 15:57:56 +01001618
1619static void __options_mem(struct thread_data *td, int alloc)
1620{
1621 struct thread_options *o = &td->o;
1622 struct fio_option *opt;
1623 char **ptr;
1624 int i;
1625
1626 for (i = 0, opt = &options[0]; opt->name; i++, opt = &options[i]) {
1627 if (opt->type != FIO_OPT_STR_STORE)
1628 continue;
1629
1630 ptr = (void *) o + opt->off1;
1631 if (*ptr) {
1632 if (alloc)
1633 *ptr = strdup(*ptr);
1634 else {
1635 free(*ptr);
1636 *ptr = NULL;
1637 }
1638 }
1639 }
1640}
1641
1642/*
1643 * dupe FIO_OPT_STR_STORE options
1644 */
1645void options_mem_dupe(struct thread_data *td)
1646{
1647 __options_mem(td, 1);
1648}
1649
Jens Axboe22d66212007-03-27 20:06:25 +02001650void options_mem_free(struct thread_data fio_unused *td)
Jens Axboed23bb322007-03-23 15:57:56 +01001651{
Jens Axboe22d66212007-03-27 20:06:25 +02001652#if 0
Jens Axboed23bb322007-03-23 15:57:56 +01001653 __options_mem(td, 0);
Jens Axboe22d66212007-03-27 20:06:25 +02001654#endif
Jens Axboed23bb322007-03-23 15:57:56 +01001655}