blob: b59dd221fba5220667be82bb062c7ab74ce452e9 [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>
8
9#include "fio.h"
10#include "parse.h"
Jens Axboe90059d62007-07-30 09:33:12 +020011#include "fls.h"
Jens Axboe214e1ec2007-03-15 10:48:13 +010012
Jens Axboe2dc1bbe2007-03-15 15:01:33 +010013#define td_var_offset(var) ((size_t) &((struct thread_options *)0)->var)
Jens Axboe214e1ec2007-03-15 10:48:13 +010014
15/*
16 * Check if mmap/mmaphuge has a :/foo/bar/file at the end. If so, return that.
17 */
18static char *get_opt_postfix(const char *str)
19{
20 char *p = strstr(str, ":");
21
22 if (!p)
23 return NULL;
24
25 p++;
26 strip_blank_front(&p);
27 strip_blank_end(p);
28 return strdup(p);
29}
30
Jens Axboe564ca972007-12-14 12:21:19 +010031static int bs_cmp(const void *p1, const void *p2)
32{
33 const struct bssplit *bsp1 = p1;
34 const struct bssplit *bsp2 = p2;
35
36 return bsp1->perc < bsp2->perc;
37}
38
39static int str_bssplit_cb(void *data, const char *input)
40{
41 struct thread_data *td = data;
42 char *fname, *str, *p;
43 unsigned int i, perc, perc_missing;
44 unsigned int max_bs, min_bs;
45 long long val;
46
47 p = str = strdup(input);
48
49 strip_blank_front(&str);
50 strip_blank_end(str);
51
52 td->o.bssplit_nr = 4;
53 td->o.bssplit = malloc(4 * sizeof(struct bssplit));
54
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 */
67 if (i == td->o.bssplit_nr) {
68 td->o.bssplit_nr <<= 1;
69 td->o.bssplit = realloc(td->o.bssplit, td->o.bssplit_nr * sizeof(struct bssplit));
70 }
71
72 perc_str = strstr(fname, "/");
73 if (perc_str) {
74 *perc_str = '\0';
75 perc_str++;
76 perc = atoi(perc_str);
77 if (perc > 100)
78 perc = 100;
79 else if (!perc)
80 perc = -1;
81 } else
82 perc = -1;
83
84 if (str_to_decimal(fname, &val, 1)) {
85 log_err("fio: bssplit conversion failed\n");
86 free(td->o.bssplit);
87 return 1;
88 }
89
90 if (val > max_bs)
91 max_bs = val;
92 if (val < min_bs)
93 min_bs = val;
94
95 td->o.bssplit[i].bs = val;
96 td->o.bssplit[i].perc = perc;
97 i++;
98 }
99
100 td->o.bssplit_nr = i;
101
102 /*
103 * Now check if the percentages add up, and how much is missing
104 */
105 perc = perc_missing = 0;
106 for (i = 0; i < td->o.bssplit_nr; i++) {
107 struct bssplit *bsp = &td->o.bssplit[i];
108
109 if (bsp->perc == (unsigned char) -1)
110 perc_missing++;
111 else
112 perc += bsp->perc;
113 }
114
115 if (perc > 100) {
116 log_err("fio: bssplit percentages add to more than 100%%\n");
117 free(td->o.bssplit);
118 return 1;
119 }
120 /*
121 * If values didn't have a percentage set, divide the remains between
122 * them.
123 */
124 if (perc_missing) {
125 for (i = 0; i < td->o.bssplit_nr; i++) {
126 struct bssplit *bsp = &td->o.bssplit[i];
127
128 if (bsp->perc == (unsigned char) -1)
129 bsp->perc = (100 - perc) / perc_missing;
130 }
131 }
132
133 td->o.min_bs[DDIR_READ] = td->o.min_bs[DDIR_WRITE] = min_bs;
134 td->o.max_bs[DDIR_READ] = td->o.max_bs[DDIR_WRITE] = max_bs;
135
136 /*
137 * now sort based on percentages, for ease of lookup
138 */
139 qsort(td->o.bssplit, td->o.bssplit_nr, sizeof(struct bssplit), bs_cmp);
140
141 free(p);
142 return 0;
143}
144
Jens Axboe211097b2007-03-22 18:56:45 +0100145static int str_rw_cb(void *data, const char *str)
146{
147 struct thread_data *td = data;
148 char *nr = get_opt_postfix(str);
149
Jens Axboefafdba32007-03-26 10:09:12 +0200150 td->o.ddir_nr = 1;
Jens Axboe211097b2007-03-22 18:56:45 +0100151 if (nr)
152 td->o.ddir_nr = atoi(nr);
153
Jens Axboe211097b2007-03-22 18:56:45 +0100154 return 0;
155}
156
Jens Axboe214e1ec2007-03-15 10:48:13 +0100157static int str_mem_cb(void *data, const char *mem)
158{
159 struct thread_data *td = data;
160
Jens Axboe2dc1bbe2007-03-15 15:01:33 +0100161 if (td->o.mem_type == MEM_MMAPHUGE || td->o.mem_type == MEM_MMAP) {
Jens Axboe214e1ec2007-03-15 10:48:13 +0100162 td->mmapfile = get_opt_postfix(mem);
Jens Axboe2dc1bbe2007-03-15 15:01:33 +0100163 if (td->o.mem_type == MEM_MMAPHUGE && !td->mmapfile) {
Jens Axboe214e1ec2007-03-15 10:48:13 +0100164 log_err("fio: mmaphuge:/path/to/file\n");
165 return 1;
166 }
167 }
168
169 return 0;
170}
171
172static int str_lockmem_cb(void fio_unused *data, unsigned long *val)
173{
174 mlock_size = *val;
175 return 0;
176}
177
178#ifdef FIO_HAVE_IOPRIO
179static int str_prioclass_cb(void *data, unsigned int *val)
180{
181 struct thread_data *td = data;
Jens Axboe6cefbe32007-04-18 12:46:56 +0200182 unsigned short mask;
183
184 /*
185 * mask off old class bits, str_prio_cb() may have set a default class
186 */
187 mask = (1 << IOPRIO_CLASS_SHIFT) - 1;
188 td->ioprio &= mask;
Jens Axboe214e1ec2007-03-15 10:48:13 +0100189
190 td->ioprio |= *val << IOPRIO_CLASS_SHIFT;
Jens Axboeac684782007-11-08 08:29:07 +0100191 td->ioprio_set = 1;
Jens Axboe214e1ec2007-03-15 10:48:13 +0100192 return 0;
193}
194
195static int str_prio_cb(void *data, unsigned int *val)
196{
197 struct thread_data *td = data;
198
199 td->ioprio |= *val;
Jens Axboe6cefbe32007-04-18 12:46:56 +0200200
201 /*
202 * If no class is set, assume BE
203 */
204 if ((td->ioprio >> IOPRIO_CLASS_SHIFT) == 0)
205 td->ioprio |= IOPRIO_CLASS_BE << IOPRIO_CLASS_SHIFT;
206
Jens Axboeac684782007-11-08 08:29:07 +0100207 td->ioprio_set = 1;
Jens Axboe214e1ec2007-03-15 10:48:13 +0100208 return 0;
209}
210#endif
211
212static int str_exitall_cb(void)
213{
214 exitall_on_terminate = 1;
215 return 0;
216}
217
Jens Axboe214e1ec2007-03-15 10:48:13 +0100218#ifdef FIO_HAVE_CPU_AFFINITY
Jens Axboe214e1ec2007-03-15 10:48:13 +0100219static int str_cpumask_cb(void *data, unsigned int *val)
220{
221 struct thread_data *td = data;
Jens Axboed2e268b2007-06-15 10:33:49 +0200222 unsigned int i;
Jens Axboe214e1ec2007-03-15 10:48:13 +0100223
Jens Axboed2e268b2007-06-15 10:33:49 +0200224 CPU_ZERO(&td->o.cpumask);
225
226 for (i = 0; i < sizeof(int) * 8; i++)
227 if ((1 << i) & *val)
228 CPU_SET(*val, &td->o.cpumask);
229
Jens Axboe375b2692007-05-22 09:13:02 +0200230 td->o.cpumask_set = 1;
Jens Axboe214e1ec2007-03-15 10:48:13 +0100231 return 0;
232}
233
Jens Axboed2e268b2007-06-15 10:33:49 +0200234static int str_cpus_allowed_cb(void *data, const char *input)
235{
236 struct thread_data *td = data;
237 char *cpu, *str, *p;
238
239 CPU_ZERO(&td->o.cpumask);
240
241 p = str = strdup(input);
242
243 strip_blank_front(&str);
244 strip_blank_end(str);
245
246 while ((cpu = strsep(&str, ",")) != NULL) {
247 if (!strlen(cpu))
248 break;
249 CPU_SET(atoi(cpu), &td->o.cpumask);
250 }
251
252 free(p);
253 td->o.cpumask_set = 1;
Jens Axboed2e268b2007-06-15 10:33:49 +0200254 return 0;
255}
256#endif
257
Jens Axboe214e1ec2007-03-15 10:48:13 +0100258static int str_fst_cb(void *data, const char *str)
259{
260 struct thread_data *td = data;
261 char *nr = get_opt_postfix(str);
262
263 td->file_service_nr = 1;
264 if (nr)
265 td->file_service_nr = atoi(nr);
266
267 return 0;
268}
269
270static int str_filename_cb(void *data, const char *input)
271{
272 struct thread_data *td = data;
273 char *fname, *str, *p;
274
275 p = str = strdup(input);
276
277 strip_blank_front(&str);
278 strip_blank_end(str);
279
280 if (!td->files_index)
Jens Axboe2dc1bbe2007-03-15 15:01:33 +0100281 td->o.nr_files = 0;
Jens Axboe214e1ec2007-03-15 10:48:13 +0100282
283 while ((fname = strsep(&str, ":")) != NULL) {
284 if (!strlen(fname))
285 break;
286 add_file(td, fname);
Jens Axboe2dc1bbe2007-03-15 15:01:33 +0100287 td->o.nr_files++;
Jens Axboe214e1ec2007-03-15 10:48:13 +0100288 }
289
290 free(p);
291 return 0;
292}
293
294static int str_directory_cb(void *data, const char fio_unused *str)
295{
296 struct thread_data *td = data;
297 struct stat sb;
298
Jens Axboe2dc1bbe2007-03-15 15:01:33 +0100299 if (lstat(td->o.directory, &sb) < 0) {
300 log_err("fio: %s is not a directory\n", td->o.directory);
Jens Axboe214e1ec2007-03-15 10:48:13 +0100301 td_verror(td, errno, "lstat");
302 return 1;
303 }
304 if (!S_ISDIR(sb.st_mode)) {
Jens Axboe2dc1bbe2007-03-15 15:01:33 +0100305 log_err("fio: %s is not a directory\n", td->o.directory);
Jens Axboe214e1ec2007-03-15 10:48:13 +0100306 return 1;
307 }
308
309 return 0;
310}
311
312static int str_opendir_cb(void *data, const char fio_unused *str)
313{
314 struct thread_data *td = data;
315
316 if (!td->files_index)
Jens Axboe2dc1bbe2007-03-15 15:01:33 +0100317 td->o.nr_files = 0;
Jens Axboe214e1ec2007-03-15 10:48:13 +0100318
Jens Axboe2dc1bbe2007-03-15 15:01:33 +0100319 return add_dir_files(td, td->o.opendir);
Jens Axboe214e1ec2007-03-15 10:48:13 +0100320}
321
Jens Axboea59e1702007-07-30 08:53:27 +0200322static int str_verify_offset_cb(void *data, unsigned int *off)
Shawn Lewis546a9142007-07-28 21:11:37 +0200323{
324 struct thread_data *td = data;
Jens Axboea59e1702007-07-30 08:53:27 +0200325
Shawn Lewis546a9142007-07-28 21:11:37 +0200326 if (*off && *off < sizeof(struct verify_header)) {
Jens Axboea59e1702007-07-30 08:53:27 +0200327 log_err("fio: verify_offset too small\n");
Shawn Lewis546a9142007-07-28 21:11:37 +0200328 return 1;
329 }
Jens Axboea59e1702007-07-30 08:53:27 +0200330
331 td->o.verify_offset = *off;
Shawn Lewis546a9142007-07-28 21:11:37 +0200332 return 0;
333}
334
Shawn Lewise28218f2008-01-16 11:01:33 +0100335static int str_verify_pattern_cb(void *data, unsigned int *off)
Jens Axboe90059d62007-07-30 09:33:12 +0200336{
337 struct thread_data *td = data;
Shawn Lewise28218f2008-01-16 11:01:33 +0100338 unsigned int msb;
Jens Axboe90059d62007-07-30 09:33:12 +0200339
Shawn Lewise28218f2008-01-16 11:01:33 +0100340 msb = fls(*off);
Jens Axboe90059d62007-07-30 09:33:12 +0200341 if (msb <= 8)
342 td->o.verify_pattern_bytes = 1;
343 else if (msb <= 16)
344 td->o.verify_pattern_bytes = 2;
345 else if (msb <= 24)
346 td->o.verify_pattern_bytes = 3;
347 else
348 td->o.verify_pattern_bytes = 4;
349
Shawn Lewise28218f2008-01-16 11:01:33 +0100350 td->o.verify_pattern = *off;
Jens Axboe90059d62007-07-30 09:33:12 +0200351 return 0;
352}
Jens Axboe214e1ec2007-03-15 10:48:13 +0100353
354#define __stringify_1(x) #x
355#define __stringify(x) __stringify_1(x)
356
357/*
358 * Map of job/command line options
359 */
360static struct fio_option options[] = {
361 {
362 .name = "description",
363 .type = FIO_OPT_STR_STORE,
364 .off1 = td_var_offset(description),
365 .help = "Text job description",
366 },
367 {
368 .name = "name",
369 .type = FIO_OPT_STR_STORE,
370 .off1 = td_var_offset(name),
371 .help = "Name of this job",
372 },
373 {
374 .name = "directory",
375 .type = FIO_OPT_STR_STORE,
376 .off1 = td_var_offset(directory),
377 .cb = str_directory_cb,
378 .help = "Directory to store files in",
379 },
380 {
381 .name = "filename",
382 .type = FIO_OPT_STR_STORE,
383 .off1 = td_var_offset(filename),
384 .cb = str_filename_cb,
385 .help = "File(s) to use for the workload",
386 },
387 {
388 .name = "opendir",
389 .type = FIO_OPT_STR_STORE,
390 .off1 = td_var_offset(opendir),
391 .cb = str_opendir_cb,
392 .help = "Recursively add files from this directory and down",
393 },
394 {
395 .name = "rw",
Jens Axboed3aad8f2007-03-15 14:12:05 +0100396 .alias = "readwrite",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100397 .type = FIO_OPT_STR,
Jens Axboe211097b2007-03-22 18:56:45 +0100398 .cb = str_rw_cb,
Jens Axboe214e1ec2007-03-15 10:48:13 +0100399 .off1 = td_var_offset(td_ddir),
400 .help = "IO direction",
401 .def = "read",
402 .posval = {
403 { .ival = "read",
404 .oval = TD_DDIR_READ,
405 .help = "Sequential read",
406 },
407 { .ival = "write",
408 .oval = TD_DDIR_WRITE,
409 .help = "Sequential write",
410 },
411 { .ival = "randread",
412 .oval = TD_DDIR_RANDREAD,
413 .help = "Random read",
414 },
415 { .ival = "randwrite",
416 .oval = TD_DDIR_RANDWRITE,
417 .help = "Random write",
418 },
419 { .ival = "rw",
420 .oval = TD_DDIR_RW,
421 .help = "Sequential read and write mix",
422 },
423 { .ival = "randrw",
424 .oval = TD_DDIR_RANDRW,
425 .help = "Random read and write mix"
426 },
427 },
428 },
429 {
430 .name = "ioengine",
431 .type = FIO_OPT_STR_STORE,
432 .off1 = td_var_offset(ioengine),
433 .help = "IO engine to use",
434 .def = "sync",
435 .posval = {
436 { .ival = "sync",
437 .help = "Use read/write",
438 },
gurudas paia31041e2007-10-23 15:12:30 +0200439 { .ival = "psync",
440 .help = "Use pread/pwrite",
441 },
Jens Axboe1d2af022008-02-04 10:59:07 +0100442 { .ival = "vsync",
443 .help = "Use readv/writev",
444 },
Jens Axboe214e1ec2007-03-15 10:48:13 +0100445#ifdef FIO_HAVE_LIBAIO
446 { .ival = "libaio",
447 .help = "Linux native asynchronous IO",
448 },
449#endif
450#ifdef FIO_HAVE_POSIXAIO
451 { .ival = "posixaio",
452 .help = "POSIX asynchronous IO",
453 },
454#endif
455 { .ival = "mmap",
456 .help = "Memory mapped IO",
457 },
458#ifdef FIO_HAVE_SPLICE
459 { .ival = "splice",
460 .help = "splice/vmsplice based IO",
461 },
Jens Axboe9cce02e2007-06-22 15:42:21 +0200462 { .ival = "netsplice",
463 .help = "splice/vmsplice to/from the network",
464 },
Jens Axboe214e1ec2007-03-15 10:48:13 +0100465#endif
466#ifdef FIO_HAVE_SGIO
467 { .ival = "sg",
468 .help = "SCSI generic v3 IO",
469 },
470#endif
471 { .ival = "null",
472 .help = "Testing engine (no data transfer)",
473 },
474 { .ival = "net",
475 .help = "Network IO",
476 },
477#ifdef FIO_HAVE_SYSLET
478 { .ival = "syslet-rw",
479 .help = "syslet enabled async pread/pwrite IO",
480 },
481#endif
482 { .ival = "cpuio",
483 .help = "CPU cycler burner engine",
484 },
Jens Axboeb8c82a42007-03-21 08:48:26 +0100485#ifdef FIO_HAVE_GUASI
486 { .ival = "guasi",
487 .help = "GUASI IO engine",
488 },
489#endif
Jens Axboe214e1ec2007-03-15 10:48:13 +0100490 { .ival = "external",
491 .help = "Load external engine (append name)",
492 },
493 },
494 },
495 {
496 .name = "iodepth",
497 .type = FIO_OPT_INT,
498 .off1 = td_var_offset(iodepth),
499 .help = "Amount of IO buffers to keep in flight",
Jens Axboe757aff42007-12-12 19:42:13 +0100500 .minval = 1,
Jens Axboe214e1ec2007-03-15 10:48:13 +0100501 .def = "1",
502 },
503 {
504 .name = "iodepth_batch",
505 .type = FIO_OPT_INT,
506 .off1 = td_var_offset(iodepth_batch),
507 .help = "Number of IO to submit in one go",
Jens Axboeafdf9352007-07-31 16:14:34 +0200508 .parent = "iodepth",
Jens Axboea2e6f8a2008-01-18 10:28:11 +0100509 .minval = 1,
510 .def = "1",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100511 },
512 {
513 .name = "iodepth_low",
514 .type = FIO_OPT_INT,
515 .off1 = td_var_offset(iodepth_low),
516 .help = "Low water mark for queuing depth",
Jens Axboeafdf9352007-07-31 16:14:34 +0200517 .parent = "iodepth",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100518 },
519 {
520 .name = "size",
521 .type = FIO_OPT_STR_VAL,
Jens Axboe2dc1bbe2007-03-15 15:01:33 +0100522 .off1 = td_var_offset(size),
Jens Axboec3edbdb2007-07-20 14:25:31 +0200523 .minval = 1,
Jens Axboe214e1ec2007-03-15 10:48:13 +0100524 .help = "Total size of device or files",
525 },
526 {
Shawn Lewisaa31f1f2008-01-11 09:45:11 +0100527 .name = "fill_device",
528 .type = FIO_OPT_BOOL,
529 .off1 = td_var_offset(fill_device),
530 .help = "Write until an ENOSPC error occurs",
531 .def = "0",
532 },
533 {
Jens Axboe214e1ec2007-03-15 10:48:13 +0100534 .name = "filesize",
535 .type = FIO_OPT_STR_VAL,
536 .off1 = td_var_offset(file_size_low),
537 .off2 = td_var_offset(file_size_high),
Jens Axboec3edbdb2007-07-20 14:25:31 +0200538 .minval = 1,
Jens Axboe214e1ec2007-03-15 10:48:13 +0100539 .help = "Size of individual files",
540 },
541 {
Jens Axboe67a10002007-07-31 23:12:16 +0200542 .name = "offset",
543 .alias = "fileoffset",
544 .type = FIO_OPT_STR_VAL,
545 .off1 = td_var_offset(start_offset),
546 .help = "Start IO from this offset",
547 .def = "0",
548 },
549 {
Jens Axboe214e1ec2007-03-15 10:48:13 +0100550 .name = "bs",
Jens Axboed3aad8f2007-03-15 14:12:05 +0100551 .alias = "blocksize",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100552 .type = FIO_OPT_STR_VAL_INT,
553 .off1 = td_var_offset(bs[DDIR_READ]),
554 .off2 = td_var_offset(bs[DDIR_WRITE]),
Jens Axboec3edbdb2007-07-20 14:25:31 +0200555 .minval = 1,
Jens Axboe214e1ec2007-03-15 10:48:13 +0100556 .help = "Block size unit",
557 .def = "4k",
Jens Axboe67a10002007-07-31 23:12:16 +0200558 .parent = "rw",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100559 },
560 {
561 .name = "bsrange",
Jens Axboed3aad8f2007-03-15 14:12:05 +0100562 .alias = "blocksize_range",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100563 .type = FIO_OPT_RANGE,
564 .off1 = td_var_offset(min_bs[DDIR_READ]),
565 .off2 = td_var_offset(max_bs[DDIR_READ]),
566 .off3 = td_var_offset(min_bs[DDIR_WRITE]),
567 .off4 = td_var_offset(max_bs[DDIR_WRITE]),
Jens Axboec3edbdb2007-07-20 14:25:31 +0200568 .minval = 1,
Jens Axboe214e1ec2007-03-15 10:48:13 +0100569 .help = "Set block size range (in more detail than bs)",
Jens Axboe67a10002007-07-31 23:12:16 +0200570 .parent = "rw",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100571 },
572 {
Jens Axboe564ca972007-12-14 12:21:19 +0100573 .name = "bssplit",
574 .type = FIO_OPT_STR,
575 .cb = str_bssplit_cb,
576 .help = "Set a specific mix of block sizes",
577 .parent = "rw",
578 },
579 {
Jens Axboe214e1ec2007-03-15 10:48:13 +0100580 .name = "bs_unaligned",
Jens Axboed3aad8f2007-03-15 14:12:05 +0100581 .alias = "blocksize_unaligned",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100582 .type = FIO_OPT_STR_SET,
583 .off1 = td_var_offset(bs_unaligned),
584 .help = "Don't sector align IO buffer sizes",
Jens Axboe67a10002007-07-31 23:12:16 +0200585 .parent = "rw",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100586 },
587 {
588 .name = "randrepeat",
589 .type = FIO_OPT_BOOL,
590 .off1 = td_var_offset(rand_repeatable),
591 .help = "Use repeatable random IO pattern",
592 .def = "1",
Jens Axboe67a10002007-07-31 23:12:16 +0200593 .parent = "rw",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100594 },
595 {
596 .name = "norandommap",
597 .type = FIO_OPT_STR_SET,
598 .off1 = td_var_offset(norandommap),
599 .help = "Accept potential duplicate random blocks",
Jens Axboe67a10002007-07-31 23:12:16 +0200600 .parent = "rw",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100601 },
602 {
603 .name = "nrfiles",
604 .type = FIO_OPT_INT,
605 .off1 = td_var_offset(nr_files),
606 .help = "Split job workload between this number of files",
607 .def = "1",
608 },
609 {
610 .name = "openfiles",
611 .type = FIO_OPT_INT,
612 .off1 = td_var_offset(open_files),
613 .help = "Number of files to keep open at the same time",
614 },
615 {
616 .name = "file_service_type",
617 .type = FIO_OPT_STR,
618 .cb = str_fst_cb,
619 .off1 = td_var_offset(file_service_type),
620 .help = "How to select which file to service next",
621 .def = "roundrobin",
622 .posval = {
623 { .ival = "random",
624 .oval = FIO_FSERVICE_RANDOM,
625 .help = "Choose a file at random",
626 },
627 { .ival = "roundrobin",
628 .oval = FIO_FSERVICE_RR,
629 .help = "Round robin select files",
630 },
631 },
Jens Axboe67a10002007-07-31 23:12:16 +0200632 .parent = "nrfiles",
633 },
634 {
635 .name = "fadvise_hint",
636 .type = FIO_OPT_BOOL,
637 .off1 = td_var_offset(fadvise_hint),
638 .help = "Use fadvise() to advise the kernel on IO pattern",
639 .def = "1",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100640 },
641 {
642 .name = "fsync",
643 .type = FIO_OPT_INT,
644 .off1 = td_var_offset(fsync_blocks),
645 .help = "Issue fsync for writes every given number of blocks",
646 .def = "0",
647 },
648 {
649 .name = "direct",
650 .type = FIO_OPT_BOOL,
651 .off1 = td_var_offset(odirect),
652 .help = "Use O_DIRECT IO (negates buffered)",
653 .def = "0",
654 },
655 {
656 .name = "buffered",
657 .type = FIO_OPT_BOOL,
658 .off1 = td_var_offset(odirect),
659 .neg = 1,
660 .help = "Use buffered IO (negates direct)",
661 .def = "1",
662 },
663 {
664 .name = "overwrite",
665 .type = FIO_OPT_BOOL,
666 .off1 = td_var_offset(overwrite),
667 .help = "When writing, set whether to overwrite current data",
668 .def = "0",
669 },
670 {
671 .name = "loops",
672 .type = FIO_OPT_INT,
673 .off1 = td_var_offset(loops),
674 .help = "Number of times to run the job",
675 .def = "1",
676 },
677 {
678 .name = "numjobs",
679 .type = FIO_OPT_INT,
680 .off1 = td_var_offset(numjobs),
681 .help = "Duplicate this job this many times",
682 .def = "1",
683 },
684 {
685 .name = "startdelay",
686 .type = FIO_OPT_INT,
687 .off1 = td_var_offset(start_delay),
688 .help = "Only start job when this period has passed",
689 .def = "0",
690 },
691 {
692 .name = "runtime",
693 .alias = "timeout",
694 .type = FIO_OPT_STR_VAL_TIME,
695 .off1 = td_var_offset(timeout),
696 .help = "Stop workload when this amount of time has passed",
697 .def = "0",
698 },
699 {
Jens Axboecf4464c2007-04-17 20:14:42 +0200700 .name = "time_based",
701 .type = FIO_OPT_STR_SET,
702 .off1 = td_var_offset(time_based),
703 .help = "Keep running until runtime/timeout is met",
704 },
705 {
Jens Axboe214e1ec2007-03-15 10:48:13 +0100706 .name = "mem",
Jens Axboed3aad8f2007-03-15 14:12:05 +0100707 .alias = "iomem",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100708 .type = FIO_OPT_STR,
709 .cb = str_mem_cb,
710 .off1 = td_var_offset(mem_type),
711 .help = "Backing type for IO buffers",
712 .def = "malloc",
713 .posval = {
714 { .ival = "malloc",
715 .oval = MEM_MALLOC,
716 .help = "Use malloc(3) for IO buffers",
717 },
Jens Axboeb370e462007-03-19 10:51:49 +0100718 { .ival = "shm",
719 .oval = MEM_SHM,
720 .help = "Use shared memory segments for IO buffers",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100721 },
722#ifdef FIO_HAVE_HUGETLB
Jens Axboe37c8cdf2007-03-19 13:14:03 +0100723 { .ival = "shmhuge",
724 .oval = MEM_SHMHUGE,
725 .help = "Like shm, but use huge pages",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100726 },
727#endif
Jens Axboeb370e462007-03-19 10:51:49 +0100728 { .ival = "mmap",
729 .oval = MEM_MMAP,
730 .help = "Use mmap(2) (file or anon) for IO buffers",
731 },
Jens Axboe37c8cdf2007-03-19 13:14:03 +0100732#ifdef FIO_HAVE_HUGETLB
733 { .ival = "mmaphuge",
734 .oval = MEM_MMAPHUGE,
735 .help = "Like mmap, but use huge pages",
736 },
737#endif
Jens Axboe214e1ec2007-03-15 10:48:13 +0100738 },
739 },
740 {
741 .name = "verify",
742 .type = FIO_OPT_STR,
743 .off1 = td_var_offset(verify),
744 .help = "Verify data written",
745 .def = "0",
746 .posval = {
747 { .ival = "0",
748 .oval = VERIFY_NONE,
749 .help = "Don't do IO verification",
750 },
Jens Axboefcca4b52007-07-27 15:42:00 +0200751 { .ival = "md5",
752 .oval = VERIFY_MD5,
753 .help = "Use md5 checksums for verification",
754 },
Jens Axboed77a7af2007-07-27 15:35:06 +0200755 { .ival = "crc64",
756 .oval = VERIFY_CRC64,
757 .help = "Use crc64 checksums for verification",
758 },
Jens Axboe214e1ec2007-03-15 10:48:13 +0100759 { .ival = "crc32",
760 .oval = VERIFY_CRC32,
761 .help = "Use crc32 checksums for verification",
762 },
Jens Axboe969f7ed2007-07-27 09:07:17 +0200763 { .ival = "crc16",
764 .oval = VERIFY_CRC16,
765 .help = "Use crc16 checksums for verification",
766 },
Jens Axboe1e154bd2007-07-27 09:52:40 +0200767 { .ival = "crc7",
768 .oval = VERIFY_CRC7,
769 .help = "Use crc7 checksums for verification",
770 },
Jens Axboecd14cc12007-07-30 10:59:33 +0200771 { .ival = "sha256",
772 .oval = VERIFY_SHA256,
773 .help = "Use sha256 checksums for verification",
774 },
775 { .ival = "sha512",
776 .oval = VERIFY_SHA512,
777 .help = "Use sha512 checksums for verification",
778 },
Shawn Lewis7437ee82007-08-02 21:05:58 +0200779 { .ival = "meta",
780 .oval = VERIFY_META,
781 .help = "Use io information",
782 },
Jens Axboe36690c92007-03-26 10:23:34 +0200783 {
784 .ival = "null",
785 .oval = VERIFY_NULL,
786 .help = "Pretend to verify",
787 },
Jens Axboe214e1ec2007-03-15 10:48:13 +0100788 },
789 },
790 {
Jens Axboe005c5652007-08-02 22:21:36 +0200791 .name = "do_verify",
Jens Axboe68e1f292007-08-10 10:32:14 +0200792 .type = FIO_OPT_BOOL,
Jens Axboe005c5652007-08-02 22:21:36 +0200793 .off1 = td_var_offset(do_verify),
794 .help = "Run verification stage after write",
795 .def = "1",
796 .parent = "verify",
797 },
798 {
Jens Axboe160b9662007-03-27 10:59:49 +0200799 .name = "verifysort",
800 .type = FIO_OPT_BOOL,
801 .off1 = td_var_offset(verifysort),
802 .help = "Sort written verify blocks for read back",
803 .def = "1",
Jens Axboec83f2df2007-07-31 22:51:47 +0200804 .parent = "verify",
Jens Axboe160b9662007-03-27 10:59:49 +0200805 },
806 {
Jens Axboea59e1702007-07-30 08:53:27 +0200807 .name = "verify_interval",
Shawn Lewis3f9f4e22007-07-28 21:10:37 +0200808 .type = FIO_OPT_STR_VAL_INT,
Jens Axboea59e1702007-07-30 08:53:27 +0200809 .off1 = td_var_offset(verify_interval),
Jens Axboe819a9682007-07-28 21:30:31 +0200810 .minval = 2 * sizeof(struct verify_header),
Jens Axboea59e1702007-07-30 08:53:27 +0200811 .help = "Store verify buffer header every N bytes",
Jens Axboeafdf9352007-07-31 16:14:34 +0200812 .parent = "verify",
Shawn Lewis3f9f4e22007-07-28 21:10:37 +0200813 },
814 {
Jens Axboea59e1702007-07-30 08:53:27 +0200815 .name = "verify_offset",
Shawn Lewis546a9142007-07-28 21:11:37 +0200816 .type = FIO_OPT_STR_VAL_INT,
Jens Axboea59e1702007-07-30 08:53:27 +0200817 .help = "Offset verify header location by N bytes",
Shawn Lewis546a9142007-07-28 21:11:37 +0200818 .def = "0",
Jens Axboea59e1702007-07-30 08:53:27 +0200819 .cb = str_verify_offset_cb,
Jens Axboeafdf9352007-07-31 16:14:34 +0200820 .parent = "verify",
Shawn Lewis546a9142007-07-28 21:11:37 +0200821 },
822 {
Shawn Lewise28218f2008-01-16 11:01:33 +0100823 .name = "verify_pattern",
824 .type = FIO_OPT_INT,
825 .cb = str_verify_pattern_cb,
826 .help = "Fill pattern for IO buffers",
827 .parent = "verify",
828 },
829 {
Jens Axboea12a3b42007-08-09 10:20:54 +0200830 .name = "verify_fatal",
Jens Axboe68e1f292007-08-10 10:32:14 +0200831 .type = FIO_OPT_BOOL,
Jens Axboea12a3b42007-08-09 10:20:54 +0200832 .off1 = td_var_offset(verify_fatal),
833 .def = "0",
834 .help = "Exit on a single verify failure, don't continue",
835 .parent = "verify",
836 },
837 {
Jens Axboe214e1ec2007-03-15 10:48:13 +0100838 .name = "write_iolog",
839 .type = FIO_OPT_STR_STORE,
840 .off1 = td_var_offset(write_iolog_file),
841 .help = "Store IO pattern to file",
842 },
843 {
844 .name = "read_iolog",
845 .type = FIO_OPT_STR_STORE,
846 .off1 = td_var_offset(read_iolog_file),
847 .help = "Playback IO pattern from file",
848 },
849 {
850 .name = "exec_prerun",
851 .type = FIO_OPT_STR_STORE,
852 .off1 = td_var_offset(exec_prerun),
853 .help = "Execute this file prior to running job",
854 },
855 {
856 .name = "exec_postrun",
857 .type = FIO_OPT_STR_STORE,
858 .off1 = td_var_offset(exec_postrun),
859 .help = "Execute this file after running job",
860 },
861#ifdef FIO_HAVE_IOSCHED_SWITCH
862 {
863 .name = "ioscheduler",
864 .type = FIO_OPT_STR_STORE,
865 .off1 = td_var_offset(ioscheduler),
866 .help = "Use this IO scheduler on the backing device",
867 },
868#endif
869 {
870 .name = "zonesize",
871 .type = FIO_OPT_STR_VAL,
872 .off1 = td_var_offset(zone_size),
873 .help = "Give size of an IO zone",
874 .def = "0",
875 },
876 {
877 .name = "zoneskip",
878 .type = FIO_OPT_STR_VAL,
879 .off1 = td_var_offset(zone_skip),
880 .help = "Space between IO zones",
881 .def = "0",
882 },
883 {
884 .name = "lockmem",
885 .type = FIO_OPT_STR_VAL,
886 .cb = str_lockmem_cb,
887 .help = "Lock down this amount of memory",
888 .def = "0",
889 },
890 {
Jens Axboe214e1ec2007-03-15 10:48:13 +0100891 .name = "rwmixread",
892 .type = FIO_OPT_INT,
Jens Axboee47f7992007-03-21 14:05:39 +0100893 .off1 = td_var_offset(rwmix[DDIR_READ]),
Jens Axboe214e1ec2007-03-15 10:48:13 +0100894 .maxval = 100,
895 .help = "Percentage of mixed workload that is reads",
896 .def = "50",
897 },
898 {
899 .name = "rwmixwrite",
900 .type = FIO_OPT_INT,
Jens Axboee47f7992007-03-21 14:05:39 +0100901 .off1 = td_var_offset(rwmix[DDIR_WRITE]),
Jens Axboe214e1ec2007-03-15 10:48:13 +0100902 .maxval = 100,
903 .help = "Percentage of mixed workload that is writes",
904 .def = "50",
905 },
906 {
Jens Axboeafdf9352007-07-31 16:14:34 +0200907 .name = "rwmixcycle",
908 .type = FIO_OPT_INT,
909 .off1 = td_var_offset(rwmixcycle),
910 .help = "Cycle period for mixed read/write workloads (msec)",
911 .def = "500",
912 .parent = "rwmixread",
913 },
914 {
Jens Axboe214e1ec2007-03-15 10:48:13 +0100915 .name = "nice",
916 .type = FIO_OPT_INT,
917 .off1 = td_var_offset(nice),
918 .help = "Set job CPU nice value",
919 .minval = -19,
920 .maxval = 20,
921 .def = "0",
922 },
923#ifdef FIO_HAVE_IOPRIO
924 {
925 .name = "prio",
926 .type = FIO_OPT_INT,
927 .cb = str_prio_cb,
928 .help = "Set job IO priority value",
929 .minval = 0,
930 .maxval = 7,
931 },
932 {
933 .name = "prioclass",
934 .type = FIO_OPT_INT,
935 .cb = str_prioclass_cb,
936 .help = "Set job IO priority class",
937 .minval = 0,
938 .maxval = 3,
939 },
940#endif
941 {
942 .name = "thinktime",
943 .type = FIO_OPT_INT,
944 .off1 = td_var_offset(thinktime),
945 .help = "Idle time between IO buffers (usec)",
946 .def = "0",
947 },
948 {
949 .name = "thinktime_spin",
950 .type = FIO_OPT_INT,
951 .off1 = td_var_offset(thinktime_spin),
952 .help = "Start think time by spinning this amount (usec)",
953 .def = "0",
Jens Axboeafdf9352007-07-31 16:14:34 +0200954 .parent = "thinktime",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100955 },
956 {
957 .name = "thinktime_blocks",
958 .type = FIO_OPT_INT,
959 .off1 = td_var_offset(thinktime_blocks),
960 .help = "IO buffer period between 'thinktime'",
961 .def = "1",
Jens Axboeafdf9352007-07-31 16:14:34 +0200962 .parent = "thinktime",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100963 },
964 {
965 .name = "rate",
966 .type = FIO_OPT_INT,
967 .off1 = td_var_offset(rate),
968 .help = "Set bandwidth rate",
969 },
970 {
971 .name = "ratemin",
972 .type = FIO_OPT_INT,
973 .off1 = td_var_offset(ratemin),
Jens Axboe4e991c22007-03-15 11:41:11 +0100974 .help = "Job must meet this rate or it will be shutdown",
Jens Axboeafdf9352007-07-31 16:14:34 +0200975 .parent = "rate",
Jens Axboe4e991c22007-03-15 11:41:11 +0100976 },
977 {
978 .name = "rate_iops",
979 .type = FIO_OPT_INT,
980 .off1 = td_var_offset(rate_iops),
981 .help = "Limit IO used to this number of IO operations/sec",
982 },
983 {
984 .name = "rate_iops_min",
985 .type = FIO_OPT_INT,
986 .off1 = td_var_offset(rate_iops_min),
987 .help = "Job must meet this rate or it will be shutdown",
Jens Axboeafdf9352007-07-31 16:14:34 +0200988 .parent = "rate_iops",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100989 },
990 {
991 .name = "ratecycle",
992 .type = FIO_OPT_INT,
993 .off1 = td_var_offset(ratecycle),
994 .help = "Window average for rate limits (msec)",
995 .def = "1000",
Jens Axboeafdf9352007-07-31 16:14:34 +0200996 .parent = "rate",
Jens Axboe214e1ec2007-03-15 10:48:13 +0100997 },
998 {
999 .name = "invalidate",
1000 .type = FIO_OPT_BOOL,
1001 .off1 = td_var_offset(invalidate_cache),
1002 .help = "Invalidate buffer/page cache prior to running job",
1003 .def = "1",
1004 },
1005 {
1006 .name = "sync",
1007 .type = FIO_OPT_BOOL,
1008 .off1 = td_var_offset(sync_io),
1009 .help = "Use O_SYNC for buffered writes",
1010 .def = "0",
Jens Axboe67a10002007-07-31 23:12:16 +02001011 .parent = "buffered",
Jens Axboe214e1ec2007-03-15 10:48:13 +01001012 },
1013 {
1014 .name = "bwavgtime",
1015 .type = FIO_OPT_INT,
1016 .off1 = td_var_offset(bw_avg_time),
1017 .help = "Time window over which to calculate bandwidth (msec)",
1018 .def = "500",
1019 },
1020 {
1021 .name = "create_serialize",
1022 .type = FIO_OPT_BOOL,
1023 .off1 = td_var_offset(create_serialize),
1024 .help = "Serialize creating of job files",
1025 .def = "1",
1026 },
1027 {
1028 .name = "create_fsync",
1029 .type = FIO_OPT_BOOL,
1030 .off1 = td_var_offset(create_fsync),
1031 .help = "Fsync file after creation",
1032 .def = "1",
1033 },
1034 {
1035 .name = "cpuload",
1036 .type = FIO_OPT_INT,
1037 .off1 = td_var_offset(cpuload),
1038 .help = "Use this percentage of CPU",
1039 },
1040 {
1041 .name = "cpuchunks",
1042 .type = FIO_OPT_INT,
1043 .off1 = td_var_offset(cpucycle),
1044 .help = "Length of the CPU burn cycles (usecs)",
1045 .def = "50000",
Jens Axboe67a10002007-07-31 23:12:16 +02001046 .parent = "cpuload",
Jens Axboe214e1ec2007-03-15 10:48:13 +01001047 },
1048#ifdef FIO_HAVE_CPU_AFFINITY
1049 {
1050 .name = "cpumask",
1051 .type = FIO_OPT_INT,
1052 .cb = str_cpumask_cb,
1053 .help = "CPU affinity mask",
1054 },
Jens Axboed2e268b2007-06-15 10:33:49 +02001055 {
1056 .name = "cpus_allowed",
1057 .type = FIO_OPT_STR,
1058 .cb = str_cpus_allowed_cb,
1059 .help = "Set CPUs allowed",
1060 },
Jens Axboe214e1ec2007-03-15 10:48:13 +01001061#endif
1062 {
1063 .name = "end_fsync",
1064 .type = FIO_OPT_BOOL,
1065 .off1 = td_var_offset(end_fsync),
1066 .help = "Include fsync at the end of job",
1067 .def = "0",
1068 },
1069 {
1070 .name = "fsync_on_close",
1071 .type = FIO_OPT_BOOL,
1072 .off1 = td_var_offset(fsync_on_close),
1073 .help = "fsync files on close",
1074 .def = "0",
1075 },
1076 {
1077 .name = "unlink",
1078 .type = FIO_OPT_BOOL,
1079 .off1 = td_var_offset(unlink),
1080 .help = "Unlink created files after job has completed",
1081 .def = "0",
1082 },
1083 {
1084 .name = "exitall",
1085 .type = FIO_OPT_STR_SET,
1086 .cb = str_exitall_cb,
1087 .help = "Terminate all jobs when one exits",
1088 },
1089 {
1090 .name = "stonewall",
1091 .type = FIO_OPT_STR_SET,
1092 .off1 = td_var_offset(stonewall),
1093 .help = "Insert a hard barrier between this job and previous",
1094 },
1095 {
Jens Axboeb3d62a72007-03-20 14:23:26 +01001096 .name = "new_group",
1097 .type = FIO_OPT_STR_SET,
1098 .off1 = td_var_offset(new_group),
1099 .help = "Mark the start of a new group (for reporting)",
1100 },
1101 {
Jens Axboe214e1ec2007-03-15 10:48:13 +01001102 .name = "thread",
1103 .type = FIO_OPT_STR_SET,
1104 .off1 = td_var_offset(use_thread),
1105 .help = "Use threads instead of forks",
1106 },
1107 {
1108 .name = "write_bw_log",
1109 .type = FIO_OPT_STR_SET,
1110 .off1 = td_var_offset(write_bw_log),
1111 .help = "Write log of bandwidth during run",
1112 },
1113 {
1114 .name = "write_lat_log",
1115 .type = FIO_OPT_STR_SET,
1116 .off1 = td_var_offset(write_lat_log),
1117 .help = "Write log of latency during run",
1118 },
1119 {
1120 .name = "hugepage-size",
1121 .type = FIO_OPT_STR_VAL,
1122 .off1 = td_var_offset(hugepage_size),
1123 .help = "When using hugepages, specify size of each page",
1124 .def = __stringify(FIO_HUGE_PAGE),
1125 },
1126 {
1127 .name = "group_reporting",
1128 .type = FIO_OPT_STR_SET,
1129 .off1 = td_var_offset(group_reporting),
1130 .help = "Do reporting on a per-group basis",
1131 },
1132 {
Jens Axboee9459e52007-04-17 15:46:32 +02001133 .name = "zero_buffers",
1134 .type = FIO_OPT_STR_SET,
1135 .off1 = td_var_offset(zero_buffers),
1136 .help = "Init IO buffers to all zeroes",
1137 },
Jens Axboe0a839f32007-04-26 09:02:34 +02001138#ifdef FIO_HAVE_DISK_UTIL
1139 {
1140 .name = "disk_util",
1141 .type = FIO_OPT_BOOL,
1142 .off1 = td_var_offset(do_disk_util),
1143 .help = "Log disk utilization stats",
1144 .def = "1",
1145 },
1146#endif
Jens Axboee9459e52007-04-17 15:46:32 +02001147 {
Jens Axboe214e1ec2007-03-15 10:48:13 +01001148 .name = NULL,
1149 },
1150};
1151
1152void fio_options_dup_and_init(struct option *long_options)
1153{
1154 struct fio_option *o;
1155 unsigned int i;
1156
1157 options_init(options);
1158
1159 i = 0;
1160 while (long_options[i].name)
1161 i++;
1162
1163 o = &options[0];
1164 while (o->name) {
1165 long_options[i].name = o->name;
1166 long_options[i].val = FIO_GETOPT_JOB;
1167 if (o->type == FIO_OPT_STR_SET)
1168 long_options[i].has_arg = no_argument;
1169 else
1170 long_options[i].has_arg = required_argument;
1171
1172 i++;
1173 o++;
1174 assert(i < FIO_NR_OPTIONS);
1175 }
1176}
1177
1178int fio_option_parse(struct thread_data *td, const char *opt)
1179{
1180 return parse_option(opt, options, td);
1181}
1182
1183int fio_cmd_option_parse(struct thread_data *td, const char *opt, char *val)
1184{
1185 return parse_cmd_option(opt, val, options, td);
1186}
1187
1188void fio_fill_default_options(struct thread_data *td)
1189{
1190 fill_default_options(td, options);
1191}
1192
1193int fio_show_option_help(const char *opt)
1194{
1195 return show_cmd_help(options, opt);
1196}
Jens Axboed23bb322007-03-23 15:57:56 +01001197
1198static void __options_mem(struct thread_data *td, int alloc)
1199{
1200 struct thread_options *o = &td->o;
1201 struct fio_option *opt;
1202 char **ptr;
1203 int i;
1204
1205 for (i = 0, opt = &options[0]; opt->name; i++, opt = &options[i]) {
1206 if (opt->type != FIO_OPT_STR_STORE)
1207 continue;
1208
1209 ptr = (void *) o + opt->off1;
1210 if (*ptr) {
1211 if (alloc)
1212 *ptr = strdup(*ptr);
1213 else {
1214 free(*ptr);
1215 *ptr = NULL;
1216 }
1217 }
1218 }
1219}
1220
1221/*
1222 * dupe FIO_OPT_STR_STORE options
1223 */
1224void options_mem_dupe(struct thread_data *td)
1225{
1226 __options_mem(td, 1);
1227}
1228
Jens Axboe22d66212007-03-27 20:06:25 +02001229void options_mem_free(struct thread_data fio_unused *td)
Jens Axboed23bb322007-03-23 15:57:56 +01001230{
Jens Axboe22d66212007-03-27 20:06:25 +02001231#if 0
Jens Axboed23bb322007-03-23 15:57:56 +01001232 __options_mem(td, 0);
Jens Axboe22d66212007-03-27 20:06:25 +02001233#endif
Jens Axboed23bb322007-03-23 15:57:56 +01001234}