Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1 | #include <stdio.h> |
| 2 | #include <stdlib.h> |
| 3 | #include <unistd.h> |
| 4 | #include <ctype.h> |
| 5 | #include <string.h> |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 6 | #include <assert.h> |
Jens Axboe | 921c766 | 2008-03-26 09:17:55 +0100 | [diff] [blame] | 7 | #include <libgen.h> |
Jens Axboe | 5921e80 | 2008-05-30 15:02:38 +0200 | [diff] [blame] | 8 | #include <fcntl.h> |
| 9 | #include <sys/types.h> |
| 10 | #include <sys/stat.h> |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 11 | |
| 12 | #include "fio.h" |
Jens Axboe | 4f5af7b | 2009-06-03 08:45:40 +0200 | [diff] [blame] | 13 | #include "verify.h" |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 14 | #include "parse.h" |
Jens Axboe | eef3235 | 2008-06-02 13:31:26 +0200 | [diff] [blame] | 15 | #include "lib/fls.h" |
Jens Axboe | 9f988e2 | 2010-03-04 10:42:38 +0100 | [diff] [blame] | 16 | #include "options.h" |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 17 | |
Jens Axboe | 5d7c5d3 | 2010-06-21 15:08:17 +0200 | [diff] [blame] | 18 | #include "crc/crc32c.h" |
| 19 | |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 20 | /* |
| 21 | * Check if mmap/mmaphuge has a :/foo/bar/file at the end. If so, return that. |
| 22 | */ |
| 23 | static 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 | |
Radha Ramachandran | 0e92f87 | 2009-10-27 20:14:27 +0100 | [diff] [blame] | 36 | static int converthexchartoint(char a) |
| 37 | { |
| 38 | int base; |
| 39 | |
Jens Axboe | 3c3ed07 | 2012-03-27 09:12:39 +0200 | [diff] [blame] | 40 | switch (a) { |
Radha Ramachandran | 0e92f87 | 2009-10-27 20:14:27 +0100 | [diff] [blame] | 41 | case '0'...'9': |
| 42 | base = '0'; |
| 43 | break; |
| 44 | case 'A'...'F': |
| 45 | base = 'A' - 10; |
| 46 | break; |
| 47 | case 'a'...'f': |
| 48 | base = 'a' - 10; |
| 49 | break; |
| 50 | default: |
| 51 | base = 0; |
| 52 | } |
Jens Axboe | 3c3ed07 | 2012-03-27 09:12:39 +0200 | [diff] [blame] | 53 | return a - base; |
Radha Ramachandran | 0e92f87 | 2009-10-27 20:14:27 +0100 | [diff] [blame] | 54 | } |
| 55 | |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 56 | static int bs_cmp(const void *p1, const void *p2) |
| 57 | { |
| 58 | const struct bssplit *bsp1 = p1; |
| 59 | const struct bssplit *bsp2 = p2; |
| 60 | |
| 61 | return bsp1->perc < bsp2->perc; |
| 62 | } |
| 63 | |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 64 | static int bssplit_ddir(struct thread_options *o, int ddir, char *str) |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 65 | { |
Jens Axboe | 720e84a | 2009-04-21 08:29:55 +0200 | [diff] [blame] | 66 | struct bssplit *bssplit; |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 67 | unsigned int i, perc, perc_missing; |
| 68 | unsigned int max_bs, min_bs; |
| 69 | long long val; |
Jens Axboe | 720e84a | 2009-04-21 08:29:55 +0200 | [diff] [blame] | 70 | char *fname; |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 71 | |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 72 | o->bssplit_nr[ddir] = 4; |
Jens Axboe | 720e84a | 2009-04-21 08:29:55 +0200 | [diff] [blame] | 73 | bssplit = malloc(4 * sizeof(struct bssplit)); |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 74 | |
| 75 | i = 0; |
| 76 | max_bs = 0; |
| 77 | min_bs = -1; |
| 78 | while ((fname = strsep(&str, ":")) != NULL) { |
| 79 | char *perc_str; |
| 80 | |
| 81 | if (!strlen(fname)) |
| 82 | break; |
| 83 | |
| 84 | /* |
| 85 | * grow struct buffer, if needed |
| 86 | */ |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 87 | if (i == o->bssplit_nr[ddir]) { |
| 88 | o->bssplit_nr[ddir] <<= 1; |
| 89 | bssplit = realloc(bssplit, o->bssplit_nr[ddir] |
Jens Axboe | 5ec10ea | 2008-03-06 15:42:00 +0100 | [diff] [blame] | 90 | * sizeof(struct bssplit)); |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 91 | } |
| 92 | |
| 93 | perc_str = strstr(fname, "/"); |
| 94 | if (perc_str) { |
| 95 | *perc_str = '\0'; |
| 96 | perc_str++; |
| 97 | perc = atoi(perc_str); |
| 98 | if (perc > 100) |
| 99 | perc = 100; |
| 100 | else if (!perc) |
| 101 | perc = -1; |
| 102 | } else |
| 103 | perc = -1; |
| 104 | |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 105 | if (str_to_decimal(fname, &val, 1, o)) { |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 106 | log_err("fio: bssplit conversion failed\n"); |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 107 | free(o->bssplit); |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 108 | return 1; |
| 109 | } |
| 110 | |
| 111 | if (val > max_bs) |
| 112 | max_bs = val; |
| 113 | if (val < min_bs) |
| 114 | min_bs = val; |
| 115 | |
Jens Axboe | 720e84a | 2009-04-21 08:29:55 +0200 | [diff] [blame] | 116 | bssplit[i].bs = val; |
| 117 | bssplit[i].perc = perc; |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 118 | i++; |
| 119 | } |
| 120 | |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 121 | o->bssplit_nr[ddir] = i; |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 122 | |
| 123 | /* |
| 124 | * Now check if the percentages add up, and how much is missing |
| 125 | */ |
| 126 | perc = perc_missing = 0; |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 127 | for (i = 0; i < o->bssplit_nr[ddir]; i++) { |
Jens Axboe | 720e84a | 2009-04-21 08:29:55 +0200 | [diff] [blame] | 128 | struct bssplit *bsp = &bssplit[i]; |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 129 | |
| 130 | if (bsp->perc == (unsigned char) -1) |
| 131 | perc_missing++; |
| 132 | else |
| 133 | perc += bsp->perc; |
| 134 | } |
| 135 | |
| 136 | if (perc > 100) { |
| 137 | log_err("fio: bssplit percentages add to more than 100%%\n"); |
Jens Axboe | 720e84a | 2009-04-21 08:29:55 +0200 | [diff] [blame] | 138 | free(bssplit); |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 139 | return 1; |
| 140 | } |
| 141 | /* |
| 142 | * If values didn't have a percentage set, divide the remains between |
| 143 | * them. |
| 144 | */ |
| 145 | if (perc_missing) { |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 146 | for (i = 0; i < o->bssplit_nr[ddir]; i++) { |
Jens Axboe | 720e84a | 2009-04-21 08:29:55 +0200 | [diff] [blame] | 147 | struct bssplit *bsp = &bssplit[i]; |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 148 | |
| 149 | if (bsp->perc == (unsigned char) -1) |
| 150 | bsp->perc = (100 - perc) / perc_missing; |
| 151 | } |
| 152 | } |
| 153 | |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 154 | o->min_bs[ddir] = min_bs; |
| 155 | o->max_bs[ddir] = max_bs; |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 156 | |
| 157 | /* |
| 158 | * now sort based on percentages, for ease of lookup |
| 159 | */ |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 160 | qsort(bssplit, o->bssplit_nr[ddir], sizeof(struct bssplit), bs_cmp); |
| 161 | o->bssplit[ddir] = bssplit; |
Jens Axboe | 720e84a | 2009-04-21 08:29:55 +0200 | [diff] [blame] | 162 | return 0; |
Jens Axboe | 720e84a | 2009-04-21 08:29:55 +0200 | [diff] [blame] | 163 | } |
| 164 | |
| 165 | static int str_bssplit_cb(void *data, const char *input) |
| 166 | { |
| 167 | struct thread_data *td = data; |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 168 | char *str, *p, *odir, *ddir; |
Jens Axboe | 720e84a | 2009-04-21 08:29:55 +0200 | [diff] [blame] | 169 | int ret = 0; |
| 170 | |
| 171 | p = str = strdup(input); |
| 172 | |
| 173 | strip_blank_front(&str); |
| 174 | strip_blank_end(str); |
| 175 | |
| 176 | odir = strchr(str, ','); |
| 177 | if (odir) { |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 178 | ddir = strchr(odir + 1, ','); |
| 179 | if (ddir) { |
Jens Axboe | d79db12 | 2012-09-24 08:51:24 +0200 | [diff] [blame] | 180 | ret = bssplit_ddir(&td->o, DDIR_TRIM, ddir + 1); |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 181 | if (!ret) |
| 182 | *ddir = '\0'; |
| 183 | } else { |
| 184 | char *op; |
| 185 | |
| 186 | op = strdup(odir + 1); |
Jens Axboe | d79db12 | 2012-09-24 08:51:24 +0200 | [diff] [blame] | 187 | ret = bssplit_ddir(&td->o, DDIR_TRIM, op); |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 188 | |
| 189 | free(op); |
| 190 | } |
Jens Axboe | d79db12 | 2012-09-24 08:51:24 +0200 | [diff] [blame] | 191 | if (!ret) |
| 192 | ret = bssplit_ddir(&td->o, DDIR_WRITE, odir + 1); |
Jens Axboe | 720e84a | 2009-04-21 08:29:55 +0200 | [diff] [blame] | 193 | if (!ret) { |
| 194 | *odir = '\0'; |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 195 | ret = bssplit_ddir(&td->o, DDIR_READ, str); |
Jens Axboe | 720e84a | 2009-04-21 08:29:55 +0200 | [diff] [blame] | 196 | } |
| 197 | } else { |
| 198 | char *op; |
| 199 | |
| 200 | op = strdup(str); |
Jens Axboe | d79db12 | 2012-09-24 08:51:24 +0200 | [diff] [blame] | 201 | ret = bssplit_ddir(&td->o, DDIR_WRITE, op); |
Jens Axboe | 720e84a | 2009-04-21 08:29:55 +0200 | [diff] [blame] | 202 | free(op); |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 203 | |
| 204 | if (!ret) { |
| 205 | op = strdup(str); |
Jens Axboe | d79db12 | 2012-09-24 08:51:24 +0200 | [diff] [blame] | 206 | ret = bssplit_ddir(&td->o, DDIR_TRIM, op); |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 207 | free(op); |
| 208 | } |
Jens Axboe | d79db12 | 2012-09-24 08:51:24 +0200 | [diff] [blame] | 209 | ret = bssplit_ddir(&td->o, DDIR_READ, str); |
Jens Axboe | 720e84a | 2009-04-21 08:29:55 +0200 | [diff] [blame] | 210 | } |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 211 | |
| 212 | free(p); |
Jens Axboe | 720e84a | 2009-04-21 08:29:55 +0200 | [diff] [blame] | 213 | return ret; |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 214 | } |
| 215 | |
Dmitry Monakhov | 8b28bd4 | 2012-09-23 15:46:09 +0400 | [diff] [blame] | 216 | static int str2error(char *str) |
| 217 | { |
| 218 | const char * err[] = {"EPERM", "ENOENT", "ESRCH", "EINTR", "EIO", |
| 219 | "ENXIO", "E2BIG", "ENOEXEC", "EBADF", |
| 220 | "ECHILD", "EAGAIN", "ENOMEM", "EACCES", |
| 221 | "EFAULT", "ENOTBLK", "EBUSY", "EEXIST", |
| 222 | "EXDEV", "ENODEV", "ENOTDIR", "EISDIR", |
| 223 | "EINVAL", "ENFILE", "EMFILE", "ENOTTY", |
| 224 | "ETXTBSY","EFBIG", "ENOSPC", "ESPIPE", |
| 225 | "EROFS","EMLINK", "EPIPE", "EDOM", "ERANGE"}; |
| 226 | int i = 0, num = sizeof(err) / sizeof(void *); |
| 227 | |
| 228 | while( i < num) { |
| 229 | if (!strcmp(err[i], str)) |
| 230 | return i + 1; |
| 231 | i++; |
| 232 | } |
| 233 | return 0; |
| 234 | } |
| 235 | |
| 236 | static int ignore_error_type(struct thread_data *td, int etype, char *str) |
| 237 | { |
| 238 | unsigned int i; |
| 239 | int *error; |
| 240 | char *fname; |
| 241 | |
| 242 | if (etype >= ERROR_TYPE_CNT) { |
| 243 | log_err("Illegal error type\n"); |
| 244 | return 1; |
| 245 | } |
| 246 | |
| 247 | td->o.ignore_error_nr[etype] = 4; |
| 248 | error = malloc(4 * sizeof(struct bssplit)); |
| 249 | |
| 250 | i = 0; |
| 251 | while ((fname = strsep(&str, ":")) != NULL) { |
| 252 | |
| 253 | if (!strlen(fname)) |
| 254 | break; |
| 255 | |
| 256 | /* |
| 257 | * grow struct buffer, if needed |
| 258 | */ |
| 259 | if (i == td->o.ignore_error_nr[etype]) { |
| 260 | td->o.ignore_error_nr[etype] <<= 1; |
| 261 | error = realloc(error, td->o.ignore_error_nr[etype] |
| 262 | * sizeof(int)); |
| 263 | } |
| 264 | if (fname[0] == 'E') { |
| 265 | error[i] = str2error(fname); |
| 266 | } else { |
| 267 | error[i] = atoi(fname); |
| 268 | if (error[i] < 0) |
| 269 | error[i] = error[i]; |
| 270 | } |
| 271 | if (!error[i]) { |
| 272 | log_err("Unknown error %s, please use number value \n", |
| 273 | fname); |
| 274 | return 1; |
| 275 | } |
| 276 | i++; |
| 277 | } |
| 278 | if (i) { |
| 279 | td->o.continue_on_error |= 1 << etype; |
| 280 | td->o.ignore_error_nr[etype] = i; |
| 281 | td->o.ignore_error[etype] = error; |
| 282 | } |
| 283 | return 0; |
| 284 | |
| 285 | } |
| 286 | |
| 287 | static int str_ignore_error_cb(void *data, const char *input) |
| 288 | { |
| 289 | struct thread_data *td = data; |
| 290 | char *str, *p, *n; |
| 291 | int type = 0, ret = 1; |
| 292 | p = str = strdup(input); |
| 293 | |
| 294 | strip_blank_front(&str); |
| 295 | strip_blank_end(str); |
| 296 | |
| 297 | while (p) { |
| 298 | n = strchr(p, ','); |
| 299 | if (n) |
| 300 | *n++ = '\0'; |
| 301 | ret = ignore_error_type(td, type, p); |
| 302 | if (ret) |
| 303 | break; |
| 304 | p = n; |
| 305 | type++; |
| 306 | } |
| 307 | free(str); |
| 308 | return ret; |
| 309 | } |
| 310 | |
Jens Axboe | 211097b | 2007-03-22 18:56:45 +0100 | [diff] [blame] | 311 | static int str_rw_cb(void *data, const char *str) |
| 312 | { |
| 313 | struct thread_data *td = data; |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 314 | struct thread_options *o = &td->o; |
Jens Axboe | 211097b | 2007-03-22 18:56:45 +0100 | [diff] [blame] | 315 | char *nr = get_opt_postfix(str); |
| 316 | |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 317 | o->ddir_seq_nr = 1; |
| 318 | o->ddir_seq_add = 0; |
Jens Axboe | 059b080 | 2011-08-25 09:09:37 +0200 | [diff] [blame] | 319 | |
| 320 | if (!nr) |
| 321 | return 0; |
| 322 | |
| 323 | if (td_random(td)) |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 324 | o->ddir_seq_nr = atoi(nr); |
Jens Axboe | 059b080 | 2011-08-25 09:09:37 +0200 | [diff] [blame] | 325 | else { |
| 326 | long long val; |
| 327 | |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 328 | if (str_to_decimal(nr, &val, 1, o)) { |
Jens Axboe | 059b080 | 2011-08-25 09:09:37 +0200 | [diff] [blame] | 329 | log_err("fio: rw postfix parsing failed\n"); |
| 330 | free(nr); |
| 331 | return 1; |
| 332 | } |
| 333 | |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 334 | o->ddir_seq_add = val; |
Jens Axboe | 182ec6e | 2008-11-14 13:06:06 +0100 | [diff] [blame] | 335 | } |
Jens Axboe | 211097b | 2007-03-22 18:56:45 +0100 | [diff] [blame] | 336 | |
Jens Axboe | 059b080 | 2011-08-25 09:09:37 +0200 | [diff] [blame] | 337 | free(nr); |
Jens Axboe | 211097b | 2007-03-22 18:56:45 +0100 | [diff] [blame] | 338 | return 0; |
| 339 | } |
| 340 | |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 341 | static int str_mem_cb(void *data, const char *mem) |
| 342 | { |
| 343 | struct thread_data *td = data; |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 344 | struct thread_options *o = &td->o; |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 345 | |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 346 | if (o->mem_type == MEM_MMAPHUGE || o->mem_type == MEM_MMAP) { |
| 347 | o->mmapfile = get_opt_postfix(mem); |
| 348 | if (o->mem_type == MEM_MMAPHUGE && !o->mmapfile) { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 349 | log_err("fio: mmaphuge:/path/to/file\n"); |
| 350 | return 1; |
| 351 | } |
| 352 | } |
| 353 | |
| 354 | return 0; |
| 355 | } |
| 356 | |
Jens Axboe | c223da8 | 2010-03-24 13:23:53 +0100 | [diff] [blame] | 357 | static int fio_clock_source_cb(void *data, const char *str) |
| 358 | { |
| 359 | struct thread_data *td = data; |
| 360 | |
| 361 | fio_clock_source = td->o.clocksource; |
| 362 | fio_time_init(); |
| 363 | return 0; |
| 364 | } |
| 365 | |
Cigy Cyriac | 85bc833 | 2010-08-10 19:21:09 -0400 | [diff] [blame] | 366 | static int str_rwmix_read_cb(void *data, unsigned long long *val) |
Jens Axboe | cb499fc | 2008-05-28 10:33:32 +0200 | [diff] [blame] | 367 | { |
| 368 | struct thread_data *td = data; |
| 369 | |
| 370 | td->o.rwmix[DDIR_READ] = *val; |
| 371 | td->o.rwmix[DDIR_WRITE] = 100 - *val; |
| 372 | return 0; |
| 373 | } |
| 374 | |
Cigy Cyriac | 85bc833 | 2010-08-10 19:21:09 -0400 | [diff] [blame] | 375 | static int str_rwmix_write_cb(void *data, unsigned long long *val) |
Jens Axboe | cb499fc | 2008-05-28 10:33:32 +0200 | [diff] [blame] | 376 | { |
| 377 | struct thread_data *td = data; |
| 378 | |
| 379 | td->o.rwmix[DDIR_WRITE] = *val; |
| 380 | td->o.rwmix[DDIR_READ] = 100 - *val; |
| 381 | return 0; |
| 382 | } |
| 383 | |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 384 | static int str_exitall_cb(void) |
| 385 | { |
| 386 | exitall_on_terminate = 1; |
| 387 | return 0; |
| 388 | } |
| 389 | |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 390 | #ifdef FIO_HAVE_CPU_AFFINITY |
Cigy Cyriac | 85bc833 | 2010-08-10 19:21:09 -0400 | [diff] [blame] | 391 | static int str_cpumask_cb(void *data, unsigned long long *val) |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 392 | { |
| 393 | struct thread_data *td = data; |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 394 | unsigned int i; |
Jens Axboe | b03daaf | 2008-12-08 20:31:43 +0100 | [diff] [blame] | 395 | long max_cpu; |
Jens Axboe | d2ce18b | 2008-12-12 20:51:40 +0100 | [diff] [blame] | 396 | int ret; |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 397 | |
Jens Axboe | d2ce18b | 2008-12-12 20:51:40 +0100 | [diff] [blame] | 398 | ret = fio_cpuset_init(&td->o.cpumask); |
| 399 | if (ret < 0) { |
| 400 | log_err("fio: cpuset_init failed\n"); |
| 401 | td_verror(td, ret, "fio_cpuset_init"); |
| 402 | return 1; |
| 403 | } |
| 404 | |
Jens Axboe | c00a228 | 2011-07-08 20:56:06 +0200 | [diff] [blame] | 405 | max_cpu = cpus_online(); |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 406 | |
Jens Axboe | 62a7273 | 2008-12-08 11:37:01 +0100 | [diff] [blame] | 407 | for (i = 0; i < sizeof(int) * 8; i++) { |
| 408 | if ((1 << i) & *val) { |
Jens Axboe | b03daaf | 2008-12-08 20:31:43 +0100 | [diff] [blame] | 409 | if (i > max_cpu) { |
| 410 | log_err("fio: CPU %d too large (max=%ld)\n", i, |
| 411 | max_cpu); |
| 412 | return 1; |
| 413 | } |
Jens Axboe | 62a7273 | 2008-12-08 11:37:01 +0100 | [diff] [blame] | 414 | dprint(FD_PARSE, "set cpu allowed %d\n", i); |
Jens Axboe | 6d459ee | 2008-12-12 20:02:58 +0100 | [diff] [blame] | 415 | fio_cpu_set(&td->o.cpumask, i); |
Jens Axboe | 62a7273 | 2008-12-08 11:37:01 +0100 | [diff] [blame] | 416 | } |
| 417 | } |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 418 | |
Jens Axboe | 375b269 | 2007-05-22 09:13:02 +0200 | [diff] [blame] | 419 | td->o.cpumask_set = 1; |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 420 | return 0; |
| 421 | } |
| 422 | |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 423 | static int set_cpus_allowed(struct thread_data *td, os_cpu_mask_t *mask, |
| 424 | const char *input) |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 425 | { |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 426 | char *cpu, *str, *p; |
Jens Axboe | b03daaf | 2008-12-08 20:31:43 +0100 | [diff] [blame] | 427 | long max_cpu; |
Jens Axboe | 19608d6 | 2008-12-08 15:03:12 +0100 | [diff] [blame] | 428 | int ret = 0; |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 429 | |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 430 | ret = fio_cpuset_init(mask); |
Jens Axboe | d2ce18b | 2008-12-12 20:51:40 +0100 | [diff] [blame] | 431 | if (ret < 0) { |
| 432 | log_err("fio: cpuset_init failed\n"); |
| 433 | td_verror(td, ret, "fio_cpuset_init"); |
| 434 | return 1; |
| 435 | } |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 436 | |
| 437 | p = str = strdup(input); |
| 438 | |
| 439 | strip_blank_front(&str); |
| 440 | strip_blank_end(str); |
| 441 | |
Jens Axboe | c00a228 | 2011-07-08 20:56:06 +0200 | [diff] [blame] | 442 | max_cpu = cpus_online(); |
Jens Axboe | b03daaf | 2008-12-08 20:31:43 +0100 | [diff] [blame] | 443 | |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 444 | while ((cpu = strsep(&str, ",")) != NULL) { |
Jens Axboe | 62a7273 | 2008-12-08 11:37:01 +0100 | [diff] [blame] | 445 | char *str2, *cpu2; |
| 446 | int icpu, icpu2; |
| 447 | |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 448 | if (!strlen(cpu)) |
| 449 | break; |
Jens Axboe | 62a7273 | 2008-12-08 11:37:01 +0100 | [diff] [blame] | 450 | |
| 451 | str2 = cpu; |
| 452 | icpu2 = -1; |
| 453 | while ((cpu2 = strsep(&str2, "-")) != NULL) { |
| 454 | if (!strlen(cpu2)) |
| 455 | break; |
| 456 | |
| 457 | icpu2 = atoi(cpu2); |
| 458 | } |
| 459 | |
| 460 | icpu = atoi(cpu); |
| 461 | if (icpu2 == -1) |
| 462 | icpu2 = icpu; |
| 463 | while (icpu <= icpu2) { |
Jens Axboe | 6d459ee | 2008-12-12 20:02:58 +0100 | [diff] [blame] | 464 | if (icpu >= FIO_MAX_CPUS) { |
Jens Axboe | 19608d6 | 2008-12-08 15:03:12 +0100 | [diff] [blame] | 465 | log_err("fio: your OS only supports up to" |
Jens Axboe | 6d459ee | 2008-12-12 20:02:58 +0100 | [diff] [blame] | 466 | " %d CPUs\n", (int) FIO_MAX_CPUS); |
Jens Axboe | 19608d6 | 2008-12-08 15:03:12 +0100 | [diff] [blame] | 467 | ret = 1; |
| 468 | break; |
| 469 | } |
Jens Axboe | b03daaf | 2008-12-08 20:31:43 +0100 | [diff] [blame] | 470 | if (icpu > max_cpu) { |
| 471 | log_err("fio: CPU %d too large (max=%ld)\n", |
| 472 | icpu, max_cpu); |
| 473 | ret = 1; |
| 474 | break; |
| 475 | } |
Jens Axboe | 0b9d69e | 2009-09-11 22:29:54 +0200 | [diff] [blame] | 476 | |
Jens Axboe | 62a7273 | 2008-12-08 11:37:01 +0100 | [diff] [blame] | 477 | dprint(FD_PARSE, "set cpu allowed %d\n", icpu); |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 478 | fio_cpu_set(mask, icpu); |
Jens Axboe | 62a7273 | 2008-12-08 11:37:01 +0100 | [diff] [blame] | 479 | icpu++; |
| 480 | } |
Jens Axboe | 19608d6 | 2008-12-08 15:03:12 +0100 | [diff] [blame] | 481 | if (ret) |
| 482 | break; |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 483 | } |
| 484 | |
| 485 | free(p); |
Jens Axboe | 19608d6 | 2008-12-08 15:03:12 +0100 | [diff] [blame] | 486 | if (!ret) |
| 487 | td->o.cpumask_set = 1; |
| 488 | return ret; |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 489 | } |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 490 | |
| 491 | static int str_cpus_allowed_cb(void *data, const char *input) |
| 492 | { |
| 493 | struct thread_data *td = data; |
| 494 | int ret; |
| 495 | |
| 496 | ret = set_cpus_allowed(td, &td->o.cpumask, input); |
| 497 | if (!ret) |
| 498 | td->o.cpumask_set = 1; |
| 499 | |
| 500 | return ret; |
| 501 | } |
| 502 | |
| 503 | static int str_verify_cpus_allowed_cb(void *data, const char *input) |
| 504 | { |
| 505 | struct thread_data *td = data; |
| 506 | int ret; |
| 507 | |
| 508 | ret = set_cpus_allowed(td, &td->o.verify_cpumask, input); |
| 509 | if (!ret) |
| 510 | td->o.verify_cpumask_set = 1; |
| 511 | |
| 512 | return ret; |
| 513 | } |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 514 | #endif |
| 515 | |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 516 | static int str_fst_cb(void *data, const char *str) |
| 517 | { |
| 518 | struct thread_data *td = data; |
| 519 | char *nr = get_opt_postfix(str); |
| 520 | |
| 521 | td->file_service_nr = 1; |
Jens Axboe | 182ec6e | 2008-11-14 13:06:06 +0100 | [diff] [blame] | 522 | if (nr) { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 523 | td->file_service_nr = atoi(nr); |
Jens Axboe | 182ec6e | 2008-11-14 13:06:06 +0100 | [diff] [blame] | 524 | free(nr); |
| 525 | } |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 526 | |
| 527 | return 0; |
| 528 | } |
| 529 | |
Jens Axboe | 3ae0637 | 2010-03-19 19:17:15 +0100 | [diff] [blame] | 530 | #ifdef FIO_HAVE_SYNC_FILE_RANGE |
Jens Axboe | 44f2969 | 2010-03-09 20:09:44 +0100 | [diff] [blame] | 531 | static int str_sfr_cb(void *data, const char *str) |
| 532 | { |
| 533 | struct thread_data *td = data; |
| 534 | char *nr = get_opt_postfix(str); |
| 535 | |
| 536 | td->sync_file_range_nr = 1; |
| 537 | if (nr) { |
| 538 | td->sync_file_range_nr = atoi(nr); |
| 539 | free(nr); |
| 540 | } |
| 541 | |
| 542 | return 0; |
| 543 | } |
Jens Axboe | 3ae0637 | 2010-03-19 19:17:15 +0100 | [diff] [blame] | 544 | #endif |
Jens Axboe | 44f2969 | 2010-03-09 20:09:44 +0100 | [diff] [blame] | 545 | |
Jens Axboe | 8e827d3 | 2009-08-04 09:51:48 +0200 | [diff] [blame] | 546 | /* |
| 547 | * Return next file in the string. Files are separated with ':'. If the ':' |
| 548 | * is escaped with a '\', then that ':' is part of the filename and does not |
| 549 | * indicate a new file. |
| 550 | */ |
| 551 | static char *get_next_file_name(char **ptr) |
| 552 | { |
| 553 | char *str = *ptr; |
| 554 | char *p, *start; |
| 555 | |
| 556 | if (!str || !strlen(str)) |
| 557 | return NULL; |
| 558 | |
| 559 | start = str; |
| 560 | do { |
| 561 | /* |
| 562 | * No colon, we are done |
| 563 | */ |
| 564 | p = strchr(str, ':'); |
| 565 | if (!p) { |
| 566 | *ptr = NULL; |
| 567 | break; |
| 568 | } |
| 569 | |
| 570 | /* |
| 571 | * We got a colon, but it's the first character. Skip and |
| 572 | * continue |
| 573 | */ |
| 574 | if (p == start) { |
| 575 | str = ++start; |
| 576 | continue; |
| 577 | } |
| 578 | |
| 579 | if (*(p - 1) != '\\') { |
| 580 | *p = '\0'; |
| 581 | *ptr = p + 1; |
| 582 | break; |
| 583 | } |
| 584 | |
| 585 | memmove(p - 1, p, strlen(p) + 1); |
| 586 | str = p; |
| 587 | } while (1); |
| 588 | |
| 589 | return start; |
| 590 | } |
| 591 | |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 592 | static int str_filename_cb(void *data, const char *input) |
| 593 | { |
| 594 | struct thread_data *td = data; |
| 595 | char *fname, *str, *p; |
| 596 | |
| 597 | p = str = strdup(input); |
| 598 | |
| 599 | strip_blank_front(&str); |
| 600 | strip_blank_end(str); |
| 601 | |
| 602 | if (!td->files_index) |
Jens Axboe | 2dc1bbe | 2007-03-15 15:01:33 +0100 | [diff] [blame] | 603 | td->o.nr_files = 0; |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 604 | |
Jens Axboe | 8e827d3 | 2009-08-04 09:51:48 +0200 | [diff] [blame] | 605 | while ((fname = get_next_file_name(&str)) != NULL) { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 606 | if (!strlen(fname)) |
| 607 | break; |
| 608 | add_file(td, fname); |
Jens Axboe | 2dc1bbe | 2007-03-15 15:01:33 +0100 | [diff] [blame] | 609 | td->o.nr_files++; |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 610 | } |
| 611 | |
| 612 | free(p); |
| 613 | return 0; |
| 614 | } |
| 615 | |
| 616 | static int str_directory_cb(void *data, const char fio_unused *str) |
| 617 | { |
| 618 | struct thread_data *td = data; |
| 619 | struct stat sb; |
| 620 | |
Jens Axboe | 2dc1bbe | 2007-03-15 15:01:33 +0100 | [diff] [blame] | 621 | if (lstat(td->o.directory, &sb) < 0) { |
Jens Axboe | 921c766 | 2008-03-26 09:17:55 +0100 | [diff] [blame] | 622 | int ret = errno; |
| 623 | |
Jens Axboe | 2dc1bbe | 2007-03-15 15:01:33 +0100 | [diff] [blame] | 624 | log_err("fio: %s is not a directory\n", td->o.directory); |
Jens Axboe | 921c766 | 2008-03-26 09:17:55 +0100 | [diff] [blame] | 625 | td_verror(td, ret, "lstat"); |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 626 | return 1; |
| 627 | } |
| 628 | if (!S_ISDIR(sb.st_mode)) { |
Jens Axboe | 2dc1bbe | 2007-03-15 15:01:33 +0100 | [diff] [blame] | 629 | log_err("fio: %s is not a directory\n", td->o.directory); |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 630 | return 1; |
| 631 | } |
| 632 | |
| 633 | return 0; |
| 634 | } |
| 635 | |
| 636 | static int str_opendir_cb(void *data, const char fio_unused *str) |
| 637 | { |
| 638 | struct thread_data *td = data; |
| 639 | |
| 640 | if (!td->files_index) |
Jens Axboe | 2dc1bbe | 2007-03-15 15:01:33 +0100 | [diff] [blame] | 641 | td->o.nr_files = 0; |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 642 | |
Jens Axboe | 2dc1bbe | 2007-03-15 15:01:33 +0100 | [diff] [blame] | 643 | return add_dir_files(td, td->o.opendir); |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 644 | } |
| 645 | |
Radha Ramachandran | 0e92f87 | 2009-10-27 20:14:27 +0100 | [diff] [blame] | 646 | static int str_verify_pattern_cb(void *data, const char *input) |
Jens Axboe | 90059d6 | 2007-07-30 09:33:12 +0200 | [diff] [blame] | 647 | { |
| 648 | struct thread_data *td = data; |
Radha Ramachandran | 0e92f87 | 2009-10-27 20:14:27 +0100 | [diff] [blame] | 649 | long off; |
| 650 | int i = 0, j = 0, len, k, base = 10; |
Jens Axboe | 3c3ed07 | 2012-03-27 09:12:39 +0200 | [diff] [blame] | 651 | char *loc1, *loc2; |
Jens Axboe | 90059d6 | 2007-07-30 09:33:12 +0200 | [diff] [blame] | 652 | |
Radha Ramachandran | 0e92f87 | 2009-10-27 20:14:27 +0100 | [diff] [blame] | 653 | loc1 = strstr(input, "0x"); |
| 654 | loc2 = strstr(input, "0X"); |
| 655 | if (loc1 || loc2) |
| 656 | base = 16; |
| 657 | off = strtol(input, NULL, base); |
| 658 | if (off != LONG_MAX || errno != ERANGE) { |
| 659 | while (off) { |
| 660 | td->o.verify_pattern[i] = off & 0xff; |
| 661 | off >>= 8; |
| 662 | i++; |
| 663 | } |
| 664 | } else { |
| 665 | len = strlen(input); |
| 666 | k = len - 1; |
| 667 | if (base == 16) { |
| 668 | if (loc1) |
| 669 | j = loc1 - input + 2; |
| 670 | else |
| 671 | j = loc2 - input + 2; |
| 672 | } else |
| 673 | return 1; |
| 674 | if (len - j < MAX_PATTERN_SIZE * 2) { |
| 675 | while (k >= j) { |
| 676 | off = converthexchartoint(input[k--]); |
| 677 | if (k >= j) |
| 678 | off += (converthexchartoint(input[k--]) |
| 679 | * 16); |
| 680 | td->o.verify_pattern[i++] = (char) off; |
| 681 | } |
| 682 | } |
| 683 | } |
Steven Lang | efcd9dc | 2012-02-02 20:22:04 +0100 | [diff] [blame] | 684 | |
| 685 | /* |
| 686 | * Fill the pattern all the way to the end. This greatly reduces |
| 687 | * the number of memcpy's we have to do when verifying the IO. |
| 688 | */ |
| 689 | while (i > 1 && i * 2 <= MAX_PATTERN_SIZE) { |
| 690 | memcpy(&td->o.verify_pattern[i], &td->o.verify_pattern[0], i); |
| 691 | i *= 2; |
| 692 | } |
Steven Lang | 9a2a86d | 2012-02-07 09:42:59 +0100 | [diff] [blame] | 693 | if (i == 1) { |
| 694 | /* |
| 695 | * The code in verify_io_u_pattern assumes a single byte pattern |
| 696 | * fills the whole verify pattern buffer. |
| 697 | */ |
| 698 | memset(td->o.verify_pattern, td->o.verify_pattern[0], |
| 699 | MAX_PATTERN_SIZE); |
| 700 | } |
Steven Lang | efcd9dc | 2012-02-02 20:22:04 +0100 | [diff] [blame] | 701 | |
Radha Ramachandran | 0e92f87 | 2009-10-27 20:14:27 +0100 | [diff] [blame] | 702 | td->o.verify_pattern_bytes = i; |
Steven Lang | efcd9dc | 2012-02-02 20:22:04 +0100 | [diff] [blame] | 703 | |
Jens Axboe | 92bf48d | 2011-01-14 21:20:42 +0100 | [diff] [blame] | 704 | /* |
| 705 | * VERIFY_META could already be set |
| 706 | */ |
| 707 | if (td->o.verify == VERIFY_NONE) |
| 708 | td->o.verify = VERIFY_PATTERN; |
Steven Lang | efcd9dc | 2012-02-02 20:22:04 +0100 | [diff] [blame] | 709 | |
Jens Axboe | 90059d6 | 2007-07-30 09:33:12 +0200 | [diff] [blame] | 710 | return 0; |
| 711 | } |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 712 | |
Jens Axboe | 4d4e80f | 2008-03-04 10:18:56 +0100 | [diff] [blame] | 713 | static int str_lockfile_cb(void *data, const char *str) |
| 714 | { |
| 715 | struct thread_data *td = data; |
| 716 | char *nr = get_opt_postfix(str); |
| 717 | |
| 718 | td->o.lockfile_batch = 1; |
Jens Axboe | 182ec6e | 2008-11-14 13:06:06 +0100 | [diff] [blame] | 719 | if (nr) { |
Jens Axboe | 4d4e80f | 2008-03-04 10:18:56 +0100 | [diff] [blame] | 720 | td->o.lockfile_batch = atoi(nr); |
Jens Axboe | 182ec6e | 2008-11-14 13:06:06 +0100 | [diff] [blame] | 721 | free(nr); |
| 722 | } |
Jens Axboe | 4d4e80f | 2008-03-04 10:18:56 +0100 | [diff] [blame] | 723 | |
| 724 | return 0; |
| 725 | } |
| 726 | |
Jens Axboe | 993bf48 | 2008-11-14 13:04:53 +0100 | [diff] [blame] | 727 | static int str_gtod_reduce_cb(void *data, int *il) |
| 728 | { |
| 729 | struct thread_data *td = data; |
| 730 | int val = *il; |
| 731 | |
Jens Axboe | 02af098 | 2010-06-24 09:59:34 +0200 | [diff] [blame] | 732 | td->o.disable_lat = !!val; |
Jens Axboe | 993bf48 | 2008-11-14 13:04:53 +0100 | [diff] [blame] | 733 | td->o.disable_clat = !!val; |
| 734 | td->o.disable_slat = !!val; |
| 735 | td->o.disable_bw = !!val; |
Jens Axboe | 0dc1bc0 | 2011-10-13 08:55:29 +0200 | [diff] [blame] | 736 | td->o.clat_percentiles = !val; |
Jens Axboe | 993bf48 | 2008-11-14 13:04:53 +0100 | [diff] [blame] | 737 | if (val) |
| 738 | td->tv_cache_mask = 63; |
| 739 | |
| 740 | return 0; |
| 741 | } |
| 742 | |
Cigy Cyriac | 85bc833 | 2010-08-10 19:21:09 -0400 | [diff] [blame] | 743 | static int str_gtod_cpu_cb(void *data, long long *il) |
Jens Axboe | be4ecfd | 2008-12-08 14:10:52 +0100 | [diff] [blame] | 744 | { |
| 745 | struct thread_data *td = data; |
| 746 | int val = *il; |
| 747 | |
| 748 | td->o.gtod_cpu = val; |
| 749 | td->o.gtod_offload = 1; |
| 750 | return 0; |
| 751 | } |
| 752 | |
Jens Axboe | 7bb5910 | 2011-07-12 19:47:03 +0200 | [diff] [blame] | 753 | static int str_size_cb(void *data, unsigned long long *__val) |
| 754 | { |
| 755 | struct thread_data *td = data; |
| 756 | unsigned long long v = *__val; |
| 757 | |
| 758 | if (parse_is_percent(v)) { |
| 759 | td->o.size = 0; |
| 760 | td->o.size_percent = -1ULL - v; |
| 761 | } else |
| 762 | td->o.size = v; |
| 763 | |
| 764 | return 0; |
| 765 | } |
| 766 | |
Jens Axboe | 896cac2 | 2009-07-01 10:38:35 +0200 | [diff] [blame] | 767 | static int rw_verify(struct fio_option *o, void *data) |
| 768 | { |
| 769 | struct thread_data *td = data; |
| 770 | |
| 771 | if (read_only && td_write(td)) { |
| 772 | log_err("fio: job <%s> has write bit set, but fio is in" |
| 773 | " read-only mode\n", td->o.name); |
| 774 | return 1; |
| 775 | } |
| 776 | |
| 777 | return 0; |
| 778 | } |
| 779 | |
Jens Axboe | 276ca4f | 2009-07-01 10:43:05 +0200 | [diff] [blame] | 780 | static int gtod_cpu_verify(struct fio_option *o, void *data) |
Jens Axboe | 29d43ff | 2009-07-01 10:42:18 +0200 | [diff] [blame] | 781 | { |
Jens Axboe | 276ca4f | 2009-07-01 10:43:05 +0200 | [diff] [blame] | 782 | #ifndef FIO_HAVE_CPU_AFFINITY |
Jens Axboe | 29d43ff | 2009-07-01 10:42:18 +0200 | [diff] [blame] | 783 | struct thread_data *td = data; |
| 784 | |
Jens Axboe | 29d43ff | 2009-07-01 10:42:18 +0200 | [diff] [blame] | 785 | if (td->o.gtod_cpu) { |
| 786 | log_err("fio: platform must support CPU affinity for" |
| 787 | "gettimeofday() offloading\n"); |
| 788 | return 1; |
| 789 | } |
| 790 | #endif |
| 791 | |
| 792 | return 0; |
| 793 | } |
| 794 | |
Jens Axboe | 90fef2d | 2009-07-17 22:33:32 +0200 | [diff] [blame] | 795 | static int kb_base_verify(struct fio_option *o, void *data) |
| 796 | { |
| 797 | struct thread_data *td = data; |
| 798 | |
| 799 | if (td->o.kb_base != 1024 && td->o.kb_base != 1000) { |
| 800 | log_err("fio: kb_base set to nonsensical value: %u\n", |
| 801 | td->o.kb_base); |
| 802 | return 1; |
| 803 | } |
| 804 | |
| 805 | return 0; |
| 806 | } |
| 807 | |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 808 | /* |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 809 | * Option grouping |
| 810 | */ |
| 811 | static struct opt_group fio_opt_groups[] = { |
| 812 | { |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 813 | .name = "General", |
| 814 | .mask = FIO_OPT_C_GENERAL, |
| 815 | }, |
| 816 | { |
| 817 | .name = "I/O", |
| 818 | .mask = FIO_OPT_C_IO, |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 819 | }, |
| 820 | { |
| 821 | .name = "File", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 822 | .mask = FIO_OPT_C_FILE, |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 823 | }, |
| 824 | { |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 825 | .name = "Statistics", |
| 826 | .mask = FIO_OPT_C_STAT, |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 827 | }, |
| 828 | { |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 829 | .name = "Logging", |
| 830 | .mask = FIO_OPT_C_LOG, |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 831 | }, |
| 832 | { |
Jens Axboe | 13fca82 | 2012-03-31 13:55:54 +0200 | [diff] [blame] | 833 | .name = "Profiles", |
| 834 | .mask = FIO_OPT_C_PROFILE, |
| 835 | }, |
| 836 | { |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 837 | .name = NULL, |
| 838 | }, |
| 839 | }; |
| 840 | |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 841 | static struct opt_group *__opt_group_from_mask(struct opt_group *ogs, unsigned int *mask, |
| 842 | unsigned int inv_mask) |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 843 | { |
| 844 | struct opt_group *og; |
| 845 | int i; |
| 846 | |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 847 | if (*mask == inv_mask || !*mask) |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 848 | return NULL; |
| 849 | |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 850 | for (i = 0; ogs[i].name; i++) { |
| 851 | og = &ogs[i]; |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 852 | |
| 853 | if (*mask & og->mask) { |
| 854 | *mask &= ~(og->mask); |
| 855 | return og; |
| 856 | } |
| 857 | } |
| 858 | |
| 859 | return NULL; |
| 860 | } |
| 861 | |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 862 | struct opt_group *opt_group_from_mask(unsigned int *mask) |
| 863 | { |
| 864 | return __opt_group_from_mask(fio_opt_groups, mask, FIO_OPT_C_INVALID); |
| 865 | } |
| 866 | |
| 867 | static struct opt_group fio_opt_cat_groups[] = { |
| 868 | { |
| 869 | .name = "Rate", |
| 870 | .mask = FIO_OPT_G_RATE, |
| 871 | }, |
| 872 | { |
| 873 | .name = "Zone", |
| 874 | .mask = FIO_OPT_G_ZONE, |
| 875 | }, |
| 876 | { |
| 877 | .name = "Read/write mix", |
| 878 | .mask = FIO_OPT_G_RWMIX, |
| 879 | }, |
| 880 | { |
| 881 | .name = "Verify", |
| 882 | .mask = FIO_OPT_G_VERIFY, |
| 883 | }, |
| 884 | { |
| 885 | .name = "Trim", |
| 886 | .mask = FIO_OPT_G_TRIM, |
| 887 | }, |
| 888 | { |
| 889 | .name = "I/O Logging", |
| 890 | .mask = FIO_OPT_G_IOLOG, |
| 891 | }, |
| 892 | { |
| 893 | .name = "I/O Depth", |
| 894 | .mask = FIO_OPT_G_IO_DEPTH, |
| 895 | }, |
| 896 | { |
| 897 | .name = "I/O Flow", |
| 898 | .mask = FIO_OPT_G_IO_FLOW, |
| 899 | }, |
| 900 | { |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 901 | .name = "Description", |
| 902 | .mask = FIO_OPT_G_DESC, |
| 903 | }, |
| 904 | { |
| 905 | .name = "Filename", |
| 906 | .mask = FIO_OPT_G_FILENAME, |
| 907 | }, |
| 908 | { |
| 909 | .name = "General I/O", |
| 910 | .mask = FIO_OPT_G_IO_BASIC, |
| 911 | }, |
| 912 | { |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 913 | .name = "Cgroups", |
| 914 | .mask = FIO_OPT_G_CGROUP, |
| 915 | }, |
| 916 | { |
| 917 | .name = "Runtime", |
| 918 | .mask = FIO_OPT_G_RUNTIME, |
| 919 | }, |
| 920 | { |
Jens Axboe | 1086005 | 2012-03-19 20:56:53 +0100 | [diff] [blame] | 921 | .name = "Process", |
| 922 | .mask = FIO_OPT_G_PROCESS, |
| 923 | }, |
| 924 | { |
| 925 | .name = "Job credentials / priority", |
| 926 | .mask = FIO_OPT_G_CRED, |
| 927 | }, |
| 928 | { |
| 929 | .name = "Clock settings", |
| 930 | .mask = FIO_OPT_G_CLOCK, |
| 931 | }, |
| 932 | { |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 933 | .name = "I/O Type", |
| 934 | .mask = FIO_OPT_G_IO_TYPE, |
| 935 | }, |
| 936 | { |
| 937 | .name = "I/O Thinktime", |
| 938 | .mask = FIO_OPT_G_THINKTIME, |
| 939 | }, |
| 940 | { |
| 941 | .name = "Randomizations", |
| 942 | .mask = FIO_OPT_G_RANDOM, |
| 943 | }, |
| 944 | { |
| 945 | .name = "I/O buffers", |
| 946 | .mask = FIO_OPT_G_IO_BUF, |
| 947 | }, |
| 948 | { |
Jens Axboe | 13fca82 | 2012-03-31 13:55:54 +0200 | [diff] [blame] | 949 | .name = "Tiobench profile", |
| 950 | .mask = FIO_OPT_G_TIOBENCH, |
| 951 | }, |
| 952 | |
| 953 | { |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 954 | .name = NULL, |
| 955 | } |
| 956 | }; |
| 957 | |
| 958 | struct opt_group *opt_group_cat_from_mask(unsigned int *mask) |
| 959 | { |
| 960 | return __opt_group_from_mask(fio_opt_cat_groups, mask, FIO_OPT_G_INVALID); |
| 961 | } |
| 962 | |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 963 | /* |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 964 | * Map of job/command line options |
| 965 | */ |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 966 | struct fio_option fio_options[FIO_MAX_OPTS] = { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 967 | { |
| 968 | .name = "description", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 969 | .lname = "Description of job", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 970 | .type = FIO_OPT_STR_STORE, |
| 971 | .off1 = td_var_offset(description), |
| 972 | .help = "Text job description", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 973 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 974 | .group = FIO_OPT_G_DESC, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 975 | }, |
| 976 | { |
| 977 | .name = "name", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 978 | .lname = "Job name", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 979 | .type = FIO_OPT_STR_STORE, |
| 980 | .off1 = td_var_offset(name), |
| 981 | .help = "Name of this job", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 982 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 983 | .group = FIO_OPT_G_DESC, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 984 | }, |
| 985 | { |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 986 | .name = "filename", |
| 987 | .lname = "Filename(s)", |
| 988 | .type = FIO_OPT_STR_STORE, |
| 989 | .off1 = td_var_offset(filename), |
| 990 | .cb = str_filename_cb, |
| 991 | .prio = -1, /* must come after "directory" */ |
| 992 | .help = "File(s) to use for the workload", |
| 993 | .category = FIO_OPT_C_FILE, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 994 | .group = FIO_OPT_G_FILENAME, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 995 | }, |
| 996 | { |
| 997 | .name = "directory", |
| 998 | .lname = "Directory", |
| 999 | .type = FIO_OPT_STR_STORE, |
| 1000 | .off1 = td_var_offset(directory), |
| 1001 | .cb = str_directory_cb, |
| 1002 | .help = "Directory to store files in", |
| 1003 | .category = FIO_OPT_C_FILE, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1004 | .group = FIO_OPT_G_FILENAME, |
Jens Axboe | 90fef2d | 2009-07-17 22:33:32 +0200 | [diff] [blame] | 1005 | }, |
| 1006 | { |
Jens Axboe | 29c1349 | 2008-03-01 19:25:20 +0100 | [diff] [blame] | 1007 | .name = "lockfile", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1008 | .lname = "Lockfile", |
Jens Axboe | 4d4e80f | 2008-03-04 10:18:56 +0100 | [diff] [blame] | 1009 | .type = FIO_OPT_STR, |
| 1010 | .cb = str_lockfile_cb, |
| 1011 | .off1 = td_var_offset(file_lock_mode), |
Jens Axboe | 29c1349 | 2008-03-01 19:25:20 +0100 | [diff] [blame] | 1012 | .help = "Lock file when doing IO to it", |
| 1013 | .parent = "filename", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1014 | .hide = 0, |
Jens Axboe | 4d4e80f | 2008-03-04 10:18:56 +0100 | [diff] [blame] | 1015 | .def = "none", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1016 | .category = FIO_OPT_C_FILE, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1017 | .group = FIO_OPT_G_FILENAME, |
Jens Axboe | 4d4e80f | 2008-03-04 10:18:56 +0100 | [diff] [blame] | 1018 | .posval = { |
| 1019 | { .ival = "none", |
| 1020 | .oval = FILE_LOCK_NONE, |
| 1021 | .help = "No file locking", |
| 1022 | }, |
| 1023 | { .ival = "exclusive", |
| 1024 | .oval = FILE_LOCK_EXCLUSIVE, |
| 1025 | .help = "Exclusive file lock", |
| 1026 | }, |
| 1027 | { |
| 1028 | .ival = "readwrite", |
| 1029 | .oval = FILE_LOCK_READWRITE, |
| 1030 | .help = "Read vs write lock", |
| 1031 | }, |
| 1032 | }, |
Jens Axboe | 29c1349 | 2008-03-01 19:25:20 +0100 | [diff] [blame] | 1033 | }, |
| 1034 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1035 | .name = "opendir", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1036 | .lname = "Open directory", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1037 | .type = FIO_OPT_STR_STORE, |
| 1038 | .off1 = td_var_offset(opendir), |
| 1039 | .cb = str_opendir_cb, |
| 1040 | .help = "Recursively add files from this directory and down", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1041 | .category = FIO_OPT_C_FILE, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1042 | .group = FIO_OPT_G_FILENAME, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1043 | }, |
| 1044 | { |
| 1045 | .name = "rw", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1046 | .lname = "Read/write", |
Jens Axboe | d3aad8f | 2007-03-15 14:12:05 +0100 | [diff] [blame] | 1047 | .alias = "readwrite", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1048 | .type = FIO_OPT_STR, |
Jens Axboe | 211097b | 2007-03-22 18:56:45 +0100 | [diff] [blame] | 1049 | .cb = str_rw_cb, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1050 | .off1 = td_var_offset(td_ddir), |
| 1051 | .help = "IO direction", |
| 1052 | .def = "read", |
Jens Axboe | 896cac2 | 2009-07-01 10:38:35 +0200 | [diff] [blame] | 1053 | .verify = rw_verify, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1054 | .category = FIO_OPT_C_IO, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1055 | .group = FIO_OPT_G_IO_BASIC, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1056 | .posval = { |
| 1057 | { .ival = "read", |
| 1058 | .oval = TD_DDIR_READ, |
| 1059 | .help = "Sequential read", |
| 1060 | }, |
| 1061 | { .ival = "write", |
| 1062 | .oval = TD_DDIR_WRITE, |
| 1063 | .help = "Sequential write", |
| 1064 | }, |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 1065 | { .ival = "trim", |
| 1066 | .oval = TD_DDIR_TRIM, |
| 1067 | .help = "Sequential trim", |
| 1068 | }, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1069 | { .ival = "randread", |
| 1070 | .oval = TD_DDIR_RANDREAD, |
| 1071 | .help = "Random read", |
| 1072 | }, |
| 1073 | { .ival = "randwrite", |
| 1074 | .oval = TD_DDIR_RANDWRITE, |
| 1075 | .help = "Random write", |
| 1076 | }, |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 1077 | { .ival = "randtrim", |
| 1078 | .oval = TD_DDIR_RANDTRIM, |
| 1079 | .help = "Random trim", |
| 1080 | }, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1081 | { .ival = "rw", |
| 1082 | .oval = TD_DDIR_RW, |
| 1083 | .help = "Sequential read and write mix", |
| 1084 | }, |
Jens Axboe | 10b023d | 2012-03-23 13:40:06 +0100 | [diff] [blame] | 1085 | { .ival = "readwrite", |
| 1086 | .oval = TD_DDIR_RW, |
| 1087 | .help = "Sequential read and write mix", |
| 1088 | }, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1089 | { .ival = "randrw", |
| 1090 | .oval = TD_DDIR_RANDRW, |
| 1091 | .help = "Random read and write mix" |
| 1092 | }, |
| 1093 | }, |
| 1094 | }, |
| 1095 | { |
Jens Axboe | 38dad62 | 2010-07-20 14:46:00 -0600 | [diff] [blame] | 1096 | .name = "rw_sequencer", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1097 | .lname = "RW Sequencer", |
Jens Axboe | 38dad62 | 2010-07-20 14:46:00 -0600 | [diff] [blame] | 1098 | .type = FIO_OPT_STR, |
| 1099 | .off1 = td_var_offset(rw_seq), |
| 1100 | .help = "IO offset generator modifier", |
| 1101 | .def = "sequential", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1102 | .category = FIO_OPT_C_IO, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1103 | .group = FIO_OPT_G_IO_BASIC, |
Jens Axboe | 38dad62 | 2010-07-20 14:46:00 -0600 | [diff] [blame] | 1104 | .posval = { |
| 1105 | { .ival = "sequential", |
| 1106 | .oval = RW_SEQ_SEQ, |
| 1107 | .help = "Generate sequential offsets", |
| 1108 | }, |
| 1109 | { .ival = "identical", |
| 1110 | .oval = RW_SEQ_IDENT, |
| 1111 | .help = "Generate identical offsets", |
| 1112 | }, |
| 1113 | }, |
| 1114 | }, |
| 1115 | |
| 1116 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1117 | .name = "ioengine", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1118 | .lname = "IO Engine", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1119 | .type = FIO_OPT_STR_STORE, |
| 1120 | .off1 = td_var_offset(ioengine), |
| 1121 | .help = "IO engine to use", |
Jens Axboe | 58483fa | 2011-01-19 11:09:58 -0700 | [diff] [blame] | 1122 | .def = FIO_PREFERRED_ENGINE, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1123 | .category = FIO_OPT_C_IO, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1124 | .group = FIO_OPT_G_IO_BASIC, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1125 | .posval = { |
| 1126 | { .ival = "sync", |
| 1127 | .help = "Use read/write", |
| 1128 | }, |
gurudas pai | a31041e | 2007-10-23 15:12:30 +0200 | [diff] [blame] | 1129 | { .ival = "psync", |
| 1130 | .help = "Use pread/pwrite", |
| 1131 | }, |
Jens Axboe | 1d2af02 | 2008-02-04 10:59:07 +0100 | [diff] [blame] | 1132 | { .ival = "vsync", |
Bruce Cran | 03e20d6 | 2011-01-02 20:14:54 +0100 | [diff] [blame] | 1133 | .help = "Use readv/writev", |
Jens Axboe | 1d2af02 | 2008-02-04 10:59:07 +0100 | [diff] [blame] | 1134 | }, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1135 | #ifdef FIO_HAVE_LIBAIO |
| 1136 | { .ival = "libaio", |
| 1137 | .help = "Linux native asynchronous IO", |
| 1138 | }, |
| 1139 | #endif |
| 1140 | #ifdef FIO_HAVE_POSIXAIO |
| 1141 | { .ival = "posixaio", |
| 1142 | .help = "POSIX asynchronous IO", |
| 1143 | }, |
| 1144 | #endif |
Jens Axboe | 417f006 | 2008-06-02 11:59:30 +0200 | [diff] [blame] | 1145 | #ifdef FIO_HAVE_SOLARISAIO |
| 1146 | { .ival = "solarisaio", |
| 1147 | .help = "Solaris native asynchronous IO", |
| 1148 | }, |
| 1149 | #endif |
Bruce Cran | 03e20d6 | 2011-01-02 20:14:54 +0100 | [diff] [blame] | 1150 | #ifdef FIO_HAVE_WINDOWSAIO |
| 1151 | { .ival = "windowsaio", |
Jens Axboe | 3be8007 | 2011-01-19 11:07:28 -0700 | [diff] [blame] | 1152 | .help = "Windows native asynchronous IO" |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 1153 | }, |
Jens Axboe | 3be8007 | 2011-01-19 11:07:28 -0700 | [diff] [blame] | 1154 | #endif |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1155 | { .ival = "mmap", |
Bruce Cran | 03e20d6 | 2011-01-02 20:14:54 +0100 | [diff] [blame] | 1156 | .help = "Memory mapped IO" |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1157 | }, |
| 1158 | #ifdef FIO_HAVE_SPLICE |
| 1159 | { .ival = "splice", |
| 1160 | .help = "splice/vmsplice based IO", |
| 1161 | }, |
Jens Axboe | 9cce02e | 2007-06-22 15:42:21 +0200 | [diff] [blame] | 1162 | { .ival = "netsplice", |
| 1163 | .help = "splice/vmsplice to/from the network", |
| 1164 | }, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1165 | #endif |
| 1166 | #ifdef FIO_HAVE_SGIO |
| 1167 | { .ival = "sg", |
| 1168 | .help = "SCSI generic v3 IO", |
| 1169 | }, |
| 1170 | #endif |
| 1171 | { .ival = "null", |
| 1172 | .help = "Testing engine (no data transfer)", |
| 1173 | }, |
| 1174 | { .ival = "net", |
| 1175 | .help = "Network IO", |
| 1176 | }, |
| 1177 | #ifdef FIO_HAVE_SYSLET |
| 1178 | { .ival = "syslet-rw", |
| 1179 | .help = "syslet enabled async pread/pwrite IO", |
| 1180 | }, |
| 1181 | #endif |
| 1182 | { .ival = "cpuio", |
Bruce Cran | 03e20d6 | 2011-01-02 20:14:54 +0100 | [diff] [blame] | 1183 | .help = "CPU cycle burner engine", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1184 | }, |
Jens Axboe | b8c82a4 | 2007-03-21 08:48:26 +0100 | [diff] [blame] | 1185 | #ifdef FIO_HAVE_GUASI |
| 1186 | { .ival = "guasi", |
| 1187 | .help = "GUASI IO engine", |
| 1188 | }, |
| 1189 | #endif |
Jens Axboe | 79a4318 | 2010-09-07 13:28:58 +0200 | [diff] [blame] | 1190 | #ifdef FIO_HAVE_BINJECT |
| 1191 | { .ival = "binject", |
| 1192 | .help = "binject direct inject block engine", |
| 1193 | }, |
| 1194 | #endif |
ren yufei | 21b8aee | 2011-08-01 10:01:57 +0200 | [diff] [blame] | 1195 | #ifdef FIO_HAVE_RDMA |
| 1196 | { .ival = "rdma", |
| 1197 | .help = "RDMA IO engine", |
| 1198 | }, |
| 1199 | #endif |
Jens Axboe | 8200b8c | 2012-09-18 23:55:43 +0200 | [diff] [blame] | 1200 | #ifdef FIO_HAVE_FUSION_AW |
| 1201 | { .ival = "fusion-aw-sync", |
| 1202 | .help = "Fusion-io atomic write engine", |
| 1203 | }, |
| 1204 | #endif |
Jens Axboe | 1ecc95c | 2012-09-20 13:46:34 +0200 | [diff] [blame] | 1205 | #ifdef FIO_HAVE_E4_ENG |
| 1206 | { .ival = "e4defrag", |
| 1207 | .help = "ext4 defrag engine", |
| 1208 | }, |
| 1209 | #endif |
| 1210 | #ifdef FIO_HAVE_FALLOC_ENG |
| 1211 | { .ival = "falloc", |
| 1212 | .help = "fallocate() file based engine", |
| 1213 | }, |
| 1214 | #endif |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1215 | { .ival = "external", |
| 1216 | .help = "Load external engine (append name)", |
| 1217 | }, |
| 1218 | }, |
| 1219 | }, |
| 1220 | { |
| 1221 | .name = "iodepth", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1222 | .lname = "IO Depth", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1223 | .type = FIO_OPT_INT, |
| 1224 | .off1 = td_var_offset(iodepth), |
Bruce Cran | 03e20d6 | 2011-01-02 20:14:54 +0100 | [diff] [blame] | 1225 | .help = "Number of IO buffers to keep in flight", |
Jens Axboe | 757aff4 | 2007-12-12 19:42:13 +0100 | [diff] [blame] | 1226 | .minval = 1, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1227 | .interval = 1, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1228 | .def = "1", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1229 | .category = FIO_OPT_C_IO, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1230 | .group = FIO_OPT_G_IO_BASIC, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1231 | }, |
| 1232 | { |
| 1233 | .name = "iodepth_batch", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1234 | .lname = "IO Depth batch", |
Jens Axboe | 4950421 | 2008-06-05 09:03:30 +0200 | [diff] [blame] | 1235 | .alias = "iodepth_batch_submit", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1236 | .type = FIO_OPT_INT, |
| 1237 | .off1 = td_var_offset(iodepth_batch), |
Jens Axboe | d65db44 | 2009-01-16 19:15:33 +0100 | [diff] [blame] | 1238 | .help = "Number of IO buffers to submit in one go", |
Jens Axboe | afdf935 | 2007-07-31 16:14:34 +0200 | [diff] [blame] | 1239 | .parent = "iodepth", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1240 | .hide = 1, |
Jens Axboe | a2e6f8a | 2008-01-18 10:28:11 +0100 | [diff] [blame] | 1241 | .minval = 1, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1242 | .interval = 1, |
Jens Axboe | a2e6f8a | 2008-01-18 10:28:11 +0100 | [diff] [blame] | 1243 | .def = "1", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1244 | .category = FIO_OPT_C_IO, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1245 | .group = FIO_OPT_G_IO_BASIC, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1246 | }, |
| 1247 | { |
Jens Axboe | 4950421 | 2008-06-05 09:03:30 +0200 | [diff] [blame] | 1248 | .name = "iodepth_batch_complete", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1249 | .lname = "IO Depth batch complete", |
Jens Axboe | 4950421 | 2008-06-05 09:03:30 +0200 | [diff] [blame] | 1250 | .type = FIO_OPT_INT, |
| 1251 | .off1 = td_var_offset(iodepth_batch_complete), |
Jens Axboe | d65db44 | 2009-01-16 19:15:33 +0100 | [diff] [blame] | 1252 | .help = "Number of IO buffers to retrieve in one go", |
Jens Axboe | 4950421 | 2008-06-05 09:03:30 +0200 | [diff] [blame] | 1253 | .parent = "iodepth", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1254 | .hide = 1, |
Jens Axboe | 4950421 | 2008-06-05 09:03:30 +0200 | [diff] [blame] | 1255 | .minval = 0, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1256 | .interval = 1, |
Jens Axboe | 4950421 | 2008-06-05 09:03:30 +0200 | [diff] [blame] | 1257 | .def = "1", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1258 | .category = FIO_OPT_C_IO, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1259 | .group = FIO_OPT_G_IO_BASIC, |
Jens Axboe | 4950421 | 2008-06-05 09:03:30 +0200 | [diff] [blame] | 1260 | }, |
| 1261 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1262 | .name = "iodepth_low", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1263 | .lname = "IO Depth batch low", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1264 | .type = FIO_OPT_INT, |
| 1265 | .off1 = td_var_offset(iodepth_low), |
| 1266 | .help = "Low water mark for queuing depth", |
Jens Axboe | afdf935 | 2007-07-31 16:14:34 +0200 | [diff] [blame] | 1267 | .parent = "iodepth", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1268 | .hide = 1, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1269 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1270 | .category = FIO_OPT_C_IO, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1271 | .group = FIO_OPT_G_IO_BASIC, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1272 | }, |
| 1273 | { |
| 1274 | .name = "size", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1275 | .lname = "Size", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1276 | .type = FIO_OPT_STR_VAL, |
Jens Axboe | 7bb5910 | 2011-07-12 19:47:03 +0200 | [diff] [blame] | 1277 | .cb = str_size_cb, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1278 | .help = "Total size of device or files", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1279 | .interval = 1024 * 1024, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1280 | .category = FIO_OPT_C_IO, |
| 1281 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1282 | }, |
| 1283 | { |
Shawn Lewis | aa31f1f | 2008-01-11 09:45:11 +0100 | [diff] [blame] | 1284 | .name = "fill_device", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1285 | .lname = "Fill device", |
Jens Axboe | 74586c1 | 2011-01-20 10:16:03 -0700 | [diff] [blame] | 1286 | .alias = "fill_fs", |
Shawn Lewis | aa31f1f | 2008-01-11 09:45:11 +0100 | [diff] [blame] | 1287 | .type = FIO_OPT_BOOL, |
| 1288 | .off1 = td_var_offset(fill_device), |
| 1289 | .help = "Write until an ENOSPC error occurs", |
| 1290 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1291 | .category = FIO_OPT_C_FILE, |
| 1292 | .group = FIO_OPT_G_INVALID, |
Shawn Lewis | aa31f1f | 2008-01-11 09:45:11 +0100 | [diff] [blame] | 1293 | }, |
| 1294 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1295 | .name = "filesize", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1296 | .lname = "File size", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1297 | .type = FIO_OPT_STR_VAL, |
| 1298 | .off1 = td_var_offset(file_size_low), |
| 1299 | .off2 = td_var_offset(file_size_high), |
Jens Axboe | c3edbdb | 2007-07-20 14:25:31 +0200 | [diff] [blame] | 1300 | .minval = 1, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1301 | .help = "Size of individual files", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1302 | .interval = 1024 * 1024, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1303 | .category = FIO_OPT_C_FILE, |
| 1304 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1305 | }, |
| 1306 | { |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1307 | .name = "offset", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1308 | .lname = "IO offset", |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1309 | .alias = "fileoffset", |
| 1310 | .type = FIO_OPT_STR_VAL, |
| 1311 | .off1 = td_var_offset(start_offset), |
| 1312 | .help = "Start IO from this offset", |
| 1313 | .def = "0", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1314 | .interval = 1024 * 1024, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1315 | .category = FIO_OPT_C_IO, |
| 1316 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1317 | }, |
| 1318 | { |
Jens Axboe | 2d7cd86 | 2012-03-15 14:53:38 +0100 | [diff] [blame] | 1319 | .name = "offset_increment", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1320 | .lname = "IO offset increment", |
Jens Axboe | 2d7cd86 | 2012-03-15 14:53:38 +0100 | [diff] [blame] | 1321 | .type = FIO_OPT_STR_VAL, |
| 1322 | .off1 = td_var_offset(offset_increment), |
| 1323 | .help = "What is the increment from one offset to the next", |
| 1324 | .parent = "offset", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1325 | .hide = 1, |
Jens Axboe | 2d7cd86 | 2012-03-15 14:53:38 +0100 | [diff] [blame] | 1326 | .def = "0", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1327 | .interval = 1024 * 1024, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1328 | .category = FIO_OPT_C_IO, |
| 1329 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 2d7cd86 | 2012-03-15 14:53:38 +0100 | [diff] [blame] | 1330 | }, |
| 1331 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1332 | .name = "bs", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1333 | .lname = "Block size", |
Jens Axboe | d3aad8f | 2007-03-15 14:12:05 +0100 | [diff] [blame] | 1334 | .alias = "blocksize", |
Jens Axboe | e01b22b | 2009-06-09 15:43:25 +0200 | [diff] [blame] | 1335 | .type = FIO_OPT_INT, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1336 | .off1 = td_var_offset(bs[DDIR_READ]), |
| 1337 | .off2 = td_var_offset(bs[DDIR_WRITE]), |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 1338 | .off3 = td_var_offset(bs[DDIR_TRIM]), |
Jens Axboe | c3edbdb | 2007-07-20 14:25:31 +0200 | [diff] [blame] | 1339 | .minval = 1, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1340 | .help = "Block size unit", |
| 1341 | .def = "4k", |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1342 | .parent = "rw", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1343 | .hide = 1, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1344 | .interval = 512, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1345 | .category = FIO_OPT_C_IO, |
| 1346 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1347 | }, |
| 1348 | { |
Jens Axboe | 2b7a01d | 2009-03-11 11:00:13 +0100 | [diff] [blame] | 1349 | .name = "ba", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1350 | .lname = "Block size align", |
Jens Axboe | 2b7a01d | 2009-03-11 11:00:13 +0100 | [diff] [blame] | 1351 | .alias = "blockalign", |
Jens Axboe | e01b22b | 2009-06-09 15:43:25 +0200 | [diff] [blame] | 1352 | .type = FIO_OPT_INT, |
Jens Axboe | 2b7a01d | 2009-03-11 11:00:13 +0100 | [diff] [blame] | 1353 | .off1 = td_var_offset(ba[DDIR_READ]), |
| 1354 | .off2 = td_var_offset(ba[DDIR_WRITE]), |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 1355 | .off3 = td_var_offset(ba[DDIR_TRIM]), |
Jens Axboe | 2b7a01d | 2009-03-11 11:00:13 +0100 | [diff] [blame] | 1356 | .minval = 1, |
| 1357 | .help = "IO block offset alignment", |
| 1358 | .parent = "rw", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1359 | .hide = 1, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1360 | .interval = 512, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1361 | .category = FIO_OPT_C_IO, |
| 1362 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 2b7a01d | 2009-03-11 11:00:13 +0100 | [diff] [blame] | 1363 | }, |
| 1364 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1365 | .name = "bsrange", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1366 | .lname = "Block size range", |
Jens Axboe | d3aad8f | 2007-03-15 14:12:05 +0100 | [diff] [blame] | 1367 | .alias = "blocksize_range", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1368 | .type = FIO_OPT_RANGE, |
| 1369 | .off1 = td_var_offset(min_bs[DDIR_READ]), |
| 1370 | .off2 = td_var_offset(max_bs[DDIR_READ]), |
| 1371 | .off3 = td_var_offset(min_bs[DDIR_WRITE]), |
| 1372 | .off4 = td_var_offset(max_bs[DDIR_WRITE]), |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 1373 | .off5 = td_var_offset(min_bs[DDIR_TRIM]), |
| 1374 | .off6 = td_var_offset(max_bs[DDIR_TRIM]), |
Jens Axboe | c3edbdb | 2007-07-20 14:25:31 +0200 | [diff] [blame] | 1375 | .minval = 1, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1376 | .help = "Set block size range (in more detail than bs)", |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1377 | .parent = "rw", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1378 | .hide = 1, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1379 | .interval = 4096, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1380 | .category = FIO_OPT_C_IO, |
| 1381 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1382 | }, |
| 1383 | { |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 1384 | .name = "bssplit", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1385 | .lname = "Block size split", |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 1386 | .type = FIO_OPT_STR, |
| 1387 | .cb = str_bssplit_cb, |
| 1388 | .help = "Set a specific mix of block sizes", |
| 1389 | .parent = "rw", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1390 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1391 | .category = FIO_OPT_C_IO, |
| 1392 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 1393 | }, |
| 1394 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1395 | .name = "bs_unaligned", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1396 | .lname = "Block size unaligned", |
Jens Axboe | d3aad8f | 2007-03-15 14:12:05 +0100 | [diff] [blame] | 1397 | .alias = "blocksize_unaligned", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1398 | .type = FIO_OPT_STR_SET, |
| 1399 | .off1 = td_var_offset(bs_unaligned), |
| 1400 | .help = "Don't sector align IO buffer sizes", |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1401 | .parent = "rw", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1402 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1403 | .category = FIO_OPT_C_IO, |
| 1404 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1405 | }, |
| 1406 | { |
| 1407 | .name = "randrepeat", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1408 | .lname = "Random repeatable", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1409 | .type = FIO_OPT_BOOL, |
| 1410 | .off1 = td_var_offset(rand_repeatable), |
| 1411 | .help = "Use repeatable random IO pattern", |
| 1412 | .def = "1", |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1413 | .parent = "rw", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1414 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1415 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 1416 | .group = FIO_OPT_G_RANDOM, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1417 | }, |
| 1418 | { |
Jens Axboe | 2615cc4 | 2011-03-28 09:35:09 +0200 | [diff] [blame] | 1419 | .name = "use_os_rand", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1420 | .lname = "Use OS random", |
Jens Axboe | 2615cc4 | 2011-03-28 09:35:09 +0200 | [diff] [blame] | 1421 | .type = FIO_OPT_BOOL, |
| 1422 | .off1 = td_var_offset(use_os_rand), |
| 1423 | .help = "Set to use OS random generator", |
| 1424 | .def = "0", |
| 1425 | .parent = "rw", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1426 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1427 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 1428 | .group = FIO_OPT_G_RANDOM, |
Jens Axboe | 2615cc4 | 2011-03-28 09:35:09 +0200 | [diff] [blame] | 1429 | }, |
| 1430 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1431 | .name = "norandommap", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1432 | .lname = "No randommap", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1433 | .type = FIO_OPT_STR_SET, |
| 1434 | .off1 = td_var_offset(norandommap), |
| 1435 | .help = "Accept potential duplicate random blocks", |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1436 | .parent = "rw", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1437 | .hide = 1, |
Jens Axboe | b2452a4 | 2012-03-20 10:29:45 +0100 | [diff] [blame] | 1438 | .hide_on_set = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1439 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 1440 | .group = FIO_OPT_G_RANDOM, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1441 | }, |
| 1442 | { |
Jens Axboe | 2b386d2 | 2008-03-26 10:32:57 +0100 | [diff] [blame] | 1443 | .name = "softrandommap", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1444 | .lname = "Soft randommap", |
Jens Axboe | 2b386d2 | 2008-03-26 10:32:57 +0100 | [diff] [blame] | 1445 | .type = FIO_OPT_BOOL, |
| 1446 | .off1 = td_var_offset(softrandommap), |
Jens Axboe | f66ab3c | 2008-06-05 11:48:22 +0200 | [diff] [blame] | 1447 | .help = "Set norandommap if randommap allocation fails", |
Jens Axboe | 2b386d2 | 2008-03-26 10:32:57 +0100 | [diff] [blame] | 1448 | .parent = "norandommap", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1449 | .hide = 1, |
Jens Axboe | 2b386d2 | 2008-03-26 10:32:57 +0100 | [diff] [blame] | 1450 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1451 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 1452 | .group = FIO_OPT_G_RANDOM, |
Jens Axboe | 2b386d2 | 2008-03-26 10:32:57 +0100 | [diff] [blame] | 1453 | }, |
| 1454 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1455 | .name = "nrfiles", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1456 | .lname = "Number of files", |
Jens Axboe | d7c8be0 | 2010-11-25 08:21:39 +0100 | [diff] [blame] | 1457 | .alias = "nr_files", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1458 | .type = FIO_OPT_INT, |
| 1459 | .off1 = td_var_offset(nr_files), |
| 1460 | .help = "Split job workload between this number of files", |
| 1461 | .def = "1", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1462 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1463 | .category = FIO_OPT_C_FILE, |
| 1464 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1465 | }, |
| 1466 | { |
| 1467 | .name = "openfiles", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1468 | .lname = "Number of open files", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1469 | .type = FIO_OPT_INT, |
| 1470 | .off1 = td_var_offset(open_files), |
| 1471 | .help = "Number of files to keep open at the same time", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1472 | .category = FIO_OPT_C_FILE, |
| 1473 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1474 | }, |
| 1475 | { |
| 1476 | .name = "file_service_type", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1477 | .lname = "File service type", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1478 | .type = FIO_OPT_STR, |
| 1479 | .cb = str_fst_cb, |
| 1480 | .off1 = td_var_offset(file_service_type), |
| 1481 | .help = "How to select which file to service next", |
| 1482 | .def = "roundrobin", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1483 | .category = FIO_OPT_C_FILE, |
| 1484 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1485 | .posval = { |
| 1486 | { .ival = "random", |
| 1487 | .oval = FIO_FSERVICE_RANDOM, |
| 1488 | .help = "Choose a file at random", |
| 1489 | }, |
| 1490 | { .ival = "roundrobin", |
| 1491 | .oval = FIO_FSERVICE_RR, |
| 1492 | .help = "Round robin select files", |
| 1493 | }, |
Jens Axboe | a086c25 | 2009-03-04 08:27:37 +0100 | [diff] [blame] | 1494 | { .ival = "sequential", |
| 1495 | .oval = FIO_FSERVICE_SEQ, |
| 1496 | .help = "Finish one file before moving to the next", |
| 1497 | }, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1498 | }, |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1499 | .parent = "nrfiles", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1500 | .hide = 1, |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1501 | }, |
Jens Axboe | 7bc8c2c | 2010-01-28 11:31:31 +0100 | [diff] [blame] | 1502 | #ifdef FIO_HAVE_FALLOCATE |
| 1503 | { |
| 1504 | .name = "fallocate", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1505 | .lname = "Fallocate", |
Eric Gouriou | a596f04 | 2011-06-17 09:11:45 +0200 | [diff] [blame] | 1506 | .type = FIO_OPT_STR, |
| 1507 | .off1 = td_var_offset(fallocate_mode), |
| 1508 | .help = "Whether pre-allocation is performed when laying out files", |
| 1509 | .def = "posix", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1510 | .category = FIO_OPT_C_FILE, |
| 1511 | .group = FIO_OPT_G_INVALID, |
Eric Gouriou | a596f04 | 2011-06-17 09:11:45 +0200 | [diff] [blame] | 1512 | .posval = { |
| 1513 | { .ival = "none", |
| 1514 | .oval = FIO_FALLOCATE_NONE, |
| 1515 | .help = "Do not pre-allocate space", |
| 1516 | }, |
| 1517 | { .ival = "posix", |
| 1518 | .oval = FIO_FALLOCATE_POSIX, |
| 1519 | .help = "Use posix_fallocate()", |
| 1520 | }, |
| 1521 | #ifdef FIO_HAVE_LINUX_FALLOCATE |
| 1522 | { .ival = "keep", |
| 1523 | .oval = FIO_FALLOCATE_KEEP_SIZE, |
| 1524 | .help = "Use fallocate(..., FALLOC_FL_KEEP_SIZE, ...)", |
| 1525 | }, |
Jens Axboe | 7bc8c2c | 2010-01-28 11:31:31 +0100 | [diff] [blame] | 1526 | #endif |
Eric Gouriou | a596f04 | 2011-06-17 09:11:45 +0200 | [diff] [blame] | 1527 | /* Compatibility with former boolean values */ |
| 1528 | { .ival = "0", |
| 1529 | .oval = FIO_FALLOCATE_NONE, |
| 1530 | .help = "Alias for 'none'", |
| 1531 | }, |
| 1532 | { .ival = "1", |
| 1533 | .oval = FIO_FALLOCATE_POSIX, |
| 1534 | .help = "Alias for 'posix'", |
| 1535 | }, |
| 1536 | }, |
| 1537 | }, |
| 1538 | #endif /* FIO_HAVE_FALLOCATE */ |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1539 | { |
| 1540 | .name = "fadvise_hint", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1541 | .lname = "Fadvise hint", |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1542 | .type = FIO_OPT_BOOL, |
| 1543 | .off1 = td_var_offset(fadvise_hint), |
| 1544 | .help = "Use fadvise() to advise the kernel on IO pattern", |
| 1545 | .def = "1", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1546 | .category = FIO_OPT_C_FILE, |
| 1547 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1548 | }, |
| 1549 | { |
| 1550 | .name = "fsync", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1551 | .lname = "Fsync", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1552 | .type = FIO_OPT_INT, |
| 1553 | .off1 = td_var_offset(fsync_blocks), |
| 1554 | .help = "Issue fsync for writes every given number of blocks", |
| 1555 | .def = "0", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1556 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1557 | .category = FIO_OPT_C_FILE, |
| 1558 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1559 | }, |
| 1560 | { |
Jens Axboe | 5f9099e | 2009-06-16 22:40:26 +0200 | [diff] [blame] | 1561 | .name = "fdatasync", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1562 | .lname = "Fdatasync", |
Jens Axboe | 5f9099e | 2009-06-16 22:40:26 +0200 | [diff] [blame] | 1563 | .type = FIO_OPT_INT, |
| 1564 | .off1 = td_var_offset(fdatasync_blocks), |
| 1565 | .help = "Issue fdatasync for writes every given number of blocks", |
| 1566 | .def = "0", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1567 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1568 | .category = FIO_OPT_C_FILE, |
| 1569 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 5f9099e | 2009-06-16 22:40:26 +0200 | [diff] [blame] | 1570 | }, |
Jens Axboe | 1ef2b6b | 2010-10-08 15:07:01 +0200 | [diff] [blame] | 1571 | { |
| 1572 | .name = "write_barrier", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1573 | .lname = "Write barrier", |
Jens Axboe | 1ef2b6b | 2010-10-08 15:07:01 +0200 | [diff] [blame] | 1574 | .type = FIO_OPT_INT, |
| 1575 | .off1 = td_var_offset(barrier_blocks), |
| 1576 | .help = "Make every Nth write a barrier write", |
| 1577 | .def = "0", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1578 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1579 | .category = FIO_OPT_C_IO, |
| 1580 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 1ef2b6b | 2010-10-08 15:07:01 +0200 | [diff] [blame] | 1581 | }, |
Jens Axboe | 44f2969 | 2010-03-09 20:09:44 +0100 | [diff] [blame] | 1582 | #ifdef FIO_HAVE_SYNC_FILE_RANGE |
| 1583 | { |
| 1584 | .name = "sync_file_range", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1585 | .lname = "Sync file range", |
Jens Axboe | 44f2969 | 2010-03-09 20:09:44 +0100 | [diff] [blame] | 1586 | .posval = { |
| 1587 | { .ival = "wait_before", |
| 1588 | .oval = SYNC_FILE_RANGE_WAIT_BEFORE, |
| 1589 | .help = "SYNC_FILE_RANGE_WAIT_BEFORE", |
Jens Axboe | 3843deb | 2010-03-09 20:41:15 +0100 | [diff] [blame] | 1590 | .or = 1, |
Jens Axboe | 44f2969 | 2010-03-09 20:09:44 +0100 | [diff] [blame] | 1591 | }, |
| 1592 | { .ival = "write", |
| 1593 | .oval = SYNC_FILE_RANGE_WRITE, |
| 1594 | .help = "SYNC_FILE_RANGE_WRITE", |
Jens Axboe | 3843deb | 2010-03-09 20:41:15 +0100 | [diff] [blame] | 1595 | .or = 1, |
Jens Axboe | 44f2969 | 2010-03-09 20:09:44 +0100 | [diff] [blame] | 1596 | }, |
| 1597 | { |
| 1598 | .ival = "wait_after", |
| 1599 | .oval = SYNC_FILE_RANGE_WAIT_AFTER, |
| 1600 | .help = "SYNC_FILE_RANGE_WAIT_AFTER", |
Jens Axboe | 3843deb | 2010-03-09 20:41:15 +0100 | [diff] [blame] | 1601 | .or = 1, |
Jens Axboe | 44f2969 | 2010-03-09 20:09:44 +0100 | [diff] [blame] | 1602 | }, |
| 1603 | }, |
Jens Axboe | 3843deb | 2010-03-09 20:41:15 +0100 | [diff] [blame] | 1604 | .type = FIO_OPT_STR_MULTI, |
Jens Axboe | 44f2969 | 2010-03-09 20:09:44 +0100 | [diff] [blame] | 1605 | .cb = str_sfr_cb, |
| 1606 | .off1 = td_var_offset(sync_file_range), |
| 1607 | .help = "Use sync_file_range()", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1608 | .category = FIO_OPT_C_FILE, |
| 1609 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 44f2969 | 2010-03-09 20:09:44 +0100 | [diff] [blame] | 1610 | }, |
| 1611 | #endif |
Jens Axboe | 5f9099e | 2009-06-16 22:40:26 +0200 | [diff] [blame] | 1612 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1613 | .name = "direct", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1614 | .lname = "Direct I/O", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1615 | .type = FIO_OPT_BOOL, |
| 1616 | .off1 = td_var_offset(odirect), |
| 1617 | .help = "Use O_DIRECT IO (negates buffered)", |
| 1618 | .def = "0", |
Jens Axboe | a01a1bc | 2012-03-19 21:13:01 +0100 | [diff] [blame] | 1619 | .inverse = "buffered", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1620 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 1621 | .group = FIO_OPT_G_IO_TYPE, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1622 | }, |
| 1623 | { |
| 1624 | .name = "buffered", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1625 | .lname = "Buffered I/O", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1626 | .type = FIO_OPT_BOOL, |
| 1627 | .off1 = td_var_offset(odirect), |
| 1628 | .neg = 1, |
| 1629 | .help = "Use buffered IO (negates direct)", |
| 1630 | .def = "1", |
Jens Axboe | a01a1bc | 2012-03-19 21:13:01 +0100 | [diff] [blame] | 1631 | .inverse = "direct", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1632 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 1633 | .group = FIO_OPT_G_IO_TYPE, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1634 | }, |
| 1635 | { |
| 1636 | .name = "overwrite", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1637 | .lname = "Overwrite", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1638 | .type = FIO_OPT_BOOL, |
| 1639 | .off1 = td_var_offset(overwrite), |
| 1640 | .help = "When writing, set whether to overwrite current data", |
| 1641 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1642 | .category = FIO_OPT_C_FILE, |
| 1643 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1644 | }, |
| 1645 | { |
| 1646 | .name = "loops", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1647 | .lname = "Loops", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1648 | .type = FIO_OPT_INT, |
| 1649 | .off1 = td_var_offset(loops), |
| 1650 | .help = "Number of times to run the job", |
| 1651 | .def = "1", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1652 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1653 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 1654 | .group = FIO_OPT_G_RUNTIME, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1655 | }, |
| 1656 | { |
| 1657 | .name = "numjobs", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1658 | .lname = "Number of jobs", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1659 | .type = FIO_OPT_INT, |
| 1660 | .off1 = td_var_offset(numjobs), |
| 1661 | .help = "Duplicate this job this many times", |
| 1662 | .def = "1", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1663 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1664 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 1665 | .group = FIO_OPT_G_RUNTIME, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1666 | }, |
| 1667 | { |
| 1668 | .name = "startdelay", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1669 | .lname = "Start delay", |
Jens Axboe | a5737c9 | 2010-06-29 10:40:30 +0200 | [diff] [blame] | 1670 | .type = FIO_OPT_STR_VAL_TIME, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1671 | .off1 = td_var_offset(start_delay), |
| 1672 | .help = "Only start job when this period has passed", |
| 1673 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1674 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 1675 | .group = FIO_OPT_G_RUNTIME, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1676 | }, |
| 1677 | { |
| 1678 | .name = "runtime", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1679 | .lname = "Runtime", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1680 | .alias = "timeout", |
| 1681 | .type = FIO_OPT_STR_VAL_TIME, |
| 1682 | .off1 = td_var_offset(timeout), |
| 1683 | .help = "Stop workload when this amount of time has passed", |
| 1684 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1685 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 1686 | .group = FIO_OPT_G_RUNTIME, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1687 | }, |
| 1688 | { |
Jens Axboe | cf4464c | 2007-04-17 20:14:42 +0200 | [diff] [blame] | 1689 | .name = "time_based", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1690 | .lname = "Time based", |
Jens Axboe | cf4464c | 2007-04-17 20:14:42 +0200 | [diff] [blame] | 1691 | .type = FIO_OPT_STR_SET, |
| 1692 | .off1 = td_var_offset(time_based), |
| 1693 | .help = "Keep running until runtime/timeout is met", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1694 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 1695 | .group = FIO_OPT_G_RUNTIME, |
Jens Axboe | cf4464c | 2007-04-17 20:14:42 +0200 | [diff] [blame] | 1696 | }, |
| 1697 | { |
Jens Axboe | 721938a | 2008-09-10 09:46:16 +0200 | [diff] [blame] | 1698 | .name = "ramp_time", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1699 | .lname = "Ramp time", |
Jens Axboe | 721938a | 2008-09-10 09:46:16 +0200 | [diff] [blame] | 1700 | .type = FIO_OPT_STR_VAL_TIME, |
| 1701 | .off1 = td_var_offset(ramp_time), |
| 1702 | .help = "Ramp up time before measuring performance", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1703 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 1704 | .group = FIO_OPT_G_RUNTIME, |
Jens Axboe | 721938a | 2008-09-10 09:46:16 +0200 | [diff] [blame] | 1705 | }, |
| 1706 | { |
Jens Axboe | c223da8 | 2010-03-24 13:23:53 +0100 | [diff] [blame] | 1707 | .name = "clocksource", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1708 | .lname = "Clock source", |
Jens Axboe | c223da8 | 2010-03-24 13:23:53 +0100 | [diff] [blame] | 1709 | .type = FIO_OPT_STR, |
| 1710 | .cb = fio_clock_source_cb, |
| 1711 | .off1 = td_var_offset(clocksource), |
| 1712 | .help = "What type of timing source to use", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1713 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | 1086005 | 2012-03-19 20:56:53 +0100 | [diff] [blame] | 1714 | .group = FIO_OPT_G_CLOCK, |
Jens Axboe | c223da8 | 2010-03-24 13:23:53 +0100 | [diff] [blame] | 1715 | .posval = { |
| 1716 | { .ival = "gettimeofday", |
| 1717 | .oval = CS_GTOD, |
| 1718 | .help = "Use gettimeofday(2) for timing", |
| 1719 | }, |
| 1720 | { .ival = "clock_gettime", |
| 1721 | .oval = CS_CGETTIME, |
| 1722 | .help = "Use clock_gettime(2) for timing", |
| 1723 | }, |
| 1724 | #ifdef ARCH_HAVE_CPU_CLOCK |
| 1725 | { .ival = "cpu", |
| 1726 | .oval = CS_CPUCLOCK, |
| 1727 | .help = "Use CPU private clock", |
| 1728 | }, |
| 1729 | #endif |
| 1730 | }, |
| 1731 | }, |
| 1732 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1733 | .name = "mem", |
Jens Axboe | d3aad8f | 2007-03-15 14:12:05 +0100 | [diff] [blame] | 1734 | .alias = "iomem", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1735 | .lname = "I/O Memory", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1736 | .type = FIO_OPT_STR, |
| 1737 | .cb = str_mem_cb, |
| 1738 | .off1 = td_var_offset(mem_type), |
| 1739 | .help = "Backing type for IO buffers", |
| 1740 | .def = "malloc", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1741 | .category = FIO_OPT_C_IO, |
| 1742 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1743 | .posval = { |
| 1744 | { .ival = "malloc", |
| 1745 | .oval = MEM_MALLOC, |
| 1746 | .help = "Use malloc(3) for IO buffers", |
| 1747 | }, |
Jens Axboe | b370e46 | 2007-03-19 10:51:49 +0100 | [diff] [blame] | 1748 | { .ival = "shm", |
| 1749 | .oval = MEM_SHM, |
| 1750 | .help = "Use shared memory segments for IO buffers", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1751 | }, |
| 1752 | #ifdef FIO_HAVE_HUGETLB |
Jens Axboe | 37c8cdf | 2007-03-19 13:14:03 +0100 | [diff] [blame] | 1753 | { .ival = "shmhuge", |
| 1754 | .oval = MEM_SHMHUGE, |
| 1755 | .help = "Like shm, but use huge pages", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1756 | }, |
| 1757 | #endif |
Jens Axboe | b370e46 | 2007-03-19 10:51:49 +0100 | [diff] [blame] | 1758 | { .ival = "mmap", |
| 1759 | .oval = MEM_MMAP, |
| 1760 | .help = "Use mmap(2) (file or anon) for IO buffers", |
| 1761 | }, |
Jens Axboe | 37c8cdf | 2007-03-19 13:14:03 +0100 | [diff] [blame] | 1762 | #ifdef FIO_HAVE_HUGETLB |
| 1763 | { .ival = "mmaphuge", |
| 1764 | .oval = MEM_MMAPHUGE, |
| 1765 | .help = "Like mmap, but use huge pages", |
| 1766 | }, |
| 1767 | #endif |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1768 | }, |
| 1769 | }, |
| 1770 | { |
Jens Axboe | d529ee1 | 2009-07-01 10:33:03 +0200 | [diff] [blame] | 1771 | .name = "iomem_align", |
| 1772 | .alias = "mem_align", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1773 | .lname = "I/O memory alignment", |
Jens Axboe | d529ee1 | 2009-07-01 10:33:03 +0200 | [diff] [blame] | 1774 | .type = FIO_OPT_INT, |
| 1775 | .off1 = td_var_offset(mem_align), |
| 1776 | .minval = 0, |
| 1777 | .help = "IO memory buffer offset alignment", |
| 1778 | .def = "0", |
| 1779 | .parent = "iomem", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1780 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1781 | .category = FIO_OPT_C_IO, |
| 1782 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | d529ee1 | 2009-07-01 10:33:03 +0200 | [diff] [blame] | 1783 | }, |
| 1784 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1785 | .name = "verify", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1786 | .lname = "Verify", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1787 | .type = FIO_OPT_STR, |
| 1788 | .off1 = td_var_offset(verify), |
| 1789 | .help = "Verify data written", |
| 1790 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1791 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 1792 | .group = FIO_OPT_G_VERIFY, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1793 | .posval = { |
| 1794 | { .ival = "0", |
| 1795 | .oval = VERIFY_NONE, |
| 1796 | .help = "Don't do IO verification", |
| 1797 | }, |
Jens Axboe | fcca4b5 | 2007-07-27 15:42:00 +0200 | [diff] [blame] | 1798 | { .ival = "md5", |
| 1799 | .oval = VERIFY_MD5, |
| 1800 | .help = "Use md5 checksums for verification", |
| 1801 | }, |
Jens Axboe | d77a7af | 2007-07-27 15:35:06 +0200 | [diff] [blame] | 1802 | { .ival = "crc64", |
| 1803 | .oval = VERIFY_CRC64, |
| 1804 | .help = "Use crc64 checksums for verification", |
| 1805 | }, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1806 | { .ival = "crc32", |
| 1807 | .oval = VERIFY_CRC32, |
| 1808 | .help = "Use crc32 checksums for verification", |
| 1809 | }, |
Jens Axboe | af497e6 | 2008-08-04 15:40:35 +0200 | [diff] [blame] | 1810 | { .ival = "crc32c-intel", |
Jens Axboe | e3aaafc | 2012-02-22 20:28:17 +0100 | [diff] [blame] | 1811 | .oval = VERIFY_CRC32C, |
| 1812 | .help = "Use crc32c checksums for verification (hw assisted, if available)", |
Jens Axboe | af497e6 | 2008-08-04 15:40:35 +0200 | [diff] [blame] | 1813 | }, |
Jens Axboe | bac39e0 | 2008-06-11 20:46:19 +0200 | [diff] [blame] | 1814 | { .ival = "crc32c", |
| 1815 | .oval = VERIFY_CRC32C, |
Jens Axboe | e3aaafc | 2012-02-22 20:28:17 +0100 | [diff] [blame] | 1816 | .help = "Use crc32c checksums for verification (hw assisted, if available)", |
Jens Axboe | bac39e0 | 2008-06-11 20:46:19 +0200 | [diff] [blame] | 1817 | }, |
Jens Axboe | 969f7ed | 2007-07-27 09:07:17 +0200 | [diff] [blame] | 1818 | { .ival = "crc16", |
| 1819 | .oval = VERIFY_CRC16, |
| 1820 | .help = "Use crc16 checksums for verification", |
| 1821 | }, |
Jens Axboe | 1e154bd | 2007-07-27 09:52:40 +0200 | [diff] [blame] | 1822 | { .ival = "crc7", |
| 1823 | .oval = VERIFY_CRC7, |
| 1824 | .help = "Use crc7 checksums for verification", |
| 1825 | }, |
Jens Axboe | 7c353ce | 2009-08-09 22:40:33 +0200 | [diff] [blame] | 1826 | { .ival = "sha1", |
| 1827 | .oval = VERIFY_SHA1, |
| 1828 | .help = "Use sha1 checksums for verification", |
| 1829 | }, |
Jens Axboe | cd14cc1 | 2007-07-30 10:59:33 +0200 | [diff] [blame] | 1830 | { .ival = "sha256", |
| 1831 | .oval = VERIFY_SHA256, |
| 1832 | .help = "Use sha256 checksums for verification", |
| 1833 | }, |
| 1834 | { .ival = "sha512", |
| 1835 | .oval = VERIFY_SHA512, |
| 1836 | .help = "Use sha512 checksums for verification", |
| 1837 | }, |
Shawn Lewis | 7437ee8 | 2007-08-02 21:05:58 +0200 | [diff] [blame] | 1838 | { .ival = "meta", |
| 1839 | .oval = VERIFY_META, |
| 1840 | .help = "Use io information", |
| 1841 | }, |
Jens Axboe | 36690c9 | 2007-03-26 10:23:34 +0200 | [diff] [blame] | 1842 | { |
| 1843 | .ival = "null", |
| 1844 | .oval = VERIFY_NULL, |
| 1845 | .help = "Pretend to verify", |
| 1846 | }, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1847 | }, |
| 1848 | }, |
| 1849 | { |
Jens Axboe | 005c565 | 2007-08-02 22:21:36 +0200 | [diff] [blame] | 1850 | .name = "do_verify", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1851 | .lname = "Perform verify step", |
Jens Axboe | 68e1f29 | 2007-08-10 10:32:14 +0200 | [diff] [blame] | 1852 | .type = FIO_OPT_BOOL, |
Jens Axboe | 005c565 | 2007-08-02 22:21:36 +0200 | [diff] [blame] | 1853 | .off1 = td_var_offset(do_verify), |
| 1854 | .help = "Run verification stage after write", |
| 1855 | .def = "1", |
| 1856 | .parent = "verify", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1857 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1858 | .category = FIO_OPT_C_IO, |
| 1859 | .group = FIO_OPT_G_VERIFY, |
Jens Axboe | 005c565 | 2007-08-02 22:21:36 +0200 | [diff] [blame] | 1860 | }, |
| 1861 | { |
Jens Axboe | 160b966 | 2007-03-27 10:59:49 +0200 | [diff] [blame] | 1862 | .name = "verifysort", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1863 | .lname = "Verify sort", |
Jens Axboe | 160b966 | 2007-03-27 10:59:49 +0200 | [diff] [blame] | 1864 | .type = FIO_OPT_BOOL, |
| 1865 | .off1 = td_var_offset(verifysort), |
| 1866 | .help = "Sort written verify blocks for read back", |
| 1867 | .def = "1", |
Jens Axboe | c83f2df | 2007-07-31 22:51:47 +0200 | [diff] [blame] | 1868 | .parent = "verify", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1869 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1870 | .category = FIO_OPT_C_IO, |
| 1871 | .group = FIO_OPT_G_VERIFY, |
Jens Axboe | 160b966 | 2007-03-27 10:59:49 +0200 | [diff] [blame] | 1872 | }, |
| 1873 | { |
Jens Axboe | a59e170 | 2007-07-30 08:53:27 +0200 | [diff] [blame] | 1874 | .name = "verify_interval", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1875 | .lname = "Verify interval", |
Jens Axboe | e01b22b | 2009-06-09 15:43:25 +0200 | [diff] [blame] | 1876 | .type = FIO_OPT_INT, |
Jens Axboe | a59e170 | 2007-07-30 08:53:27 +0200 | [diff] [blame] | 1877 | .off1 = td_var_offset(verify_interval), |
Jens Axboe | 819a968 | 2007-07-28 21:30:31 +0200 | [diff] [blame] | 1878 | .minval = 2 * sizeof(struct verify_header), |
Jens Axboe | a59e170 | 2007-07-30 08:53:27 +0200 | [diff] [blame] | 1879 | .help = "Store verify buffer header every N bytes", |
Jens Axboe | afdf935 | 2007-07-31 16:14:34 +0200 | [diff] [blame] | 1880 | .parent = "verify", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1881 | .hide = 1, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1882 | .interval = 2 * sizeof(struct verify_header), |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1883 | .category = FIO_OPT_C_IO, |
| 1884 | .group = FIO_OPT_G_VERIFY, |
Shawn Lewis | 3f9f4e2 | 2007-07-28 21:10:37 +0200 | [diff] [blame] | 1885 | }, |
| 1886 | { |
Jens Axboe | a59e170 | 2007-07-30 08:53:27 +0200 | [diff] [blame] | 1887 | .name = "verify_offset", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1888 | .lname = "Verify offset", |
Jens Axboe | e01b22b | 2009-06-09 15:43:25 +0200 | [diff] [blame] | 1889 | .type = FIO_OPT_INT, |
Jens Axboe | a59e170 | 2007-07-30 08:53:27 +0200 | [diff] [blame] | 1890 | .help = "Offset verify header location by N bytes", |
Jens Axboe | 203160d | 2012-03-29 21:17:12 +0200 | [diff] [blame] | 1891 | .off1 = td_var_offset(verify_offset), |
| 1892 | .minval = sizeof(struct verify_header), |
Jens Axboe | afdf935 | 2007-07-31 16:14:34 +0200 | [diff] [blame] | 1893 | .parent = "verify", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1894 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1895 | .category = FIO_OPT_C_IO, |
| 1896 | .group = FIO_OPT_G_VERIFY, |
Shawn Lewis | 546a914 | 2007-07-28 21:11:37 +0200 | [diff] [blame] | 1897 | }, |
| 1898 | { |
Shawn Lewis | e28218f | 2008-01-16 11:01:33 +0100 | [diff] [blame] | 1899 | .name = "verify_pattern", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1900 | .lname = "Verify pattern", |
Radha Ramachandran | 0e92f87 | 2009-10-27 20:14:27 +0100 | [diff] [blame] | 1901 | .type = FIO_OPT_STR, |
Shawn Lewis | e28218f | 2008-01-16 11:01:33 +0100 | [diff] [blame] | 1902 | .cb = str_verify_pattern_cb, |
| 1903 | .help = "Fill pattern for IO buffers", |
| 1904 | .parent = "verify", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1905 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1906 | .category = FIO_OPT_C_IO, |
| 1907 | .group = FIO_OPT_G_VERIFY, |
Shawn Lewis | e28218f | 2008-01-16 11:01:33 +0100 | [diff] [blame] | 1908 | }, |
| 1909 | { |
Jens Axboe | a12a3b4 | 2007-08-09 10:20:54 +0200 | [diff] [blame] | 1910 | .name = "verify_fatal", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1911 | .lname = "Verify fatal", |
Jens Axboe | 68e1f29 | 2007-08-10 10:32:14 +0200 | [diff] [blame] | 1912 | .type = FIO_OPT_BOOL, |
Jens Axboe | a12a3b4 | 2007-08-09 10:20:54 +0200 | [diff] [blame] | 1913 | .off1 = td_var_offset(verify_fatal), |
| 1914 | .def = "0", |
| 1915 | .help = "Exit on a single verify failure, don't continue", |
| 1916 | .parent = "verify", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1917 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1918 | .category = FIO_OPT_C_IO, |
| 1919 | .group = FIO_OPT_G_VERIFY, |
Jens Axboe | a12a3b4 | 2007-08-09 10:20:54 +0200 | [diff] [blame] | 1920 | }, |
| 1921 | { |
Jens Axboe | b463e93 | 2011-01-12 09:03:23 +0100 | [diff] [blame] | 1922 | .name = "verify_dump", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1923 | .lname = "Verify dump", |
Jens Axboe | b463e93 | 2011-01-12 09:03:23 +0100 | [diff] [blame] | 1924 | .type = FIO_OPT_BOOL, |
| 1925 | .off1 = td_var_offset(verify_dump), |
Jens Axboe | ef71e31 | 2011-10-25 22:43:36 +0200 | [diff] [blame] | 1926 | .def = "0", |
Jens Axboe | b463e93 | 2011-01-12 09:03:23 +0100 | [diff] [blame] | 1927 | .help = "Dump contents of good and bad blocks on failure", |
| 1928 | .parent = "verify", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1929 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1930 | .category = FIO_OPT_C_IO, |
| 1931 | .group = FIO_OPT_G_VERIFY, |
Jens Axboe | b463e93 | 2011-01-12 09:03:23 +0100 | [diff] [blame] | 1932 | }, |
| 1933 | { |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 1934 | .name = "verify_async", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1935 | .lname = "Verify asynchronously", |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 1936 | .type = FIO_OPT_INT, |
| 1937 | .off1 = td_var_offset(verify_async), |
| 1938 | .def = "0", |
| 1939 | .help = "Number of async verifier threads to use", |
| 1940 | .parent = "verify", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1941 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1942 | .category = FIO_OPT_C_IO, |
| 1943 | .group = FIO_OPT_G_VERIFY, |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 1944 | }, |
Jens Axboe | 9e14418 | 2010-06-15 14:25:36 +0200 | [diff] [blame] | 1945 | { |
| 1946 | .name = "verify_backlog", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1947 | .lname = "Verify backlog", |
Jens Axboe | 9e14418 | 2010-06-15 14:25:36 +0200 | [diff] [blame] | 1948 | .type = FIO_OPT_STR_VAL, |
| 1949 | .off1 = td_var_offset(verify_backlog), |
| 1950 | .help = "Verify after this number of blocks are written", |
| 1951 | .parent = "verify", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1952 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1953 | .category = FIO_OPT_C_IO, |
| 1954 | .group = FIO_OPT_G_VERIFY, |
Jens Axboe | 9e14418 | 2010-06-15 14:25:36 +0200 | [diff] [blame] | 1955 | }, |
| 1956 | { |
| 1957 | .name = "verify_backlog_batch", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1958 | .lname = "Verify backlog batch", |
Jens Axboe | 9e14418 | 2010-06-15 14:25:36 +0200 | [diff] [blame] | 1959 | .type = FIO_OPT_INT, |
| 1960 | .off1 = td_var_offset(verify_batch), |
| 1961 | .help = "Verify this number of IO blocks", |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 1962 | .parent = "verify", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1963 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1964 | .category = FIO_OPT_C_IO, |
| 1965 | .group = FIO_OPT_G_VERIFY, |
Jens Axboe | 9e14418 | 2010-06-15 14:25:36 +0200 | [diff] [blame] | 1966 | }, |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 1967 | #ifdef FIO_HAVE_CPU_AFFINITY |
| 1968 | { |
| 1969 | .name = "verify_async_cpus", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1970 | .lname = "Async verify CPUs", |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 1971 | .type = FIO_OPT_STR, |
| 1972 | .cb = str_verify_cpus_allowed_cb, |
| 1973 | .help = "Set CPUs allowed for async verify threads", |
| 1974 | .parent = "verify_async", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1975 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1976 | .category = FIO_OPT_C_IO, |
| 1977 | .group = FIO_OPT_G_VERIFY, |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 1978 | }, |
| 1979 | #endif |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 1980 | #ifdef FIO_HAVE_TRIM |
| 1981 | { |
| 1982 | .name = "trim_percentage", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1983 | .lname = "Trim percentage", |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 1984 | .type = FIO_OPT_INT, |
Jens Axboe | 203160d | 2012-03-29 21:17:12 +0200 | [diff] [blame] | 1985 | .off1 = td_var_offset(trim_percentage), |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1986 | .minval = 0, |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 1987 | .maxval = 100, |
| 1988 | .help = "Number of verify blocks to discard/trim", |
| 1989 | .parent = "verify", |
| 1990 | .def = "0", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1991 | .interval = 1, |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1992 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1993 | .category = FIO_OPT_C_IO, |
| 1994 | .group = FIO_OPT_G_TRIM, |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 1995 | }, |
| 1996 | { |
| 1997 | .name = "trim_verify_zero", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1998 | .lname = "Verify trim zero", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1999 | .type = FIO_OPT_BOOL, |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 2000 | .help = "Verify that trim/discarded blocks are returned as zeroes", |
| 2001 | .off1 = td_var_offset(trim_zero), |
| 2002 | .parent = "trim_percentage", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2003 | .hide = 1, |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 2004 | .def = "1", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2005 | .category = FIO_OPT_C_IO, |
| 2006 | .group = FIO_OPT_G_TRIM, |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 2007 | }, |
| 2008 | { |
| 2009 | .name = "trim_backlog", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2010 | .lname = "Trim backlog", |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 2011 | .type = FIO_OPT_STR_VAL, |
| 2012 | .off1 = td_var_offset(trim_backlog), |
| 2013 | .help = "Trim after this number of blocks are written", |
| 2014 | .parent = "trim_percentage", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2015 | .hide = 1, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2016 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2017 | .category = FIO_OPT_C_IO, |
| 2018 | .group = FIO_OPT_G_TRIM, |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 2019 | }, |
| 2020 | { |
| 2021 | .name = "trim_backlog_batch", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2022 | .lname = "Trim backlog batch", |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 2023 | .type = FIO_OPT_INT, |
| 2024 | .off1 = td_var_offset(trim_batch), |
| 2025 | .help = "Trim this number of IO blocks", |
| 2026 | .parent = "trim_percentage", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2027 | .hide = 1, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2028 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2029 | .category = FIO_OPT_C_IO, |
| 2030 | .group = FIO_OPT_G_TRIM, |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 2031 | }, |
| 2032 | #endif |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 2033 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2034 | .name = "write_iolog", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2035 | .lname = "Write I/O log", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2036 | .type = FIO_OPT_STR_STORE, |
| 2037 | .off1 = td_var_offset(write_iolog_file), |
| 2038 | .help = "Store IO pattern to file", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2039 | .category = FIO_OPT_C_IO, |
| 2040 | .group = FIO_OPT_G_IOLOG, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2041 | }, |
| 2042 | { |
| 2043 | .name = "read_iolog", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2044 | .lname = "Read I/O log", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2045 | .type = FIO_OPT_STR_STORE, |
| 2046 | .off1 = td_var_offset(read_iolog_file), |
| 2047 | .help = "Playback IO pattern from file", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2048 | .category = FIO_OPT_C_IO, |
| 2049 | .group = FIO_OPT_G_IOLOG, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2050 | }, |
| 2051 | { |
David Nellans | 64bbb86 | 2010-08-24 22:13:30 +0200 | [diff] [blame] | 2052 | .name = "replay_no_stall", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2053 | .lname = "Don't stall on replay", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2054 | .type = FIO_OPT_BOOL, |
David Nellans | 64bbb86 | 2010-08-24 22:13:30 +0200 | [diff] [blame] | 2055 | .off1 = td_var_offset(no_stall), |
| 2056 | .def = "0", |
Jens Axboe | 87e7a97 | 2010-08-25 09:01:25 +0200 | [diff] [blame] | 2057 | .parent = "read_iolog", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2058 | .hide = 1, |
David Nellans | 64bbb86 | 2010-08-24 22:13:30 +0200 | [diff] [blame] | 2059 | .help = "Playback IO pattern file as fast as possible without stalls", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2060 | .category = FIO_OPT_C_IO, |
| 2061 | .group = FIO_OPT_G_IOLOG, |
David Nellans | 64bbb86 | 2010-08-24 22:13:30 +0200 | [diff] [blame] | 2062 | }, |
| 2063 | { |
David Nellans | d1c46c0 | 2010-08-31 21:20:47 +0200 | [diff] [blame] | 2064 | .name = "replay_redirect", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2065 | .lname = "Redirect device for replay", |
David Nellans | d1c46c0 | 2010-08-31 21:20:47 +0200 | [diff] [blame] | 2066 | .type = FIO_OPT_STR_STORE, |
| 2067 | .off1 = td_var_offset(replay_redirect), |
| 2068 | .parent = "read_iolog", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2069 | .hide = 1, |
David Nellans | d1c46c0 | 2010-08-31 21:20:47 +0200 | [diff] [blame] | 2070 | .help = "Replay all I/O onto this device, regardless of trace device", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2071 | .category = FIO_OPT_C_IO, |
| 2072 | .group = FIO_OPT_G_IOLOG, |
David Nellans | d1c46c0 | 2010-08-31 21:20:47 +0200 | [diff] [blame] | 2073 | }, |
| 2074 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2075 | .name = "exec_prerun", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2076 | .lname = "Pre-execute runnable", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2077 | .type = FIO_OPT_STR_STORE, |
| 2078 | .off1 = td_var_offset(exec_prerun), |
| 2079 | .help = "Execute this file prior to running job", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2080 | .category = FIO_OPT_C_GENERAL, |
| 2081 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2082 | }, |
| 2083 | { |
| 2084 | .name = "exec_postrun", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2085 | .lname = "Post-execute runnable", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2086 | .type = FIO_OPT_STR_STORE, |
| 2087 | .off1 = td_var_offset(exec_postrun), |
| 2088 | .help = "Execute this file after running job", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2089 | .category = FIO_OPT_C_GENERAL, |
| 2090 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2091 | }, |
| 2092 | #ifdef FIO_HAVE_IOSCHED_SWITCH |
| 2093 | { |
| 2094 | .name = "ioscheduler", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2095 | .lname = "I/O scheduler", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2096 | .type = FIO_OPT_STR_STORE, |
| 2097 | .off1 = td_var_offset(ioscheduler), |
| 2098 | .help = "Use this IO scheduler on the backing device", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2099 | .category = FIO_OPT_C_FILE, |
| 2100 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2101 | }, |
| 2102 | #endif |
| 2103 | { |
| 2104 | .name = "zonesize", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2105 | .lname = "Zone size", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2106 | .type = FIO_OPT_STR_VAL, |
| 2107 | .off1 = td_var_offset(zone_size), |
Steven Noonan | ed33585 | 2012-01-31 13:58:00 +0100 | [diff] [blame] | 2108 | .help = "Amount of data to read per zone", |
| 2109 | .def = "0", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2110 | .interval = 1024 * 1024, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2111 | .category = FIO_OPT_C_IO, |
| 2112 | .group = FIO_OPT_G_ZONE, |
Steven Noonan | ed33585 | 2012-01-31 13:58:00 +0100 | [diff] [blame] | 2113 | }, |
| 2114 | { |
| 2115 | .name = "zonerange", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2116 | .lname = "Zone range", |
Steven Noonan | ed33585 | 2012-01-31 13:58:00 +0100 | [diff] [blame] | 2117 | .type = FIO_OPT_STR_VAL, |
| 2118 | .off1 = td_var_offset(zone_range), |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2119 | .help = "Give size of an IO zone", |
| 2120 | .def = "0", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2121 | .interval = 1024 * 1024, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2122 | .category = FIO_OPT_C_IO, |
| 2123 | .group = FIO_OPT_G_ZONE, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2124 | }, |
| 2125 | { |
| 2126 | .name = "zoneskip", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2127 | .lname = "Zone skip", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2128 | .type = FIO_OPT_STR_VAL, |
| 2129 | .off1 = td_var_offset(zone_skip), |
| 2130 | .help = "Space between IO zones", |
| 2131 | .def = "0", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2132 | .interval = 1024 * 1024, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2133 | .category = FIO_OPT_C_IO, |
| 2134 | .group = FIO_OPT_G_ZONE, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2135 | }, |
| 2136 | { |
| 2137 | .name = "lockmem", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2138 | .lname = "Lock memory", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2139 | .type = FIO_OPT_STR_VAL, |
Jens Axboe | 1b79a07 | 2012-03-28 20:50:15 +0200 | [diff] [blame] | 2140 | .off1 = td_var_offset(lockmem), |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2141 | .help = "Lock down this amount of memory", |
| 2142 | .def = "0", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2143 | .interval = 1024 * 1024, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2144 | .category = FIO_OPT_C_GENERAL, |
| 2145 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2146 | }, |
| 2147 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2148 | .name = "rwmixread", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2149 | .lname = "Read/write mix read", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2150 | .type = FIO_OPT_INT, |
Jens Axboe | cb499fc | 2008-05-28 10:33:32 +0200 | [diff] [blame] | 2151 | .cb = str_rwmix_read_cb, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2152 | .maxval = 100, |
| 2153 | .help = "Percentage of mixed workload that is reads", |
| 2154 | .def = "50", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2155 | .interval = 5, |
Jens Axboe | 9026535 | 2012-03-19 20:29:44 +0100 | [diff] [blame] | 2156 | .inverse = "rwmixwrite", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2157 | .category = FIO_OPT_C_IO, |
| 2158 | .group = FIO_OPT_G_RWMIX, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2159 | }, |
| 2160 | { |
| 2161 | .name = "rwmixwrite", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2162 | .lname = "Read/write mix write", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2163 | .type = FIO_OPT_INT, |
Jens Axboe | cb499fc | 2008-05-28 10:33:32 +0200 | [diff] [blame] | 2164 | .cb = str_rwmix_write_cb, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2165 | .maxval = 100, |
| 2166 | .help = "Percentage of mixed workload that is writes", |
| 2167 | .def = "50", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2168 | .interval = 5, |
Jens Axboe | 9026535 | 2012-03-19 20:29:44 +0100 | [diff] [blame] | 2169 | .inverse = "rwmixread", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2170 | .category = FIO_OPT_C_IO, |
| 2171 | .group = FIO_OPT_G_RWMIX, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2172 | }, |
| 2173 | { |
Jens Axboe | afdf935 | 2007-07-31 16:14:34 +0200 | [diff] [blame] | 2174 | .name = "rwmixcycle", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2175 | .lname = "Read/write mix cycle", |
Jens Axboe | 15ca150 | 2008-04-07 09:26:02 +0200 | [diff] [blame] | 2176 | .type = FIO_OPT_DEPRECATED, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2177 | .category = FIO_OPT_C_IO, |
| 2178 | .group = FIO_OPT_G_RWMIX, |
Jens Axboe | afdf935 | 2007-07-31 16:14:34 +0200 | [diff] [blame] | 2179 | }, |
| 2180 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2181 | .name = "nice", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2182 | .lname = "Nice", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2183 | .type = FIO_OPT_INT, |
| 2184 | .off1 = td_var_offset(nice), |
| 2185 | .help = "Set job CPU nice value", |
| 2186 | .minval = -19, |
| 2187 | .maxval = 20, |
| 2188 | .def = "0", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2189 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2190 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | 1086005 | 2012-03-19 20:56:53 +0100 | [diff] [blame] | 2191 | .group = FIO_OPT_G_CRED, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2192 | }, |
| 2193 | #ifdef FIO_HAVE_IOPRIO |
| 2194 | { |
| 2195 | .name = "prio", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2196 | .lname = "I/O nice priority", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2197 | .type = FIO_OPT_INT, |
Jens Axboe | 28727df | 2012-03-29 08:33:15 +0200 | [diff] [blame] | 2198 | .off1 = td_var_offset(ioprio), |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2199 | .help = "Set job IO priority value", |
| 2200 | .minval = 0, |
| 2201 | .maxval = 7, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2202 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2203 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | 1086005 | 2012-03-19 20:56:53 +0100 | [diff] [blame] | 2204 | .group = FIO_OPT_G_CRED, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2205 | }, |
| 2206 | { |
| 2207 | .name = "prioclass", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2208 | .lname = "I/O nice priority class", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2209 | .type = FIO_OPT_INT, |
Jens Axboe | 28727df | 2012-03-29 08:33:15 +0200 | [diff] [blame] | 2210 | .off1 = td_var_offset(ioprio_class), |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2211 | .help = "Set job IO priority class", |
| 2212 | .minval = 0, |
| 2213 | .maxval = 3, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2214 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2215 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | 1086005 | 2012-03-19 20:56:53 +0100 | [diff] [blame] | 2216 | .group = FIO_OPT_G_CRED, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2217 | }, |
| 2218 | #endif |
| 2219 | { |
| 2220 | .name = "thinktime", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2221 | .lname = "Thinktime", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2222 | .type = FIO_OPT_INT, |
| 2223 | .off1 = td_var_offset(thinktime), |
| 2224 | .help = "Idle time between IO buffers (usec)", |
| 2225 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2226 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 2227 | .group = FIO_OPT_G_THINKTIME, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2228 | }, |
| 2229 | { |
| 2230 | .name = "thinktime_spin", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2231 | .lname = "Thinktime spin", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2232 | .type = FIO_OPT_INT, |
| 2233 | .off1 = td_var_offset(thinktime_spin), |
| 2234 | .help = "Start think time by spinning this amount (usec)", |
| 2235 | .def = "0", |
Jens Axboe | afdf935 | 2007-07-31 16:14:34 +0200 | [diff] [blame] | 2236 | .parent = "thinktime", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2237 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2238 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 2239 | .group = FIO_OPT_G_THINKTIME, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2240 | }, |
| 2241 | { |
| 2242 | .name = "thinktime_blocks", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2243 | .lname = "Thinktime blocks", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2244 | .type = FIO_OPT_INT, |
| 2245 | .off1 = td_var_offset(thinktime_blocks), |
| 2246 | .help = "IO buffer period between 'thinktime'", |
| 2247 | .def = "1", |
Jens Axboe | afdf935 | 2007-07-31 16:14:34 +0200 | [diff] [blame] | 2248 | .parent = "thinktime", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2249 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2250 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 2251 | .group = FIO_OPT_G_THINKTIME, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2252 | }, |
| 2253 | { |
| 2254 | .name = "rate", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2255 | .lname = "I/O rate", |
Jens Axboe | e01b22b | 2009-06-09 15:43:25 +0200 | [diff] [blame] | 2256 | .type = FIO_OPT_INT, |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 2257 | .off1 = td_var_offset(rate[DDIR_READ]), |
| 2258 | .off2 = td_var_offset(rate[DDIR_WRITE]), |
| 2259 | .off3 = td_var_offset(rate[DDIR_TRIM]), |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2260 | .help = "Set bandwidth rate", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2261 | .category = FIO_OPT_C_IO, |
| 2262 | .group = FIO_OPT_G_RATE, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2263 | }, |
| 2264 | { |
| 2265 | .name = "ratemin", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2266 | .lname = "I/O min rate", |
Jens Axboe | e01b22b | 2009-06-09 15:43:25 +0200 | [diff] [blame] | 2267 | .type = FIO_OPT_INT, |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 2268 | .off1 = td_var_offset(ratemin[DDIR_READ]), |
| 2269 | .off2 = td_var_offset(ratemin[DDIR_WRITE]), |
| 2270 | .off3 = td_var_offset(ratemin[DDIR_TRIM]), |
Jens Axboe | 4e991c2 | 2007-03-15 11:41:11 +0100 | [diff] [blame] | 2271 | .help = "Job must meet this rate or it will be shutdown", |
Jens Axboe | afdf935 | 2007-07-31 16:14:34 +0200 | [diff] [blame] | 2272 | .parent = "rate", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2273 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2274 | .category = FIO_OPT_C_IO, |
| 2275 | .group = FIO_OPT_G_RATE, |
Jens Axboe | 4e991c2 | 2007-03-15 11:41:11 +0100 | [diff] [blame] | 2276 | }, |
| 2277 | { |
| 2278 | .name = "rate_iops", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2279 | .lname = "I/O rate IOPS", |
Jens Axboe | e01b22b | 2009-06-09 15:43:25 +0200 | [diff] [blame] | 2280 | .type = FIO_OPT_INT, |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 2281 | .off1 = td_var_offset(rate_iops[DDIR_READ]), |
| 2282 | .off2 = td_var_offset(rate_iops[DDIR_WRITE]), |
| 2283 | .off3 = td_var_offset(rate_iops[DDIR_TRIM]), |
Jens Axboe | 4e991c2 | 2007-03-15 11:41:11 +0100 | [diff] [blame] | 2284 | .help = "Limit IO used to this number of IO operations/sec", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2285 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2286 | .category = FIO_OPT_C_IO, |
| 2287 | .group = FIO_OPT_G_RATE, |
Jens Axboe | 4e991c2 | 2007-03-15 11:41:11 +0100 | [diff] [blame] | 2288 | }, |
| 2289 | { |
| 2290 | .name = "rate_iops_min", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2291 | .lname = "I/O min rate IOPS", |
Jens Axboe | e01b22b | 2009-06-09 15:43:25 +0200 | [diff] [blame] | 2292 | .type = FIO_OPT_INT, |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 2293 | .off1 = td_var_offset(rate_iops_min[DDIR_READ]), |
| 2294 | .off2 = td_var_offset(rate_iops_min[DDIR_WRITE]), |
| 2295 | .off3 = td_var_offset(rate_iops_min[DDIR_TRIM]), |
Bruce Cran | 03e20d6 | 2011-01-02 20:14:54 +0100 | [diff] [blame] | 2296 | .help = "Job must meet this rate or it will be shut down", |
Jens Axboe | afdf935 | 2007-07-31 16:14:34 +0200 | [diff] [blame] | 2297 | .parent = "rate_iops", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2298 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2299 | .category = FIO_OPT_C_IO, |
| 2300 | .group = FIO_OPT_G_RATE, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2301 | }, |
| 2302 | { |
| 2303 | .name = "ratecycle", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2304 | .lname = "I/O rate cycle", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2305 | .type = FIO_OPT_INT, |
| 2306 | .off1 = td_var_offset(ratecycle), |
| 2307 | .help = "Window average for rate limits (msec)", |
| 2308 | .def = "1000", |
Jens Axboe | afdf935 | 2007-07-31 16:14:34 +0200 | [diff] [blame] | 2309 | .parent = "rate", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2310 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2311 | .category = FIO_OPT_C_IO, |
| 2312 | .group = FIO_OPT_G_RATE, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2313 | }, |
| 2314 | { |
| 2315 | .name = "invalidate", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2316 | .lname = "Cache invalidate", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2317 | .type = FIO_OPT_BOOL, |
| 2318 | .off1 = td_var_offset(invalidate_cache), |
| 2319 | .help = "Invalidate buffer/page cache prior to running job", |
| 2320 | .def = "1", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2321 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 2322 | .group = FIO_OPT_G_IO_TYPE, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2323 | }, |
| 2324 | { |
| 2325 | .name = "sync", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2326 | .lname = "Synchronous I/O", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2327 | .type = FIO_OPT_BOOL, |
| 2328 | .off1 = td_var_offset(sync_io), |
| 2329 | .help = "Use O_SYNC for buffered writes", |
| 2330 | .def = "0", |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 2331 | .parent = "buffered", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2332 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2333 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 2334 | .group = FIO_OPT_G_IO_TYPE, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2335 | }, |
| 2336 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2337 | .name = "create_serialize", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2338 | .lname = "Create serialize", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2339 | .type = FIO_OPT_BOOL, |
| 2340 | .off1 = td_var_offset(create_serialize), |
| 2341 | .help = "Serialize creating of job files", |
| 2342 | .def = "1", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2343 | .category = FIO_OPT_C_FILE, |
| 2344 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2345 | }, |
| 2346 | { |
| 2347 | .name = "create_fsync", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2348 | .lname = "Create fsync", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2349 | .type = FIO_OPT_BOOL, |
| 2350 | .off1 = td_var_offset(create_fsync), |
Bruce Cran | 03e20d6 | 2011-01-02 20:14:54 +0100 | [diff] [blame] | 2351 | .help = "fsync file after creation", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2352 | .def = "1", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2353 | .category = FIO_OPT_C_FILE, |
| 2354 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2355 | }, |
| 2356 | { |
Jens Axboe | 814452b | 2009-03-04 12:53:13 +0100 | [diff] [blame] | 2357 | .name = "create_on_open", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2358 | .lname = "Create on open", |
Jens Axboe | 814452b | 2009-03-04 12:53:13 +0100 | [diff] [blame] | 2359 | .type = FIO_OPT_BOOL, |
| 2360 | .off1 = td_var_offset(create_on_open), |
| 2361 | .help = "Create files when they are opened for IO", |
| 2362 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2363 | .category = FIO_OPT_C_FILE, |
| 2364 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 814452b | 2009-03-04 12:53:13 +0100 | [diff] [blame] | 2365 | }, |
Jens Axboe | 0b9d69e | 2009-09-11 22:29:54 +0200 | [diff] [blame] | 2366 | { |
Jens Axboe | 25460cf | 2012-05-02 13:58:02 +0200 | [diff] [blame] | 2367 | .name = "create_only", |
| 2368 | .type = FIO_OPT_BOOL, |
| 2369 | .off1 = td_var_offset(create_only), |
| 2370 | .help = "Only perform file creation phase", |
Jens Axboe | d17fda7 | 2012-05-07 09:56:00 +0200 | [diff] [blame] | 2371 | .category = FIO_OPT_C_FILE, |
Jens Axboe | 25460cf | 2012-05-02 13:58:02 +0200 | [diff] [blame] | 2372 | .def = "0", |
| 2373 | }, |
| 2374 | { |
Zhang, Yanmin | afad68f | 2009-05-20 11:30:55 +0200 | [diff] [blame] | 2375 | .name = "pre_read", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2376 | .lname = "Pre-read files", |
Zhang, Yanmin | afad68f | 2009-05-20 11:30:55 +0200 | [diff] [blame] | 2377 | .type = FIO_OPT_BOOL, |
| 2378 | .off1 = td_var_offset(pre_read), |
Bruce Cran | 03e20d6 | 2011-01-02 20:14:54 +0100 | [diff] [blame] | 2379 | .help = "Pre-read files before starting official testing", |
Zhang, Yanmin | afad68f | 2009-05-20 11:30:55 +0200 | [diff] [blame] | 2380 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2381 | .category = FIO_OPT_C_FILE, |
| 2382 | .group = FIO_OPT_G_INVALID, |
Zhang, Yanmin | afad68f | 2009-05-20 11:30:55 +0200 | [diff] [blame] | 2383 | }, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2384 | #ifdef FIO_HAVE_CPU_AFFINITY |
| 2385 | { |
| 2386 | .name = "cpumask", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2387 | .lname = "CPU mask", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2388 | .type = FIO_OPT_INT, |
| 2389 | .cb = str_cpumask_cb, |
| 2390 | .help = "CPU affinity mask", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2391 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | 1086005 | 2012-03-19 20:56:53 +0100 | [diff] [blame] | 2392 | .group = FIO_OPT_G_CRED, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2393 | }, |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 2394 | { |
| 2395 | .name = "cpus_allowed", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2396 | .lname = "CPUs allowed", |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 2397 | .type = FIO_OPT_STR, |
| 2398 | .cb = str_cpus_allowed_cb, |
| 2399 | .help = "Set CPUs allowed", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2400 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | 1086005 | 2012-03-19 20:56:53 +0100 | [diff] [blame] | 2401 | .group = FIO_OPT_G_CRED, |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 2402 | }, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2403 | #endif |
| 2404 | { |
| 2405 | .name = "end_fsync", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2406 | .lname = "End fsync", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2407 | .type = FIO_OPT_BOOL, |
| 2408 | .off1 = td_var_offset(end_fsync), |
| 2409 | .help = "Include fsync at the end of job", |
| 2410 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2411 | .category = FIO_OPT_C_FILE, |
| 2412 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2413 | }, |
| 2414 | { |
| 2415 | .name = "fsync_on_close", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2416 | .lname = "Fsync on close", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2417 | .type = FIO_OPT_BOOL, |
| 2418 | .off1 = td_var_offset(fsync_on_close), |
| 2419 | .help = "fsync files on close", |
| 2420 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2421 | .category = FIO_OPT_C_FILE, |
| 2422 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2423 | }, |
| 2424 | { |
| 2425 | .name = "unlink", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2426 | .lname = "Unlink file", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2427 | .type = FIO_OPT_BOOL, |
| 2428 | .off1 = td_var_offset(unlink), |
| 2429 | .help = "Unlink created files after job has completed", |
| 2430 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2431 | .category = FIO_OPT_C_FILE, |
| 2432 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2433 | }, |
| 2434 | { |
| 2435 | .name = "exitall", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2436 | .lname = "Exit-all on terminate", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2437 | .type = FIO_OPT_STR_SET, |
| 2438 | .cb = str_exitall_cb, |
| 2439 | .help = "Terminate all jobs when one exits", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2440 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 2441 | .group = FIO_OPT_G_PROCESS, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2442 | }, |
| 2443 | { |
| 2444 | .name = "stonewall", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2445 | .lname = "Wait for previous", |
Jens Axboe | d392365 | 2011-08-03 12:38:39 +0200 | [diff] [blame] | 2446 | .alias = "wait_for_previous", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2447 | .type = FIO_OPT_STR_SET, |
| 2448 | .off1 = td_var_offset(stonewall), |
| 2449 | .help = "Insert a hard barrier between this job and previous", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2450 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 2451 | .group = FIO_OPT_G_PROCESS, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2452 | }, |
| 2453 | { |
Jens Axboe | b3d62a7 | 2007-03-20 14:23:26 +0100 | [diff] [blame] | 2454 | .name = "new_group", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2455 | .lname = "New group", |
Jens Axboe | b3d62a7 | 2007-03-20 14:23:26 +0100 | [diff] [blame] | 2456 | .type = FIO_OPT_STR_SET, |
| 2457 | .off1 = td_var_offset(new_group), |
| 2458 | .help = "Mark the start of a new group (for reporting)", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2459 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 2460 | .group = FIO_OPT_G_PROCESS, |
Jens Axboe | b3d62a7 | 2007-03-20 14:23:26 +0100 | [diff] [blame] | 2461 | }, |
| 2462 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2463 | .name = "thread", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2464 | .lname = "Thread", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2465 | .type = FIO_OPT_STR_SET, |
| 2466 | .off1 = td_var_offset(use_thread), |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2467 | .help = "Use threads instead of processes", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2468 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 2469 | .group = FIO_OPT_G_PROCESS, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2470 | }, |
| 2471 | { |
| 2472 | .name = "write_bw_log", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2473 | .lname = "Write bandwidth log", |
Jens Axboe | 203160d | 2012-03-29 21:17:12 +0200 | [diff] [blame] | 2474 | .type = FIO_OPT_STR_STORE, |
| 2475 | .off1 = td_var_offset(bw_log_file), |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2476 | .help = "Write log of bandwidth during run", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2477 | .category = FIO_OPT_C_LOG, |
| 2478 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2479 | }, |
| 2480 | { |
| 2481 | .name = "write_lat_log", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2482 | .lname = "Write latency log", |
Jens Axboe | 203160d | 2012-03-29 21:17:12 +0200 | [diff] [blame] | 2483 | .type = FIO_OPT_STR_STORE, |
| 2484 | .off1 = td_var_offset(lat_log_file), |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2485 | .help = "Write log of latency during run", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2486 | .category = FIO_OPT_C_LOG, |
| 2487 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2488 | }, |
| 2489 | { |
Jens Axboe | c8eeb9d | 2011-10-05 14:02:22 +0200 | [diff] [blame] | 2490 | .name = "write_iops_log", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2491 | .lname = "Write IOPS log", |
Jens Axboe | c8eeb9d | 2011-10-05 14:02:22 +0200 | [diff] [blame] | 2492 | .type = FIO_OPT_STR, |
Jens Axboe | 203160d | 2012-03-29 21:17:12 +0200 | [diff] [blame] | 2493 | .off1 = td_var_offset(iops_log_file), |
Jens Axboe | c8eeb9d | 2011-10-05 14:02:22 +0200 | [diff] [blame] | 2494 | .help = "Write log of IOPS during run", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2495 | .category = FIO_OPT_C_LOG, |
| 2496 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | c8eeb9d | 2011-10-05 14:02:22 +0200 | [diff] [blame] | 2497 | }, |
| 2498 | { |
Jens Axboe | b8bc8cb | 2011-12-01 09:04:31 +0100 | [diff] [blame] | 2499 | .name = "log_avg_msec", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2500 | .lname = "Log averaging (msec)", |
Jens Axboe | b8bc8cb | 2011-12-01 09:04:31 +0100 | [diff] [blame] | 2501 | .type = FIO_OPT_INT, |
| 2502 | .off1 = td_var_offset(log_avg_msec), |
| 2503 | .help = "Average bw/iops/lat logs over this period of time", |
| 2504 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2505 | .category = FIO_OPT_C_LOG, |
| 2506 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | b8bc8cb | 2011-12-01 09:04:31 +0100 | [diff] [blame] | 2507 | }, |
| 2508 | { |
Jens Axboe | c504ee5 | 2012-03-20 11:29:09 +0100 | [diff] [blame] | 2509 | .name = "bwavgtime", |
| 2510 | .lname = "Bandwidth average time", |
| 2511 | .type = FIO_OPT_INT, |
| 2512 | .off1 = td_var_offset(bw_avg_time), |
| 2513 | .help = "Time window over which to calculate bandwidth" |
| 2514 | " (msec)", |
| 2515 | .def = "500", |
| 2516 | .parent = "write_bw_log", |
| 2517 | .hide = 1, |
| 2518 | .interval = 100, |
| 2519 | .category = FIO_OPT_C_LOG, |
| 2520 | .group = FIO_OPT_G_INVALID, |
| 2521 | }, |
| 2522 | { |
| 2523 | .name = "iopsavgtime", |
| 2524 | .lname = "IOPS average time", |
| 2525 | .type = FIO_OPT_INT, |
| 2526 | .off1 = td_var_offset(iops_avg_time), |
| 2527 | .help = "Time window over which to calculate IOPS (msec)", |
| 2528 | .def = "500", |
| 2529 | .parent = "write_iops_log", |
| 2530 | .hide = 1, |
| 2531 | .interval = 100, |
| 2532 | .category = FIO_OPT_C_LOG, |
| 2533 | .group = FIO_OPT_G_INVALID, |
| 2534 | }, |
| 2535 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2536 | .name = "group_reporting", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2537 | .lname = "Group reporting", |
| 2538 | .type = FIO_OPT_BOOL, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2539 | .off1 = td_var_offset(group_reporting), |
| 2540 | .help = "Do reporting on a per-group basis", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2541 | .def = "1", |
Jens Axboe | 1086005 | 2012-03-19 20:56:53 +0100 | [diff] [blame] | 2542 | .category = FIO_OPT_C_STAT, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2543 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2544 | }, |
| 2545 | { |
Jens Axboe | e9459e5 | 2007-04-17 15:46:32 +0200 | [diff] [blame] | 2546 | .name = "zero_buffers", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2547 | .lname = "Zero I/O buffers", |
Jens Axboe | e9459e5 | 2007-04-17 15:46:32 +0200 | [diff] [blame] | 2548 | .type = FIO_OPT_STR_SET, |
| 2549 | .off1 = td_var_offset(zero_buffers), |
| 2550 | .help = "Init IO buffers to all zeroes", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2551 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 2552 | .group = FIO_OPT_G_IO_BUF, |
Jens Axboe | e9459e5 | 2007-04-17 15:46:32 +0200 | [diff] [blame] | 2553 | }, |
Jens Axboe | 5973caf | 2008-05-21 19:52:35 +0200 | [diff] [blame] | 2554 | { |
| 2555 | .name = "refill_buffers", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2556 | .lname = "Refill I/O buffers", |
Jens Axboe | 5973caf | 2008-05-21 19:52:35 +0200 | [diff] [blame] | 2557 | .type = FIO_OPT_STR_SET, |
| 2558 | .off1 = td_var_offset(refill_buffers), |
| 2559 | .help = "Refill IO buffers on every IO submit", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2560 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 2561 | .group = FIO_OPT_G_IO_BUF, |
Jens Axboe | 5973caf | 2008-05-21 19:52:35 +0200 | [diff] [blame] | 2562 | }, |
Yu-ju Hong | 8334919 | 2011-08-13 00:53:44 +0200 | [diff] [blame] | 2563 | { |
Jens Axboe | fd68418 | 2011-09-19 09:24:44 +0200 | [diff] [blame] | 2564 | .name = "scramble_buffers", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2565 | .lname = "Scramble I/O buffers", |
Jens Axboe | fd68418 | 2011-09-19 09:24:44 +0200 | [diff] [blame] | 2566 | .type = FIO_OPT_BOOL, |
| 2567 | .off1 = td_var_offset(scramble_buffers), |
| 2568 | .help = "Slightly scramble buffers on every IO submit", |
| 2569 | .def = "1", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2570 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 2571 | .group = FIO_OPT_G_IO_BUF, |
Jens Axboe | fd68418 | 2011-09-19 09:24:44 +0200 | [diff] [blame] | 2572 | }, |
| 2573 | { |
Jens Axboe | 9c42684 | 2012-03-02 21:02:12 +0100 | [diff] [blame] | 2574 | .name = "buffer_compress_percentage", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2575 | .lname = "Buffer compression percentage", |
Jens Axboe | 9c42684 | 2012-03-02 21:02:12 +0100 | [diff] [blame] | 2576 | .type = FIO_OPT_INT, |
| 2577 | .off1 = td_var_offset(compress_percentage), |
| 2578 | .maxval = 100, |
| 2579 | .minval = 1, |
| 2580 | .help = "How compressible the buffer is (approximately)", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2581 | .interval = 5, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2582 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 2583 | .group = FIO_OPT_G_IO_BUF, |
Jens Axboe | 9c42684 | 2012-03-02 21:02:12 +0100 | [diff] [blame] | 2584 | }, |
| 2585 | { |
Jens Axboe | f97a43a | 2012-03-09 19:06:24 +0100 | [diff] [blame] | 2586 | .name = "buffer_compress_chunk", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2587 | .lname = "Buffer compression chunk size", |
Jens Axboe | f97a43a | 2012-03-09 19:06:24 +0100 | [diff] [blame] | 2588 | .type = FIO_OPT_INT, |
| 2589 | .off1 = td_var_offset(compress_chunk), |
Jens Axboe | 207b18e | 2012-03-09 19:11:25 +0100 | [diff] [blame] | 2590 | .parent = "buffer_compress_percentage", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2591 | .hide = 1, |
Jens Axboe | f97a43a | 2012-03-09 19:06:24 +0100 | [diff] [blame] | 2592 | .help = "Size of compressible region in buffer", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2593 | .interval = 256, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2594 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 2595 | .group = FIO_OPT_G_IO_BUF, |
Jens Axboe | f97a43a | 2012-03-09 19:06:24 +0100 | [diff] [blame] | 2596 | }, |
| 2597 | { |
Yu-ju Hong | 8334919 | 2011-08-13 00:53:44 +0200 | [diff] [blame] | 2598 | .name = "clat_percentiles", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2599 | .lname = "Completion latency percentiles", |
Yu-ju Hong | 8334919 | 2011-08-13 00:53:44 +0200 | [diff] [blame] | 2600 | .type = FIO_OPT_BOOL, |
| 2601 | .off1 = td_var_offset(clat_percentiles), |
| 2602 | .help = "Enable the reporting of completion latency percentiles", |
Jens Axboe | 467b35e | 2011-10-13 08:53:24 +0200 | [diff] [blame] | 2603 | .def = "1", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2604 | .category = FIO_OPT_C_STAT, |
| 2605 | .group = FIO_OPT_G_INVALID, |
Yu-ju Hong | 8334919 | 2011-08-13 00:53:44 +0200 | [diff] [blame] | 2606 | }, |
| 2607 | { |
| 2608 | .name = "percentile_list", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2609 | .lname = "Completion latency percentile list", |
Yu-ju Hong | 8334919 | 2011-08-13 00:53:44 +0200 | [diff] [blame] | 2610 | .type = FIO_OPT_FLOAT_LIST, |
| 2611 | .off1 = td_var_offset(percentile_list), |
| 2612 | .off2 = td_var_offset(overwrite_plist), |
| 2613 | .help = "Specify a custom list of percentiles to report", |
| 2614 | .maxlen = FIO_IO_U_LIST_MAX_LEN, |
| 2615 | .minfp = 0.0, |
| 2616 | .maxfp = 100.0, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2617 | .category = FIO_OPT_C_STAT, |
| 2618 | .group = FIO_OPT_G_INVALID, |
Yu-ju Hong | 8334919 | 2011-08-13 00:53:44 +0200 | [diff] [blame] | 2619 | }, |
| 2620 | |
Jens Axboe | 0a839f3 | 2007-04-26 09:02:34 +0200 | [diff] [blame] | 2621 | #ifdef FIO_HAVE_DISK_UTIL |
| 2622 | { |
| 2623 | .name = "disk_util", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2624 | .lname = "Disk utilization", |
Jens Axboe | 0a839f3 | 2007-04-26 09:02:34 +0200 | [diff] [blame] | 2625 | .type = FIO_OPT_BOOL, |
| 2626 | .off1 = td_var_offset(do_disk_util), |
Jens Axboe | f66ab3c | 2008-06-05 11:48:22 +0200 | [diff] [blame] | 2627 | .help = "Log disk utilization statistics", |
Jens Axboe | 0a839f3 | 2007-04-26 09:02:34 +0200 | [diff] [blame] | 2628 | .def = "1", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2629 | .category = FIO_OPT_C_STAT, |
| 2630 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 0a839f3 | 2007-04-26 09:02:34 +0200 | [diff] [blame] | 2631 | }, |
| 2632 | #endif |
Jens Axboe | e9459e5 | 2007-04-17 15:46:32 +0200 | [diff] [blame] | 2633 | { |
Jens Axboe | 993bf48 | 2008-11-14 13:04:53 +0100 | [diff] [blame] | 2634 | .name = "gtod_reduce", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2635 | .lname = "Reduce gettimeofday() calls", |
Jens Axboe | 993bf48 | 2008-11-14 13:04:53 +0100 | [diff] [blame] | 2636 | .type = FIO_OPT_BOOL, |
| 2637 | .help = "Greatly reduce number of gettimeofday() calls", |
| 2638 | .cb = str_gtod_reduce_cb, |
| 2639 | .def = "0", |
Jens Axboe | a4ed77f | 2012-03-20 10:19:44 +0100 | [diff] [blame] | 2640 | .hide_on_set = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2641 | .category = FIO_OPT_C_STAT, |
| 2642 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 993bf48 | 2008-11-14 13:04:53 +0100 | [diff] [blame] | 2643 | }, |
| 2644 | { |
Jens Axboe | 02af098 | 2010-06-24 09:59:34 +0200 | [diff] [blame] | 2645 | .name = "disable_lat", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2646 | .lname = "Disable all latency stats", |
Jens Axboe | 02af098 | 2010-06-24 09:59:34 +0200 | [diff] [blame] | 2647 | .type = FIO_OPT_BOOL, |
| 2648 | .off1 = td_var_offset(disable_lat), |
| 2649 | .help = "Disable latency numbers", |
| 2650 | .parent = "gtod_reduce", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2651 | .hide = 1, |
Jens Axboe | 02af098 | 2010-06-24 09:59:34 +0200 | [diff] [blame] | 2652 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2653 | .category = FIO_OPT_C_STAT, |
| 2654 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 02af098 | 2010-06-24 09:59:34 +0200 | [diff] [blame] | 2655 | }, |
| 2656 | { |
Jens Axboe | 9520ebb | 2008-10-16 21:03:27 +0200 | [diff] [blame] | 2657 | .name = "disable_clat", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2658 | .lname = "Disable completion latency stats", |
Jens Axboe | 9520ebb | 2008-10-16 21:03:27 +0200 | [diff] [blame] | 2659 | .type = FIO_OPT_BOOL, |
| 2660 | .off1 = td_var_offset(disable_clat), |
| 2661 | .help = "Disable completion latency numbers", |
Jens Axboe | 993bf48 | 2008-11-14 13:04:53 +0100 | [diff] [blame] | 2662 | .parent = "gtod_reduce", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2663 | .hide = 1, |
Jens Axboe | 9520ebb | 2008-10-16 21:03:27 +0200 | [diff] [blame] | 2664 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2665 | .category = FIO_OPT_C_STAT, |
| 2666 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 9520ebb | 2008-10-16 21:03:27 +0200 | [diff] [blame] | 2667 | }, |
| 2668 | { |
| 2669 | .name = "disable_slat", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2670 | .lname = "Disable submission latency stats", |
Jens Axboe | 9520ebb | 2008-10-16 21:03:27 +0200 | [diff] [blame] | 2671 | .type = FIO_OPT_BOOL, |
| 2672 | .off1 = td_var_offset(disable_slat), |
Bruce Cran | 03e20d6 | 2011-01-02 20:14:54 +0100 | [diff] [blame] | 2673 | .help = "Disable submission latency numbers", |
Jens Axboe | 993bf48 | 2008-11-14 13:04:53 +0100 | [diff] [blame] | 2674 | .parent = "gtod_reduce", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2675 | .hide = 1, |
Jens Axboe | 9520ebb | 2008-10-16 21:03:27 +0200 | [diff] [blame] | 2676 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2677 | .category = FIO_OPT_C_STAT, |
| 2678 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 9520ebb | 2008-10-16 21:03:27 +0200 | [diff] [blame] | 2679 | }, |
| 2680 | { |
| 2681 | .name = "disable_bw_measurement", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2682 | .lname = "Disable bandwidth stats", |
Jens Axboe | 9520ebb | 2008-10-16 21:03:27 +0200 | [diff] [blame] | 2683 | .type = FIO_OPT_BOOL, |
| 2684 | .off1 = td_var_offset(disable_bw), |
| 2685 | .help = "Disable bandwidth logging", |
Jens Axboe | 993bf48 | 2008-11-14 13:04:53 +0100 | [diff] [blame] | 2686 | .parent = "gtod_reduce", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2687 | .hide = 1, |
Jens Axboe | 9520ebb | 2008-10-16 21:03:27 +0200 | [diff] [blame] | 2688 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2689 | .category = FIO_OPT_C_STAT, |
| 2690 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 9520ebb | 2008-10-16 21:03:27 +0200 | [diff] [blame] | 2691 | }, |
| 2692 | { |
Jens Axboe | be4ecfd | 2008-12-08 14:10:52 +0100 | [diff] [blame] | 2693 | .name = "gtod_cpu", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2694 | .lname = "Dedicated gettimeofday() CPU", |
Jens Axboe | be4ecfd | 2008-12-08 14:10:52 +0100 | [diff] [blame] | 2695 | .type = FIO_OPT_INT, |
| 2696 | .cb = str_gtod_cpu_cb, |
Bruce Cran | 03e20d6 | 2011-01-02 20:14:54 +0100 | [diff] [blame] | 2697 | .help = "Set up dedicated gettimeofday() thread on this CPU", |
Jens Axboe | 29d43ff | 2009-07-01 10:42:18 +0200 | [diff] [blame] | 2698 | .verify = gtod_cpu_verify, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2699 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | 1086005 | 2012-03-19 20:56:53 +0100 | [diff] [blame] | 2700 | .group = FIO_OPT_G_CLOCK, |
Jens Axboe | be4ecfd | 2008-12-08 14:10:52 +0100 | [diff] [blame] | 2701 | }, |
| 2702 | { |
Radha Ramachandran | f2bba18 | 2009-06-15 08:40:16 +0200 | [diff] [blame] | 2703 | .name = "continue_on_error", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2704 | .lname = "Continue on error", |
Steven Lang | 0684202 | 2011-11-17 09:45:17 +0100 | [diff] [blame] | 2705 | .type = FIO_OPT_STR, |
Radha Ramachandran | f2bba18 | 2009-06-15 08:40:16 +0200 | [diff] [blame] | 2706 | .off1 = td_var_offset(continue_on_error), |
Bruce Cran | 03e20d6 | 2011-01-02 20:14:54 +0100 | [diff] [blame] | 2707 | .help = "Continue on non-fatal errors during IO", |
Steven Lang | 0684202 | 2011-11-17 09:45:17 +0100 | [diff] [blame] | 2708 | .def = "none", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2709 | .category = FIO_OPT_C_GENERAL, |
| 2710 | .group = FIO_OPT_G_INVALID, |
Steven Lang | 0684202 | 2011-11-17 09:45:17 +0100 | [diff] [blame] | 2711 | .posval = { |
| 2712 | { .ival = "none", |
| 2713 | .oval = ERROR_TYPE_NONE, |
| 2714 | .help = "Exit when an error is encountered", |
| 2715 | }, |
| 2716 | { .ival = "read", |
| 2717 | .oval = ERROR_TYPE_READ, |
| 2718 | .help = "Continue on read errors only", |
| 2719 | }, |
| 2720 | { .ival = "write", |
| 2721 | .oval = ERROR_TYPE_WRITE, |
| 2722 | .help = "Continue on write errors only", |
| 2723 | }, |
| 2724 | { .ival = "io", |
| 2725 | .oval = ERROR_TYPE_READ | ERROR_TYPE_WRITE, |
| 2726 | .help = "Continue on any IO errors", |
| 2727 | }, |
| 2728 | { .ival = "verify", |
| 2729 | .oval = ERROR_TYPE_VERIFY, |
| 2730 | .help = "Continue on verify errors only", |
| 2731 | }, |
| 2732 | { .ival = "all", |
| 2733 | .oval = ERROR_TYPE_ANY, |
| 2734 | .help = "Continue on all io and verify errors", |
| 2735 | }, |
| 2736 | { .ival = "0", |
| 2737 | .oval = ERROR_TYPE_NONE, |
| 2738 | .help = "Alias for 'none'", |
| 2739 | }, |
| 2740 | { .ival = "1", |
| 2741 | .oval = ERROR_TYPE_ANY, |
| 2742 | .help = "Alias for 'all'", |
| 2743 | }, |
| 2744 | }, |
Radha Ramachandran | f2bba18 | 2009-06-15 08:40:16 +0200 | [diff] [blame] | 2745 | }, |
| 2746 | { |
Dmitry Monakhov | 8b28bd4 | 2012-09-23 15:46:09 +0400 | [diff] [blame] | 2747 | .name = "ignore_error", |
| 2748 | .type = FIO_OPT_STR, |
| 2749 | .cb = str_ignore_error_cb, |
| 2750 | .help = "Set a specific list of errors to ignore", |
| 2751 | .parent = "rw", |
| 2752 | }, |
| 2753 | { |
| 2754 | .name = "error_dump", |
| 2755 | .type = FIO_OPT_BOOL, |
| 2756 | .off1 = td_var_offset(error_dump), |
| 2757 | .def = "0", |
| 2758 | .help = "Dump info on each error", |
| 2759 | }, |
| 2760 | |
| 2761 | { |
Jens Axboe | 9ac8a79 | 2009-11-13 21:23:07 +0100 | [diff] [blame] | 2762 | .name = "profile", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2763 | .lname = "Profile", |
Jens Axboe | 79d1631 | 2010-03-04 12:43:20 +0100 | [diff] [blame] | 2764 | .type = FIO_OPT_STR_STORE, |
Jens Axboe | 9ac8a79 | 2009-11-13 21:23:07 +0100 | [diff] [blame] | 2765 | .off1 = td_var_offset(profile), |
Jens Axboe | 9ac8a79 | 2009-11-13 21:23:07 +0100 | [diff] [blame] | 2766 | .help = "Select a specific builtin performance test", |
Jens Axboe | 13fca82 | 2012-03-31 13:55:54 +0200 | [diff] [blame] | 2767 | .category = FIO_OPT_C_PROFILE, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2768 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 9ac8a79 | 2009-11-13 21:23:07 +0100 | [diff] [blame] | 2769 | }, |
| 2770 | { |
Jens Axboe | a696fa2 | 2009-12-04 10:05:02 +0100 | [diff] [blame] | 2771 | .name = "cgroup", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2772 | .lname = "Cgroup", |
Jens Axboe | a696fa2 | 2009-12-04 10:05:02 +0100 | [diff] [blame] | 2773 | .type = FIO_OPT_STR_STORE, |
| 2774 | .off1 = td_var_offset(cgroup), |
| 2775 | .help = "Add job to cgroup of this name", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2776 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 2777 | .group = FIO_OPT_G_CGROUP, |
| 2778 | }, |
| 2779 | { |
| 2780 | .name = "cgroup_nodelete", |
| 2781 | .lname = "Cgroup no-delete", |
| 2782 | .type = FIO_OPT_BOOL, |
| 2783 | .off1 = td_var_offset(cgroup_nodelete), |
| 2784 | .help = "Do not delete cgroups after job completion", |
| 2785 | .def = "0", |
| 2786 | .parent = "cgroup", |
| 2787 | .category = FIO_OPT_C_GENERAL, |
| 2788 | .group = FIO_OPT_G_CGROUP, |
Jens Axboe | a696fa2 | 2009-12-04 10:05:02 +0100 | [diff] [blame] | 2789 | }, |
| 2790 | { |
| 2791 | .name = "cgroup_weight", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2792 | .lname = "Cgroup weight", |
Jens Axboe | a696fa2 | 2009-12-04 10:05:02 +0100 | [diff] [blame] | 2793 | .type = FIO_OPT_INT, |
| 2794 | .off1 = td_var_offset(cgroup_weight), |
| 2795 | .help = "Use given weight for cgroup", |
| 2796 | .minval = 100, |
| 2797 | .maxval = 1000, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 2798 | .parent = "cgroup", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2799 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 2800 | .group = FIO_OPT_G_CGROUP, |
Vivek Goyal | 7de8709 | 2010-03-31 22:55:15 +0200 | [diff] [blame] | 2801 | }, |
| 2802 | { |
Jens Axboe | e0b0d89 | 2009-12-08 10:10:14 +0100 | [diff] [blame] | 2803 | .name = "uid", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2804 | .lname = "User ID", |
Jens Axboe | e0b0d89 | 2009-12-08 10:10:14 +0100 | [diff] [blame] | 2805 | .type = FIO_OPT_INT, |
| 2806 | .off1 = td_var_offset(uid), |
| 2807 | .help = "Run job with this user ID", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2808 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | 1086005 | 2012-03-19 20:56:53 +0100 | [diff] [blame] | 2809 | .group = FIO_OPT_G_CRED, |
Jens Axboe | e0b0d89 | 2009-12-08 10:10:14 +0100 | [diff] [blame] | 2810 | }, |
| 2811 | { |
| 2812 | .name = "gid", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2813 | .lname = "Group ID", |
Jens Axboe | e0b0d89 | 2009-12-08 10:10:14 +0100 | [diff] [blame] | 2814 | .type = FIO_OPT_INT, |
| 2815 | .off1 = td_var_offset(gid), |
| 2816 | .help = "Run job with this group ID", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2817 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | 1086005 | 2012-03-19 20:56:53 +0100 | [diff] [blame] | 2818 | .group = FIO_OPT_G_CRED, |
Jens Axboe | e0b0d89 | 2009-12-08 10:10:14 +0100 | [diff] [blame] | 2819 | }, |
| 2820 | { |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 2821 | .name = "kb_base", |
| 2822 | .lname = "KB Base", |
| 2823 | .type = FIO_OPT_INT, |
| 2824 | .off1 = td_var_offset(kb_base), |
| 2825 | .verify = kb_base_verify, |
| 2826 | .prio = 1, |
| 2827 | .def = "1024", |
| 2828 | .help = "How many bytes per KB for reporting (1000 or 1024)", |
| 2829 | .category = FIO_OPT_C_GENERAL, |
| 2830 | .group = FIO_OPT_G_INVALID, |
| 2831 | }, |
| 2832 | { |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 2833 | .name = "hugepage-size", |
| 2834 | .lname = "Hugepage size", |
| 2835 | .type = FIO_OPT_INT, |
| 2836 | .off1 = td_var_offset(hugepage_size), |
| 2837 | .help = "When using hugepages, specify size of each page", |
| 2838 | .def = __fio_stringify(FIO_HUGE_PAGE), |
| 2839 | .interval = 1024 * 1024, |
| 2840 | .category = FIO_OPT_C_GENERAL, |
| 2841 | .group = FIO_OPT_G_INVALID, |
| 2842 | }, |
| 2843 | { |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 2844 | .name = "flow_id", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2845 | .lname = "I/O flow ID", |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 2846 | .type = FIO_OPT_INT, |
| 2847 | .off1 = td_var_offset(flow_id), |
| 2848 | .help = "The flow index ID to use", |
| 2849 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2850 | .category = FIO_OPT_C_IO, |
| 2851 | .group = FIO_OPT_G_IO_FLOW, |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 2852 | }, |
| 2853 | { |
| 2854 | .name = "flow", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2855 | .lname = "I/O flow weight", |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 2856 | .type = FIO_OPT_INT, |
| 2857 | .off1 = td_var_offset(flow), |
| 2858 | .help = "Weight for flow control of this job", |
| 2859 | .parent = "flow_id", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2860 | .hide = 1, |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 2861 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2862 | .category = FIO_OPT_C_IO, |
| 2863 | .group = FIO_OPT_G_IO_FLOW, |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 2864 | }, |
| 2865 | { |
| 2866 | .name = "flow_watermark", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2867 | .lname = "I/O flow watermark", |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 2868 | .type = FIO_OPT_INT, |
| 2869 | .off1 = td_var_offset(flow_watermark), |
| 2870 | .help = "High watermark for flow control. This option" |
| 2871 | " should be set to the same value for all threads" |
| 2872 | " with non-zero flow.", |
| 2873 | .parent = "flow_id", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2874 | .hide = 1, |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 2875 | .def = "1024", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2876 | .category = FIO_OPT_C_IO, |
| 2877 | .group = FIO_OPT_G_IO_FLOW, |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 2878 | }, |
| 2879 | { |
| 2880 | .name = "flow_sleep", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2881 | .lname = "I/O flow sleep", |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 2882 | .type = FIO_OPT_INT, |
| 2883 | .off1 = td_var_offset(flow_sleep), |
| 2884 | .help = "How many microseconds to sleep after being held" |
| 2885 | " back by the flow control mechanism", |
| 2886 | .parent = "flow_id", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2887 | .hide = 1, |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 2888 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2889 | .category = FIO_OPT_C_IO, |
| 2890 | .group = FIO_OPT_G_IO_FLOW, |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 2891 | }, |
| 2892 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2893 | .name = NULL, |
| 2894 | }, |
| 2895 | }; |
| 2896 | |
Jens Axboe | 17af15d | 2010-04-13 10:38:16 +0200 | [diff] [blame] | 2897 | static void add_to_lopt(struct option *lopt, struct fio_option *o, |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 2898 | const char *name, int val) |
Jens Axboe | 9f81736 | 2010-03-04 14:38:10 +0100 | [diff] [blame] | 2899 | { |
Jens Axboe | 17af15d | 2010-04-13 10:38:16 +0200 | [diff] [blame] | 2900 | lopt->name = (char *) name; |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 2901 | lopt->val = val; |
Jens Axboe | 9f81736 | 2010-03-04 14:38:10 +0100 | [diff] [blame] | 2902 | if (o->type == FIO_OPT_STR_SET) |
| 2903 | lopt->has_arg = no_argument; |
| 2904 | else |
| 2905 | lopt->has_arg = required_argument; |
| 2906 | } |
| 2907 | |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 2908 | static void options_to_lopts(struct fio_option *opts, |
| 2909 | struct option *long_options, |
| 2910 | int i, int option_type) |
| 2911 | { |
| 2912 | struct fio_option *o = &opts[0]; |
| 2913 | while (o->name) { |
| 2914 | add_to_lopt(&long_options[i], o, o->name, option_type); |
| 2915 | if (o->alias) { |
| 2916 | i++; |
| 2917 | add_to_lopt(&long_options[i], o, o->alias, option_type); |
| 2918 | } |
| 2919 | |
| 2920 | i++; |
| 2921 | o++; |
| 2922 | assert(i < FIO_NR_OPTIONS); |
| 2923 | } |
| 2924 | } |
| 2925 | |
| 2926 | void fio_options_set_ioengine_opts(struct option *long_options, |
| 2927 | struct thread_data *td) |
| 2928 | { |
| 2929 | unsigned int i; |
| 2930 | |
| 2931 | i = 0; |
| 2932 | while (long_options[i].name) { |
| 2933 | if (long_options[i].val == FIO_GETOPT_IOENGINE) { |
| 2934 | memset(&long_options[i], 0, sizeof(*long_options)); |
| 2935 | break; |
| 2936 | } |
| 2937 | i++; |
| 2938 | } |
| 2939 | |
| 2940 | /* |
| 2941 | * Just clear out the prior ioengine options. |
| 2942 | */ |
| 2943 | if (!td || !td->eo) |
| 2944 | return; |
| 2945 | |
| 2946 | options_to_lopts(td->io_ops->options, long_options, i, |
| 2947 | FIO_GETOPT_IOENGINE); |
| 2948 | } |
| 2949 | |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2950 | void fio_options_dup_and_init(struct option *long_options) |
| 2951 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2952 | unsigned int i; |
| 2953 | |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 2954 | options_init(fio_options); |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2955 | |
| 2956 | i = 0; |
| 2957 | while (long_options[i].name) |
| 2958 | i++; |
| 2959 | |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 2960 | options_to_lopts(fio_options, long_options, i, FIO_GETOPT_JOB); |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2961 | } |
| 2962 | |
Jens Axboe | 74929ac | 2009-08-05 11:42:37 +0200 | [diff] [blame] | 2963 | struct fio_keyword { |
| 2964 | const char *word; |
| 2965 | const char *desc; |
| 2966 | char *replace; |
| 2967 | }; |
| 2968 | |
| 2969 | static struct fio_keyword fio_keywords[] = { |
| 2970 | { |
| 2971 | .word = "$pagesize", |
| 2972 | .desc = "Page size in the system", |
| 2973 | }, |
| 2974 | { |
| 2975 | .word = "$mb_memory", |
| 2976 | .desc = "Megabytes of memory online", |
| 2977 | }, |
| 2978 | { |
| 2979 | .word = "$ncpus", |
| 2980 | .desc = "Number of CPUs online in the system", |
| 2981 | }, |
| 2982 | { |
| 2983 | .word = NULL, |
| 2984 | }, |
| 2985 | }; |
| 2986 | |
| 2987 | void fio_keywords_init(void) |
| 2988 | { |
Jens Axboe | 3b2e146 | 2009-12-15 08:58:10 +0100 | [diff] [blame] | 2989 | unsigned long long mb_memory; |
Jens Axboe | 74929ac | 2009-08-05 11:42:37 +0200 | [diff] [blame] | 2990 | char buf[128]; |
| 2991 | long l; |
| 2992 | |
| 2993 | sprintf(buf, "%lu", page_size); |
| 2994 | fio_keywords[0].replace = strdup(buf); |
| 2995 | |
Jens Axboe | 8eb016d | 2011-07-11 10:24:20 +0200 | [diff] [blame] | 2996 | mb_memory = os_phys_mem() / (1024 * 1024); |
Jens Axboe | 3b2e146 | 2009-12-15 08:58:10 +0100 | [diff] [blame] | 2997 | sprintf(buf, "%llu", mb_memory); |
Jens Axboe | 74929ac | 2009-08-05 11:42:37 +0200 | [diff] [blame] | 2998 | fio_keywords[1].replace = strdup(buf); |
| 2999 | |
Jens Axboe | c00a228 | 2011-07-08 20:56:06 +0200 | [diff] [blame] | 3000 | l = cpus_online(); |
Jens Axboe | 74929ac | 2009-08-05 11:42:37 +0200 | [diff] [blame] | 3001 | sprintf(buf, "%lu", l); |
| 3002 | fio_keywords[2].replace = strdup(buf); |
| 3003 | } |
| 3004 | |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3005 | #define BC_APP "bc" |
| 3006 | |
| 3007 | static char *bc_calc(char *str) |
| 3008 | { |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3009 | char buf[128], *tmp; |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3010 | FILE *f; |
| 3011 | int ret; |
| 3012 | |
| 3013 | /* |
| 3014 | * No math, just return string |
| 3015 | */ |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3016 | if ((!strchr(str, '+') && !strchr(str, '-') && !strchr(str, '*') && |
| 3017 | !strchr(str, '/')) || strchr(str, '\'')) |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3018 | return str; |
| 3019 | |
| 3020 | /* |
| 3021 | * Split option from value, we only need to calculate the value |
| 3022 | */ |
| 3023 | tmp = strchr(str, '='); |
| 3024 | if (!tmp) |
| 3025 | return str; |
| 3026 | |
| 3027 | tmp++; |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3028 | |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3029 | /* |
| 3030 | * Prevent buffer overflows; such a case isn't reasonable anyway |
| 3031 | */ |
| 3032 | if (strlen(str) >= 128 || strlen(tmp) > 100) |
| 3033 | return str; |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3034 | |
| 3035 | sprintf(buf, "which %s > /dev/null", BC_APP); |
| 3036 | if (system(buf)) { |
| 3037 | log_err("fio: bc is needed for performing math\n"); |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3038 | return NULL; |
| 3039 | } |
| 3040 | |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3041 | sprintf(buf, "echo '%s' | %s", tmp, BC_APP); |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3042 | f = popen(buf, "r"); |
Jens Axboe | 3c3ed07 | 2012-03-27 09:12:39 +0200 | [diff] [blame] | 3043 | if (!f) |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3044 | return NULL; |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3045 | |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3046 | ret = fread(&buf[tmp - str], 1, 128 - (tmp - str), f); |
Jens Axboe | 3c3ed07 | 2012-03-27 09:12:39 +0200 | [diff] [blame] | 3047 | if (ret <= 0) |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3048 | return NULL; |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3049 | |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3050 | pclose(f); |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3051 | buf[(tmp - str) + ret - 1] = '\0'; |
| 3052 | memcpy(buf, str, tmp - str); |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3053 | free(str); |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3054 | return strdup(buf); |
| 3055 | } |
| 3056 | |
| 3057 | /* |
| 3058 | * Return a copy of the input string with substrings of the form ${VARNAME} |
| 3059 | * substituted with the value of the environment variable VARNAME. The |
| 3060 | * substitution always occurs, even if VARNAME is empty or the corresponding |
| 3061 | * environment variable undefined. |
| 3062 | */ |
| 3063 | static char *option_dup_subs(const char *opt) |
| 3064 | { |
| 3065 | char out[OPT_LEN_MAX+1]; |
| 3066 | char in[OPT_LEN_MAX+1]; |
| 3067 | char *outptr = out; |
| 3068 | char *inptr = in; |
| 3069 | char *ch1, *ch2, *env; |
| 3070 | ssize_t nchr = OPT_LEN_MAX; |
| 3071 | size_t envlen; |
| 3072 | |
| 3073 | if (strlen(opt) + 1 > OPT_LEN_MAX) { |
| 3074 | log_err("OPT_LEN_MAX (%d) is too small\n", OPT_LEN_MAX); |
| 3075 | return NULL; |
| 3076 | } |
| 3077 | |
| 3078 | in[OPT_LEN_MAX] = '\0'; |
| 3079 | strncpy(in, opt, OPT_LEN_MAX); |
| 3080 | |
| 3081 | while (*inptr && nchr > 0) { |
| 3082 | if (inptr[0] == '$' && inptr[1] == '{') { |
| 3083 | ch2 = strchr(inptr, '}'); |
| 3084 | if (ch2 && inptr+1 < ch2) { |
| 3085 | ch1 = inptr+2; |
| 3086 | inptr = ch2+1; |
| 3087 | *ch2 = '\0'; |
| 3088 | |
| 3089 | env = getenv(ch1); |
| 3090 | if (env) { |
| 3091 | envlen = strlen(env); |
| 3092 | if (envlen <= nchr) { |
| 3093 | memcpy(outptr, env, envlen); |
| 3094 | outptr += envlen; |
| 3095 | nchr -= envlen; |
| 3096 | } |
| 3097 | } |
| 3098 | |
| 3099 | continue; |
| 3100 | } |
| 3101 | } |
| 3102 | |
| 3103 | *outptr++ = *inptr++; |
| 3104 | --nchr; |
| 3105 | } |
| 3106 | |
| 3107 | *outptr = '\0'; |
| 3108 | return strdup(out); |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3109 | } |
| 3110 | |
Jens Axboe | 74929ac | 2009-08-05 11:42:37 +0200 | [diff] [blame] | 3111 | /* |
| 3112 | * Look for reserved variable names and replace them with real values |
| 3113 | */ |
| 3114 | static char *fio_keyword_replace(char *opt) |
| 3115 | { |
| 3116 | char *s; |
| 3117 | int i; |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3118 | int docalc = 0; |
Jens Axboe | 74929ac | 2009-08-05 11:42:37 +0200 | [diff] [blame] | 3119 | |
| 3120 | for (i = 0; fio_keywords[i].word != NULL; i++) { |
| 3121 | struct fio_keyword *kw = &fio_keywords[i]; |
| 3122 | |
| 3123 | while ((s = strstr(opt, kw->word)) != NULL) { |
| 3124 | char *new = malloc(strlen(opt) + 1); |
| 3125 | char *o_org = opt; |
| 3126 | int olen = s - opt; |
| 3127 | int len; |
| 3128 | |
| 3129 | /* |
| 3130 | * Copy part of the string before the keyword and |
| 3131 | * sprintf() the replacement after it. |
| 3132 | */ |
| 3133 | memcpy(new, opt, olen); |
| 3134 | len = sprintf(new + olen, "%s", kw->replace); |
| 3135 | |
| 3136 | /* |
| 3137 | * If there's more in the original string, copy that |
| 3138 | * in too |
| 3139 | */ |
| 3140 | opt += strlen(kw->word) + olen; |
| 3141 | if (strlen(opt)) |
| 3142 | memcpy(new + olen + len, opt, opt - o_org - 1); |
| 3143 | |
| 3144 | /* |
| 3145 | * replace opt and free the old opt |
| 3146 | */ |
| 3147 | opt = new; |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3148 | free(o_org); |
Jens Axboe | 7a958bd | 2009-11-13 12:33:54 +0100 | [diff] [blame] | 3149 | |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3150 | docalc = 1; |
Jens Axboe | 74929ac | 2009-08-05 11:42:37 +0200 | [diff] [blame] | 3151 | } |
| 3152 | } |
| 3153 | |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3154 | /* |
| 3155 | * Check for potential math and invoke bc, if possible |
| 3156 | */ |
| 3157 | if (docalc) |
| 3158 | opt = bc_calc(opt); |
| 3159 | |
Jens Axboe | 7a958bd | 2009-11-13 12:33:54 +0100 | [diff] [blame] | 3160 | return opt; |
Jens Axboe | 74929ac | 2009-08-05 11:42:37 +0200 | [diff] [blame] | 3161 | } |
| 3162 | |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3163 | static char **dup_and_sub_options(char **opts, int num_opts) |
| 3164 | { |
| 3165 | int i; |
| 3166 | char **opts_copy = malloc(num_opts * sizeof(*opts)); |
| 3167 | for (i = 0; i < num_opts; i++) { |
| 3168 | opts_copy[i] = option_dup_subs(opts[i]); |
| 3169 | if (!opts_copy[i]) |
| 3170 | continue; |
| 3171 | opts_copy[i] = fio_keyword_replace(opts_copy[i]); |
| 3172 | } |
| 3173 | return opts_copy; |
| 3174 | } |
| 3175 | |
Jens Axboe | 3b8b713 | 2008-06-10 19:46:23 +0200 | [diff] [blame] | 3176 | int fio_options_parse(struct thread_data *td, char **opts, int num_opts) |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3177 | { |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3178 | int i, ret, unknown; |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3179 | char **opts_copy; |
Jens Axboe | 3b8b713 | 2008-06-10 19:46:23 +0200 | [diff] [blame] | 3180 | |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 3181 | sort_options(opts, fio_options, num_opts); |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3182 | opts_copy = dup_and_sub_options(opts, num_opts); |
Jens Axboe | 3b8b713 | 2008-06-10 19:46:23 +0200 | [diff] [blame] | 3183 | |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3184 | for (ret = 0, i = 0, unknown = 0; i < num_opts; i++) { |
| 3185 | struct fio_option *o; |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 3186 | int newret = parse_option(opts_copy[i], opts[i], fio_options, |
| 3187 | &o, td); |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3188 | |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3189 | if (opts_copy[i]) { |
| 3190 | if (newret && !o) { |
| 3191 | unknown++; |
| 3192 | continue; |
| 3193 | } |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3194 | free(opts_copy[i]); |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3195 | opts_copy[i] = NULL; |
| 3196 | } |
| 3197 | |
| 3198 | ret |= newret; |
| 3199 | } |
| 3200 | |
| 3201 | if (unknown) { |
| 3202 | ret |= ioengine_load(td); |
| 3203 | if (td->eo) { |
| 3204 | sort_options(opts_copy, td->io_ops->options, num_opts); |
| 3205 | opts = opts_copy; |
| 3206 | } |
| 3207 | for (i = 0; i < num_opts; i++) { |
| 3208 | struct fio_option *o = NULL; |
| 3209 | int newret = 1; |
| 3210 | if (!opts_copy[i]) |
| 3211 | continue; |
| 3212 | |
| 3213 | if (td->eo) |
| 3214 | newret = parse_option(opts_copy[i], opts[i], |
| 3215 | td->io_ops->options, &o, |
| 3216 | td->eo); |
| 3217 | |
| 3218 | ret |= newret; |
| 3219 | if (!o) |
| 3220 | log_err("Bad option <%s>\n", opts[i]); |
| 3221 | |
| 3222 | free(opts_copy[i]); |
| 3223 | opts_copy[i] = NULL; |
| 3224 | } |
Jens Axboe | 74929ac | 2009-08-05 11:42:37 +0200 | [diff] [blame] | 3225 | } |
Jens Axboe | 3b8b713 | 2008-06-10 19:46:23 +0200 | [diff] [blame] | 3226 | |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3227 | free(opts_copy); |
Jens Axboe | 3b8b713 | 2008-06-10 19:46:23 +0200 | [diff] [blame] | 3228 | return ret; |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3229 | } |
| 3230 | |
| 3231 | int fio_cmd_option_parse(struct thread_data *td, const char *opt, char *val) |
| 3232 | { |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 3233 | return parse_cmd_option(opt, val, fio_options, td); |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3234 | } |
| 3235 | |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3236 | int fio_cmd_ioengine_option_parse(struct thread_data *td, const char *opt, |
| 3237 | char *val) |
| 3238 | { |
| 3239 | return parse_cmd_option(opt, val, td->io_ops->options, td); |
| 3240 | } |
| 3241 | |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3242 | void fio_fill_default_options(struct thread_data *td) |
| 3243 | { |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 3244 | fill_default_options(td, fio_options); |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3245 | } |
| 3246 | |
| 3247 | int fio_show_option_help(const char *opt) |
| 3248 | { |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 3249 | return show_cmd_help(fio_options, opt); |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3250 | } |
Jens Axboe | d23bb32 | 2007-03-23 15:57:56 +0100 | [diff] [blame] | 3251 | |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3252 | void options_mem_dupe(void *data, struct fio_option *options) |
| 3253 | { |
| 3254 | struct fio_option *o; |
| 3255 | char **ptr; |
| 3256 | |
| 3257 | for (o = &options[0]; o->name; o++) { |
| 3258 | if (o->type != FIO_OPT_STR_STORE) |
| 3259 | continue; |
| 3260 | |
| 3261 | ptr = td_var(data, o->off1); |
| 3262 | if (*ptr) |
| 3263 | *ptr = strdup(*ptr); |
| 3264 | } |
| 3265 | } |
| 3266 | |
Jens Axboe | 7e356b2 | 2011-10-14 10:55:16 +0200 | [diff] [blame] | 3267 | /* |
| 3268 | * dupe FIO_OPT_STR_STORE options |
| 3269 | */ |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3270 | void fio_options_mem_dupe(struct thread_data *td) |
Jens Axboe | d23bb32 | 2007-03-23 15:57:56 +0100 | [diff] [blame] | 3271 | { |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 3272 | options_mem_dupe(&td->o, fio_options); |
Jens Axboe | 1647f59 | 2011-11-09 20:25:21 +0100 | [diff] [blame] | 3273 | |
| 3274 | if (td->eo && td->io_ops) { |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3275 | void *oldeo = td->eo; |
Jens Axboe | 1647f59 | 2011-11-09 20:25:21 +0100 | [diff] [blame] | 3276 | |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3277 | td->eo = malloc(td->io_ops->option_struct_size); |
| 3278 | memcpy(td->eo, oldeo, td->io_ops->option_struct_size); |
| 3279 | options_mem_dupe(td->eo, td->io_ops->options); |
Jens Axboe | d23bb32 | 2007-03-23 15:57:56 +0100 | [diff] [blame] | 3280 | } |
| 3281 | } |
| 3282 | |
Jens Axboe | d6978a3 | 2009-07-18 21:04:09 +0200 | [diff] [blame] | 3283 | unsigned int fio_get_kb_base(void *data) |
| 3284 | { |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 3285 | struct thread_options *o = data; |
Jens Axboe | d6978a3 | 2009-07-18 21:04:09 +0200 | [diff] [blame] | 3286 | unsigned int kb_base = 0; |
| 3287 | |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 3288 | if (o) |
| 3289 | kb_base = o->kb_base; |
Jens Axboe | d6978a3 | 2009-07-18 21:04:09 +0200 | [diff] [blame] | 3290 | if (!kb_base) |
| 3291 | kb_base = 1024; |
| 3292 | |
| 3293 | return kb_base; |
| 3294 | } |
Jens Axboe | 9f988e2 | 2010-03-04 10:42:38 +0100 | [diff] [blame] | 3295 | |
Jens Axboe | 07b3232 | 2010-03-05 09:48:44 +0100 | [diff] [blame] | 3296 | int add_option(struct fio_option *o) |
Jens Axboe | 9f988e2 | 2010-03-04 10:42:38 +0100 | [diff] [blame] | 3297 | { |
Jens Axboe | 07b3232 | 2010-03-05 09:48:44 +0100 | [diff] [blame] | 3298 | struct fio_option *__o; |
| 3299 | int opt_index = 0; |
| 3300 | |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 3301 | __o = fio_options; |
Jens Axboe | 07b3232 | 2010-03-05 09:48:44 +0100 | [diff] [blame] | 3302 | while (__o->name) { |
| 3303 | opt_index++; |
| 3304 | __o++; |
| 3305 | } |
| 3306 | |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 3307 | memcpy(&fio_options[opt_index], o, sizeof(*o)); |
Jens Axboe | 07b3232 | 2010-03-05 09:48:44 +0100 | [diff] [blame] | 3308 | return 0; |
Jens Axboe | 9f988e2 | 2010-03-04 10:42:38 +0100 | [diff] [blame] | 3309 | } |
Jens Axboe | e2de69d | 2010-03-04 14:05:48 +0100 | [diff] [blame] | 3310 | |
Jens Axboe | 07b3232 | 2010-03-05 09:48:44 +0100 | [diff] [blame] | 3311 | void invalidate_profile_options(const char *prof_name) |
Jens Axboe | e2de69d | 2010-03-04 14:05:48 +0100 | [diff] [blame] | 3312 | { |
Jens Axboe | 07b3232 | 2010-03-05 09:48:44 +0100 | [diff] [blame] | 3313 | struct fio_option *o; |
Jens Axboe | e2de69d | 2010-03-04 14:05:48 +0100 | [diff] [blame] | 3314 | |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 3315 | o = fio_options; |
Jens Axboe | 07b3232 | 2010-03-05 09:48:44 +0100 | [diff] [blame] | 3316 | while (o->name) { |
| 3317 | if (o->prof_name && !strcmp(o->prof_name, prof_name)) { |
| 3318 | o->type = FIO_OPT_INVALID; |
| 3319 | o->prof_name = NULL; |
| 3320 | } |
| 3321 | o++; |
Jens Axboe | e2de69d | 2010-03-04 14:05:48 +0100 | [diff] [blame] | 3322 | } |
| 3323 | } |
Jens Axboe | f5b6bb8 | 2010-03-05 10:09:59 +0100 | [diff] [blame] | 3324 | |
| 3325 | void add_opt_posval(const char *optname, const char *ival, const char *help) |
| 3326 | { |
| 3327 | struct fio_option *o; |
| 3328 | unsigned int i; |
| 3329 | |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 3330 | o = find_option(fio_options, optname); |
Jens Axboe | f5b6bb8 | 2010-03-05 10:09:59 +0100 | [diff] [blame] | 3331 | if (!o) |
| 3332 | return; |
| 3333 | |
| 3334 | for (i = 0; i < PARSE_MAX_VP; i++) { |
| 3335 | if (o->posval[i].ival) |
| 3336 | continue; |
| 3337 | |
| 3338 | o->posval[i].ival = ival; |
| 3339 | o->posval[i].help = help; |
| 3340 | break; |
| 3341 | } |
| 3342 | } |
| 3343 | |
| 3344 | void del_opt_posval(const char *optname, const char *ival) |
| 3345 | { |
| 3346 | struct fio_option *o; |
| 3347 | unsigned int i; |
| 3348 | |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 3349 | o = find_option(fio_options, optname); |
Jens Axboe | f5b6bb8 | 2010-03-05 10:09:59 +0100 | [diff] [blame] | 3350 | if (!o) |
| 3351 | return; |
| 3352 | |
| 3353 | for (i = 0; i < PARSE_MAX_VP; i++) { |
| 3354 | if (!o->posval[i].ival) |
| 3355 | continue; |
| 3356 | if (strcmp(o->posval[i].ival, ival)) |
| 3357 | continue; |
| 3358 | |
| 3359 | o->posval[i].ival = NULL; |
| 3360 | o->posval[i].help = NULL; |
| 3361 | } |
| 3362 | } |
Jens Axboe | 7e356b2 | 2011-10-14 10:55:16 +0200 | [diff] [blame] | 3363 | |
| 3364 | void fio_options_free(struct thread_data *td) |
| 3365 | { |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 3366 | options_free(fio_options, td); |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3367 | if (td->eo && td->io_ops && td->io_ops->options) { |
| 3368 | options_free(td->io_ops->options, td->eo); |
| 3369 | free(td->eo); |
| 3370 | td->eo = NULL; |
| 3371 | } |
Jens Axboe | 7e356b2 | 2011-10-14 10:55:16 +0200 | [diff] [blame] | 3372 | } |
Jens Axboe | c504ee5 | 2012-03-20 11:29:09 +0100 | [diff] [blame] | 3373 | |
| 3374 | struct fio_option *fio_option_find(const char *name) |
| 3375 | { |
| 3376 | return find_option(fio_options, name); |
| 3377 | } |
| 3378 | |