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 | 0de5b26 | 2014-02-21 15:26:01 -0800 | [diff] [blame] | 105 | if (str_to_decimal(fname, &val, 1, o, 0)) { |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 106 | log_err("fio: bssplit conversion failed\n"); |
Hong Zhiguo | d8b97c8 | 2013-10-08 08:48:47 -0600 | [diff] [blame] | 107 | free(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 | |
Jens Axboe | 52c0cea | 2013-09-06 10:07:37 -0600 | [diff] [blame] | 171 | if (parse_dryrun()) |
| 172 | return 0; |
| 173 | |
Jens Axboe | 720e84a | 2009-04-21 08:29:55 +0200 | [diff] [blame] | 174 | p = str = strdup(input); |
| 175 | |
| 176 | strip_blank_front(&str); |
| 177 | strip_blank_end(str); |
| 178 | |
| 179 | odir = strchr(str, ','); |
| 180 | if (odir) { |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 181 | ddir = strchr(odir + 1, ','); |
| 182 | if (ddir) { |
Jens Axboe | d79db12 | 2012-09-24 08:51:24 +0200 | [diff] [blame] | 183 | ret = bssplit_ddir(&td->o, DDIR_TRIM, ddir + 1); |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 184 | if (!ret) |
| 185 | *ddir = '\0'; |
| 186 | } else { |
| 187 | char *op; |
| 188 | |
| 189 | op = strdup(odir + 1); |
Jens Axboe | d79db12 | 2012-09-24 08:51:24 +0200 | [diff] [blame] | 190 | ret = bssplit_ddir(&td->o, DDIR_TRIM, op); |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 191 | |
| 192 | free(op); |
| 193 | } |
Jens Axboe | d79db12 | 2012-09-24 08:51:24 +0200 | [diff] [blame] | 194 | if (!ret) |
| 195 | ret = bssplit_ddir(&td->o, DDIR_WRITE, odir + 1); |
Jens Axboe | 720e84a | 2009-04-21 08:29:55 +0200 | [diff] [blame] | 196 | if (!ret) { |
| 197 | *odir = '\0'; |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 198 | ret = bssplit_ddir(&td->o, DDIR_READ, str); |
Jens Axboe | 720e84a | 2009-04-21 08:29:55 +0200 | [diff] [blame] | 199 | } |
| 200 | } else { |
| 201 | char *op; |
| 202 | |
| 203 | op = strdup(str); |
Jens Axboe | d79db12 | 2012-09-24 08:51:24 +0200 | [diff] [blame] | 204 | ret = bssplit_ddir(&td->o, DDIR_WRITE, op); |
Jens Axboe | 720e84a | 2009-04-21 08:29:55 +0200 | [diff] [blame] | 205 | free(op); |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 206 | |
| 207 | if (!ret) { |
| 208 | op = strdup(str); |
Jens Axboe | d79db12 | 2012-09-24 08:51:24 +0200 | [diff] [blame] | 209 | ret = bssplit_ddir(&td->o, DDIR_TRIM, op); |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 210 | free(op); |
| 211 | } |
Jens Axboe | d79db12 | 2012-09-24 08:51:24 +0200 | [diff] [blame] | 212 | ret = bssplit_ddir(&td->o, DDIR_READ, str); |
Jens Axboe | 720e84a | 2009-04-21 08:29:55 +0200 | [diff] [blame] | 213 | } |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 214 | |
| 215 | free(p); |
Jens Axboe | 720e84a | 2009-04-21 08:29:55 +0200 | [diff] [blame] | 216 | return ret; |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 217 | } |
| 218 | |
Dmitry Monakhov | 8b28bd4 | 2012-09-23 15:46:09 +0400 | [diff] [blame] | 219 | static int str2error(char *str) |
| 220 | { |
Jens Axboe | a94eb99 | 2012-09-24 18:46:34 +0200 | [diff] [blame] | 221 | const char *err[] = { "EPERM", "ENOENT", "ESRCH", "EINTR", "EIO", |
Dmitry Monakhov | 8b28bd4 | 2012-09-23 15:46:09 +0400 | [diff] [blame] | 222 | "ENXIO", "E2BIG", "ENOEXEC", "EBADF", |
| 223 | "ECHILD", "EAGAIN", "ENOMEM", "EACCES", |
| 224 | "EFAULT", "ENOTBLK", "EBUSY", "EEXIST", |
| 225 | "EXDEV", "ENODEV", "ENOTDIR", "EISDIR", |
| 226 | "EINVAL", "ENFILE", "EMFILE", "ENOTTY", |
| 227 | "ETXTBSY","EFBIG", "ENOSPC", "ESPIPE", |
Jens Axboe | a94eb99 | 2012-09-24 18:46:34 +0200 | [diff] [blame] | 228 | "EROFS","EMLINK", "EPIPE", "EDOM", "ERANGE" }; |
Dmitry Monakhov | 8b28bd4 | 2012-09-23 15:46:09 +0400 | [diff] [blame] | 229 | int i = 0, num = sizeof(err) / sizeof(void *); |
| 230 | |
Jens Axboe | a94eb99 | 2012-09-24 18:46:34 +0200 | [diff] [blame] | 231 | while (i < num) { |
Dmitry Monakhov | 8b28bd4 | 2012-09-23 15:46:09 +0400 | [diff] [blame] | 232 | if (!strcmp(err[i], str)) |
| 233 | return i + 1; |
| 234 | i++; |
| 235 | } |
| 236 | return 0; |
| 237 | } |
| 238 | |
| 239 | static int ignore_error_type(struct thread_data *td, int etype, char *str) |
| 240 | { |
| 241 | unsigned int i; |
| 242 | int *error; |
| 243 | char *fname; |
| 244 | |
| 245 | if (etype >= ERROR_TYPE_CNT) { |
| 246 | log_err("Illegal error type\n"); |
| 247 | return 1; |
| 248 | } |
| 249 | |
| 250 | td->o.ignore_error_nr[etype] = 4; |
| 251 | error = malloc(4 * sizeof(struct bssplit)); |
| 252 | |
| 253 | i = 0; |
| 254 | while ((fname = strsep(&str, ":")) != NULL) { |
| 255 | |
| 256 | if (!strlen(fname)) |
| 257 | break; |
| 258 | |
| 259 | /* |
| 260 | * grow struct buffer, if needed |
| 261 | */ |
| 262 | if (i == td->o.ignore_error_nr[etype]) { |
| 263 | td->o.ignore_error_nr[etype] <<= 1; |
| 264 | error = realloc(error, td->o.ignore_error_nr[etype] |
| 265 | * sizeof(int)); |
| 266 | } |
| 267 | if (fname[0] == 'E') { |
| 268 | error[i] = str2error(fname); |
| 269 | } else { |
| 270 | error[i] = atoi(fname); |
| 271 | if (error[i] < 0) |
Jens Axboe | 1616e02 | 2014-04-14 08:59:17 -0600 | [diff] [blame] | 272 | error[i] = -error[i]; |
Dmitry Monakhov | 8b28bd4 | 2012-09-23 15:46:09 +0400 | [diff] [blame] | 273 | } |
| 274 | if (!error[i]) { |
| 275 | log_err("Unknown error %s, please use number value \n", |
| 276 | fname); |
Erwan Velu | 0fddbf7 | 2013-07-22 23:46:10 +0200 | [diff] [blame] | 277 | free(error); |
Dmitry Monakhov | 8b28bd4 | 2012-09-23 15:46:09 +0400 | [diff] [blame] | 278 | return 1; |
| 279 | } |
| 280 | i++; |
| 281 | } |
| 282 | if (i) { |
| 283 | td->o.continue_on_error |= 1 << etype; |
| 284 | td->o.ignore_error_nr[etype] = i; |
| 285 | td->o.ignore_error[etype] = error; |
Jens Axboe | c7b086b | 2014-04-11 11:20:29 -0600 | [diff] [blame] | 286 | } else |
| 287 | free(error); |
| 288 | |
Dmitry Monakhov | 8b28bd4 | 2012-09-23 15:46:09 +0400 | [diff] [blame] | 289 | return 0; |
| 290 | |
| 291 | } |
| 292 | |
| 293 | static int str_ignore_error_cb(void *data, const char *input) |
| 294 | { |
| 295 | struct thread_data *td = data; |
| 296 | char *str, *p, *n; |
| 297 | int type = 0, ret = 1; |
Jens Axboe | 52c0cea | 2013-09-06 10:07:37 -0600 | [diff] [blame] | 298 | |
| 299 | if (parse_dryrun()) |
| 300 | return 0; |
| 301 | |
Dmitry Monakhov | 8b28bd4 | 2012-09-23 15:46:09 +0400 | [diff] [blame] | 302 | p = str = strdup(input); |
| 303 | |
| 304 | strip_blank_front(&str); |
| 305 | strip_blank_end(str); |
| 306 | |
| 307 | while (p) { |
| 308 | n = strchr(p, ','); |
| 309 | if (n) |
| 310 | *n++ = '\0'; |
| 311 | ret = ignore_error_type(td, type, p); |
| 312 | if (ret) |
| 313 | break; |
| 314 | p = n; |
| 315 | type++; |
| 316 | } |
| 317 | free(str); |
| 318 | return ret; |
| 319 | } |
| 320 | |
Jens Axboe | 211097b | 2007-03-22 18:56:45 +0100 | [diff] [blame] | 321 | static int str_rw_cb(void *data, const char *str) |
| 322 | { |
| 323 | struct thread_data *td = data; |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 324 | struct thread_options *o = &td->o; |
Jens Axboe | 27ca949 | 2014-04-11 11:25:32 -0600 | [diff] [blame] | 325 | char *nr; |
Jens Axboe | 211097b | 2007-03-22 18:56:45 +0100 | [diff] [blame] | 326 | |
Jens Axboe | 52c0cea | 2013-09-06 10:07:37 -0600 | [diff] [blame] | 327 | if (parse_dryrun()) |
| 328 | return 0; |
| 329 | |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 330 | o->ddir_seq_nr = 1; |
| 331 | o->ddir_seq_add = 0; |
Jens Axboe | 059b080 | 2011-08-25 09:09:37 +0200 | [diff] [blame] | 332 | |
Jens Axboe | 27ca949 | 2014-04-11 11:25:32 -0600 | [diff] [blame] | 333 | nr = get_opt_postfix(str); |
Jens Axboe | 059b080 | 2011-08-25 09:09:37 +0200 | [diff] [blame] | 334 | if (!nr) |
| 335 | return 0; |
| 336 | |
| 337 | if (td_random(td)) |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 338 | o->ddir_seq_nr = atoi(nr); |
Jens Axboe | 059b080 | 2011-08-25 09:09:37 +0200 | [diff] [blame] | 339 | else { |
| 340 | long long val; |
| 341 | |
Jens Axboe | 0de5b26 | 2014-02-21 15:26:01 -0800 | [diff] [blame] | 342 | if (str_to_decimal(nr, &val, 1, o, 0)) { |
Jens Axboe | 059b080 | 2011-08-25 09:09:37 +0200 | [diff] [blame] | 343 | log_err("fio: rw postfix parsing failed\n"); |
| 344 | free(nr); |
| 345 | return 1; |
| 346 | } |
| 347 | |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 348 | o->ddir_seq_add = val; |
Jens Axboe | 182ec6e | 2008-11-14 13:06:06 +0100 | [diff] [blame] | 349 | } |
Jens Axboe | 211097b | 2007-03-22 18:56:45 +0100 | [diff] [blame] | 350 | |
Jens Axboe | 059b080 | 2011-08-25 09:09:37 +0200 | [diff] [blame] | 351 | free(nr); |
Jens Axboe | 211097b | 2007-03-22 18:56:45 +0100 | [diff] [blame] | 352 | return 0; |
| 353 | } |
| 354 | |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 355 | static int str_mem_cb(void *data, const char *mem) |
| 356 | { |
| 357 | struct thread_data *td = data; |
| 358 | |
Shaohua Li | d9759b1 | 2013-01-17 13:28:15 +0100 | [diff] [blame] | 359 | if (td->o.mem_type == MEM_MMAPHUGE || td->o.mem_type == MEM_MMAP) |
Jens Axboe | 836fcc0 | 2013-01-24 09:08:45 -0700 | [diff] [blame] | 360 | td->o.mmapfile = get_opt_postfix(mem); |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 361 | |
| 362 | return 0; |
| 363 | } |
| 364 | |
Jens Axboe | c223da8 | 2010-03-24 13:23:53 +0100 | [diff] [blame] | 365 | static int fio_clock_source_cb(void *data, const char *str) |
| 366 | { |
| 367 | struct thread_data *td = data; |
| 368 | |
| 369 | fio_clock_source = td->o.clocksource; |
Jens Axboe | fa80fea | 2012-12-09 20:29:00 +0100 | [diff] [blame] | 370 | fio_clock_source_set = 1; |
Jens Axboe | 01423ea | 2012-12-14 20:37:06 +0100 | [diff] [blame] | 371 | fio_clock_init(); |
Jens Axboe | c223da8 | 2010-03-24 13:23:53 +0100 | [diff] [blame] | 372 | return 0; |
| 373 | } |
| 374 | |
Cigy Cyriac | 85bc833 | 2010-08-10 19:21:09 -0400 | [diff] [blame] | 375 | static int str_rwmix_read_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_READ] = *val; |
| 380 | td->o.rwmix[DDIR_WRITE] = 100 - *val; |
| 381 | return 0; |
| 382 | } |
| 383 | |
Cigy Cyriac | 85bc833 | 2010-08-10 19:21:09 -0400 | [diff] [blame] | 384 | static int str_rwmix_write_cb(void *data, unsigned long long *val) |
Jens Axboe | cb499fc | 2008-05-28 10:33:32 +0200 | [diff] [blame] | 385 | { |
| 386 | struct thread_data *td = data; |
| 387 | |
| 388 | td->o.rwmix[DDIR_WRITE] = *val; |
| 389 | td->o.rwmix[DDIR_READ] = 100 - *val; |
| 390 | return 0; |
| 391 | } |
| 392 | |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 393 | static int str_exitall_cb(void) |
| 394 | { |
| 395 | exitall_on_terminate = 1; |
| 396 | return 0; |
| 397 | } |
| 398 | |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 399 | #ifdef FIO_HAVE_CPU_AFFINITY |
Jens Axboe | 50b5860 | 2014-02-28 15:08:25 -0800 | [diff] [blame] | 400 | int fio_cpus_split(os_cpu_mask_t *mask, unsigned int cpu_index) |
Jens Axboe | c2acfba | 2014-02-27 15:52:02 -0800 | [diff] [blame] | 401 | { |
Jens Axboe | 50b5860 | 2014-02-28 15:08:25 -0800 | [diff] [blame] | 402 | unsigned int i, index, cpus_in_mask; |
Jens Axboe | c2acfba | 2014-02-27 15:52:02 -0800 | [diff] [blame] | 403 | const long max_cpu = cpus_online(); |
Jens Axboe | c2acfba | 2014-02-27 15:52:02 -0800 | [diff] [blame] | 404 | |
Jens Axboe | 50b5860 | 2014-02-28 15:08:25 -0800 | [diff] [blame] | 405 | cpus_in_mask = fio_cpu_count(mask); |
| 406 | cpu_index = cpu_index % cpus_in_mask; |
| 407 | |
| 408 | index = 0; |
Jens Axboe | c2acfba | 2014-02-27 15:52:02 -0800 | [diff] [blame] | 409 | for (i = 0; i < max_cpu; i++) { |
Jens Axboe | 50b5860 | 2014-02-28 15:08:25 -0800 | [diff] [blame] | 410 | if (!fio_cpu_isset(mask, i)) |
Jens Axboe | c2acfba | 2014-02-27 15:52:02 -0800 | [diff] [blame] | 411 | continue; |
Jens Axboe | 50b5860 | 2014-02-28 15:08:25 -0800 | [diff] [blame] | 412 | |
| 413 | if (cpu_index != index) |
| 414 | fio_cpu_clear(mask, i); |
| 415 | |
| 416 | index++; |
Jens Axboe | c2acfba | 2014-02-27 15:52:02 -0800 | [diff] [blame] | 417 | } |
| 418 | |
| 419 | return fio_cpu_count(mask); |
| 420 | } |
| 421 | |
Cigy Cyriac | 85bc833 | 2010-08-10 19:21:09 -0400 | [diff] [blame] | 422 | static int str_cpumask_cb(void *data, unsigned long long *val) |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 423 | { |
| 424 | struct thread_data *td = data; |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 425 | unsigned int i; |
Jens Axboe | b03daaf | 2008-12-08 20:31:43 +0100 | [diff] [blame] | 426 | long max_cpu; |
Jens Axboe | d2ce18b | 2008-12-12 20:51:40 +0100 | [diff] [blame] | 427 | int ret; |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 428 | |
Jens Axboe | 52c0cea | 2013-09-06 10:07:37 -0600 | [diff] [blame] | 429 | if (parse_dryrun()) |
| 430 | return 0; |
| 431 | |
Jens Axboe | d2ce18b | 2008-12-12 20:51:40 +0100 | [diff] [blame] | 432 | ret = fio_cpuset_init(&td->o.cpumask); |
| 433 | if (ret < 0) { |
| 434 | log_err("fio: cpuset_init failed\n"); |
| 435 | td_verror(td, ret, "fio_cpuset_init"); |
| 436 | return 1; |
| 437 | } |
| 438 | |
Jens Axboe | c00a228 | 2011-07-08 20:56:06 +0200 | [diff] [blame] | 439 | max_cpu = cpus_online(); |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 440 | |
Jens Axboe | 62a7273 | 2008-12-08 11:37:01 +0100 | [diff] [blame] | 441 | for (i = 0; i < sizeof(int) * 8; i++) { |
| 442 | if ((1 << i) & *val) { |
Jens Axboe | b03daaf | 2008-12-08 20:31:43 +0100 | [diff] [blame] | 443 | if (i > max_cpu) { |
| 444 | log_err("fio: CPU %d too large (max=%ld)\n", i, |
| 445 | max_cpu); |
| 446 | return 1; |
| 447 | } |
Jens Axboe | 62a7273 | 2008-12-08 11:37:01 +0100 | [diff] [blame] | 448 | dprint(FD_PARSE, "set cpu allowed %d\n", i); |
Jens Axboe | 6d459ee | 2008-12-12 20:02:58 +0100 | [diff] [blame] | 449 | fio_cpu_set(&td->o.cpumask, i); |
Jens Axboe | 62a7273 | 2008-12-08 11:37:01 +0100 | [diff] [blame] | 450 | } |
| 451 | } |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 452 | |
Jens Axboe | 375b269 | 2007-05-22 09:13:02 +0200 | [diff] [blame] | 453 | td->o.cpumask_set = 1; |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 454 | return 0; |
| 455 | } |
| 456 | |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 457 | static int set_cpus_allowed(struct thread_data *td, os_cpu_mask_t *mask, |
| 458 | const char *input) |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 459 | { |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 460 | char *cpu, *str, *p; |
Jens Axboe | b03daaf | 2008-12-08 20:31:43 +0100 | [diff] [blame] | 461 | long max_cpu; |
Jens Axboe | 19608d6 | 2008-12-08 15:03:12 +0100 | [diff] [blame] | 462 | int ret = 0; |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 463 | |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 464 | ret = fio_cpuset_init(mask); |
Jens Axboe | d2ce18b | 2008-12-12 20:51:40 +0100 | [diff] [blame] | 465 | if (ret < 0) { |
| 466 | log_err("fio: cpuset_init failed\n"); |
| 467 | td_verror(td, ret, "fio_cpuset_init"); |
| 468 | return 1; |
| 469 | } |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 470 | |
| 471 | p = str = strdup(input); |
| 472 | |
| 473 | strip_blank_front(&str); |
| 474 | strip_blank_end(str); |
| 475 | |
Jens Axboe | c00a228 | 2011-07-08 20:56:06 +0200 | [diff] [blame] | 476 | max_cpu = cpus_online(); |
Jens Axboe | b03daaf | 2008-12-08 20:31:43 +0100 | [diff] [blame] | 477 | |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 478 | while ((cpu = strsep(&str, ",")) != NULL) { |
Jens Axboe | 62a7273 | 2008-12-08 11:37:01 +0100 | [diff] [blame] | 479 | char *str2, *cpu2; |
| 480 | int icpu, icpu2; |
| 481 | |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 482 | if (!strlen(cpu)) |
| 483 | break; |
Jens Axboe | 62a7273 | 2008-12-08 11:37:01 +0100 | [diff] [blame] | 484 | |
| 485 | str2 = cpu; |
| 486 | icpu2 = -1; |
| 487 | while ((cpu2 = strsep(&str2, "-")) != NULL) { |
| 488 | if (!strlen(cpu2)) |
| 489 | break; |
| 490 | |
| 491 | icpu2 = atoi(cpu2); |
| 492 | } |
| 493 | |
| 494 | icpu = atoi(cpu); |
| 495 | if (icpu2 == -1) |
| 496 | icpu2 = icpu; |
| 497 | while (icpu <= icpu2) { |
Jens Axboe | 6d459ee | 2008-12-12 20:02:58 +0100 | [diff] [blame] | 498 | if (icpu >= FIO_MAX_CPUS) { |
Jens Axboe | 19608d6 | 2008-12-08 15:03:12 +0100 | [diff] [blame] | 499 | log_err("fio: your OS only supports up to" |
Jens Axboe | 6d459ee | 2008-12-12 20:02:58 +0100 | [diff] [blame] | 500 | " %d CPUs\n", (int) FIO_MAX_CPUS); |
Jens Axboe | 19608d6 | 2008-12-08 15:03:12 +0100 | [diff] [blame] | 501 | ret = 1; |
| 502 | break; |
| 503 | } |
Jens Axboe | b03daaf | 2008-12-08 20:31:43 +0100 | [diff] [blame] | 504 | if (icpu > max_cpu) { |
| 505 | log_err("fio: CPU %d too large (max=%ld)\n", |
| 506 | icpu, max_cpu); |
| 507 | ret = 1; |
| 508 | break; |
| 509 | } |
Jens Axboe | 0b9d69e | 2009-09-11 22:29:54 +0200 | [diff] [blame] | 510 | |
Jens Axboe | 62a7273 | 2008-12-08 11:37:01 +0100 | [diff] [blame] | 511 | dprint(FD_PARSE, "set cpu allowed %d\n", icpu); |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 512 | fio_cpu_set(mask, icpu); |
Jens Axboe | 62a7273 | 2008-12-08 11:37:01 +0100 | [diff] [blame] | 513 | icpu++; |
| 514 | } |
Jens Axboe | 19608d6 | 2008-12-08 15:03:12 +0100 | [diff] [blame] | 515 | if (ret) |
| 516 | break; |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 517 | } |
| 518 | |
| 519 | free(p); |
Jens Axboe | 19608d6 | 2008-12-08 15:03:12 +0100 | [diff] [blame] | 520 | if (!ret) |
| 521 | td->o.cpumask_set = 1; |
| 522 | return ret; |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 523 | } |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 524 | |
| 525 | static int str_cpus_allowed_cb(void *data, const char *input) |
| 526 | { |
| 527 | struct thread_data *td = data; |
| 528 | int ret; |
| 529 | |
Jens Axboe | 52c0cea | 2013-09-06 10:07:37 -0600 | [diff] [blame] | 530 | if (parse_dryrun()) |
| 531 | return 0; |
| 532 | |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 533 | ret = set_cpus_allowed(td, &td->o.cpumask, input); |
| 534 | if (!ret) |
| 535 | td->o.cpumask_set = 1; |
| 536 | |
| 537 | return ret; |
| 538 | } |
| 539 | |
| 540 | static int str_verify_cpus_allowed_cb(void *data, const char *input) |
| 541 | { |
| 542 | struct thread_data *td = data; |
| 543 | int ret; |
| 544 | |
| 545 | ret = set_cpus_allowed(td, &td->o.verify_cpumask, input); |
| 546 | if (!ret) |
| 547 | td->o.verify_cpumask_set = 1; |
| 548 | |
| 549 | return ret; |
| 550 | } |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 551 | #endif |
| 552 | |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 553 | #ifdef CONFIG_LIBNUMA |
Yufei Ren | d0b937e | 2012-10-19 23:11:52 -0400 | [diff] [blame] | 554 | static int str_numa_cpunodes_cb(void *data, char *input) |
| 555 | { |
| 556 | struct thread_data *td = data; |
Daniel Gollub | 4352284 | 2014-05-01 17:07:49 +0200 | [diff] [blame] | 557 | struct bitmask *verify_bitmask; |
Yufei Ren | d0b937e | 2012-10-19 23:11:52 -0400 | [diff] [blame] | 558 | |
Jens Axboe | 52c0cea | 2013-09-06 10:07:37 -0600 | [diff] [blame] | 559 | if (parse_dryrun()) |
| 560 | return 0; |
| 561 | |
Yufei Ren | d0b937e | 2012-10-19 23:11:52 -0400 | [diff] [blame] | 562 | /* numa_parse_nodestring() parses a character string list |
| 563 | * of nodes into a bit mask. The bit mask is allocated by |
| 564 | * numa_allocate_nodemask(), so it should be freed by |
| 565 | * numa_free_nodemask(). |
| 566 | */ |
Daniel Gollub | 4352284 | 2014-05-01 17:07:49 +0200 | [diff] [blame] | 567 | verify_bitmask = numa_parse_nodestring(input); |
| 568 | if (verify_bitmask == NULL) { |
Yufei Ren | d0b937e | 2012-10-19 23:11:52 -0400 | [diff] [blame] | 569 | log_err("fio: numa_parse_nodestring failed\n"); |
| 570 | td_verror(td, 1, "str_numa_cpunodes_cb"); |
| 571 | return 1; |
| 572 | } |
Daniel Gollub | 4352284 | 2014-05-01 17:07:49 +0200 | [diff] [blame] | 573 | numa_free_nodemask(verify_bitmask); |
Yufei Ren | d0b937e | 2012-10-19 23:11:52 -0400 | [diff] [blame] | 574 | |
Daniel Gollub | 4352284 | 2014-05-01 17:07:49 +0200 | [diff] [blame] | 575 | td->o.numa_cpunodes = strdup(input); |
Yufei Ren | d0b937e | 2012-10-19 23:11:52 -0400 | [diff] [blame] | 576 | td->o.numa_cpumask_set = 1; |
| 577 | return 0; |
| 578 | } |
| 579 | |
| 580 | static int str_numa_mpol_cb(void *data, char *input) |
| 581 | { |
| 582 | struct thread_data *td = data; |
| 583 | const char * const policy_types[] = |
Jens Axboe | 05d6f44 | 2013-07-17 16:15:31 -0600 | [diff] [blame] | 584 | { "default", "prefer", "bind", "interleave", "local", NULL }; |
Yufei Ren | d0b937e | 2012-10-19 23:11:52 -0400 | [diff] [blame] | 585 | int i; |
Jens Axboe | 52c0cea | 2013-09-06 10:07:37 -0600 | [diff] [blame] | 586 | char *nodelist; |
Daniel Gollub | 4352284 | 2014-05-01 17:07:49 +0200 | [diff] [blame] | 587 | struct bitmask *verify_bitmask; |
Yufei Ren | d0b937e | 2012-10-19 23:11:52 -0400 | [diff] [blame] | 588 | |
Jens Axboe | 52c0cea | 2013-09-06 10:07:37 -0600 | [diff] [blame] | 589 | if (parse_dryrun()) |
| 590 | return 0; |
| 591 | |
| 592 | nodelist = strchr(input, ':'); |
Yufei Ren | d0b937e | 2012-10-19 23:11:52 -0400 | [diff] [blame] | 593 | if (nodelist) { |
| 594 | /* NUL-terminate mode */ |
| 595 | *nodelist++ = '\0'; |
| 596 | } |
| 597 | |
| 598 | for (i = 0; i <= MPOL_LOCAL; i++) { |
| 599 | if (!strcmp(input, policy_types[i])) { |
| 600 | td->o.numa_mem_mode = i; |
| 601 | break; |
| 602 | } |
| 603 | } |
| 604 | if (i > MPOL_LOCAL) { |
| 605 | log_err("fio: memory policy should be: default, prefer, bind, interleave, local\n"); |
| 606 | goto out; |
| 607 | } |
| 608 | |
| 609 | switch (td->o.numa_mem_mode) { |
| 610 | case MPOL_PREFERRED: |
| 611 | /* |
| 612 | * Insist on a nodelist of one node only |
| 613 | */ |
| 614 | if (nodelist) { |
| 615 | char *rest = nodelist; |
| 616 | while (isdigit(*rest)) |
| 617 | rest++; |
| 618 | if (*rest) { |
| 619 | log_err("fio: one node only for \'prefer\'\n"); |
| 620 | goto out; |
| 621 | } |
| 622 | } else { |
| 623 | log_err("fio: one node is needed for \'prefer\'\n"); |
| 624 | goto out; |
| 625 | } |
| 626 | break; |
| 627 | case MPOL_INTERLEAVE: |
| 628 | /* |
| 629 | * Default to online nodes with memory if no nodelist |
| 630 | */ |
| 631 | if (!nodelist) |
| 632 | nodelist = strdup("all"); |
| 633 | break; |
| 634 | case MPOL_LOCAL: |
| 635 | case MPOL_DEFAULT: |
| 636 | /* |
| 637 | * Don't allow a nodelist |
| 638 | */ |
| 639 | if (nodelist) { |
| 640 | log_err("fio: NO nodelist for \'local\'\n"); |
| 641 | goto out; |
| 642 | } |
| 643 | break; |
| 644 | case MPOL_BIND: |
| 645 | /* |
| 646 | * Insist on a nodelist |
| 647 | */ |
| 648 | if (!nodelist) { |
| 649 | log_err("fio: a nodelist is needed for \'bind\'\n"); |
| 650 | goto out; |
| 651 | } |
| 652 | break; |
| 653 | } |
| 654 | |
| 655 | |
| 656 | /* numa_parse_nodestring() parses a character string list |
| 657 | * of nodes into a bit mask. The bit mask is allocated by |
| 658 | * numa_allocate_nodemask(), so it should be freed by |
| 659 | * numa_free_nodemask(). |
| 660 | */ |
| 661 | switch (td->o.numa_mem_mode) { |
| 662 | case MPOL_PREFERRED: |
| 663 | td->o.numa_mem_prefer_node = atoi(nodelist); |
| 664 | break; |
| 665 | case MPOL_INTERLEAVE: |
| 666 | case MPOL_BIND: |
Daniel Gollub | 4352284 | 2014-05-01 17:07:49 +0200 | [diff] [blame] | 667 | verify_bitmask = numa_parse_nodestring(nodelist); |
| 668 | if (verify_bitmask == NULL) { |
Yufei Ren | d0b937e | 2012-10-19 23:11:52 -0400 | [diff] [blame] | 669 | log_err("fio: numa_parse_nodestring failed\n"); |
| 670 | td_verror(td, 1, "str_numa_memnodes_cb"); |
| 671 | return 1; |
| 672 | } |
Daniel Gollub | 4352284 | 2014-05-01 17:07:49 +0200 | [diff] [blame] | 673 | td->o.numa_memnodes = strdup(nodelist); |
| 674 | numa_free_nodemask(verify_bitmask); |
| 675 | |
Yufei Ren | d0b937e | 2012-10-19 23:11:52 -0400 | [diff] [blame] | 676 | break; |
| 677 | case MPOL_LOCAL: |
| 678 | case MPOL_DEFAULT: |
| 679 | default: |
| 680 | break; |
| 681 | } |
| 682 | |
| 683 | td->o.numa_memmask_set = 1; |
| 684 | return 0; |
| 685 | |
| 686 | out: |
| 687 | return 1; |
| 688 | } |
| 689 | #endif |
| 690 | |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 691 | static int str_fst_cb(void *data, const char *str) |
| 692 | { |
| 693 | struct thread_data *td = data; |
| 694 | char *nr = get_opt_postfix(str); |
| 695 | |
| 696 | td->file_service_nr = 1; |
Jens Axboe | 182ec6e | 2008-11-14 13:06:06 +0100 | [diff] [blame] | 697 | if (nr) { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 698 | td->file_service_nr = atoi(nr); |
Jens Axboe | 182ec6e | 2008-11-14 13:06:06 +0100 | [diff] [blame] | 699 | free(nr); |
| 700 | } |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 701 | |
| 702 | return 0; |
| 703 | } |
| 704 | |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 705 | #ifdef CONFIG_SYNC_FILE_RANGE |
Jens Axboe | 44f2969 | 2010-03-09 20:09:44 +0100 | [diff] [blame] | 706 | static int str_sfr_cb(void *data, const char *str) |
| 707 | { |
| 708 | struct thread_data *td = data; |
| 709 | char *nr = get_opt_postfix(str); |
| 710 | |
| 711 | td->sync_file_range_nr = 1; |
| 712 | if (nr) { |
| 713 | td->sync_file_range_nr = atoi(nr); |
| 714 | free(nr); |
| 715 | } |
| 716 | |
| 717 | return 0; |
| 718 | } |
Jens Axboe | 3ae0637 | 2010-03-19 19:17:15 +0100 | [diff] [blame] | 719 | #endif |
Jens Axboe | 44f2969 | 2010-03-09 20:09:44 +0100 | [diff] [blame] | 720 | |
Jens Axboe | e25839d | 2012-11-06 10:49:42 +0100 | [diff] [blame] | 721 | static int str_random_distribution_cb(void *data, const char *str) |
| 722 | { |
| 723 | struct thread_data *td = data; |
| 724 | double val; |
| 725 | char *nr; |
| 726 | |
Jens Axboe | 52c0cea | 2013-09-06 10:07:37 -0600 | [diff] [blame] | 727 | if (parse_dryrun()) |
| 728 | return 0; |
| 729 | |
Jens Axboe | 925fee3 | 2012-11-06 13:50:32 +0100 | [diff] [blame] | 730 | if (td->o.random_distribution == FIO_RAND_DIST_ZIPF) |
| 731 | val = 1.1; |
| 732 | else if (td->o.random_distribution == FIO_RAND_DIST_PARETO) |
| 733 | val = 0.2; |
| 734 | else |
Jens Axboe | e25839d | 2012-11-06 10:49:42 +0100 | [diff] [blame] | 735 | return 0; |
| 736 | |
| 737 | nr = get_opt_postfix(str); |
Jens Axboe | 925fee3 | 2012-11-06 13:50:32 +0100 | [diff] [blame] | 738 | if (nr && !str_to_float(nr, &val)) { |
Jens Axboe | e25839d | 2012-11-06 10:49:42 +0100 | [diff] [blame] | 739 | log_err("fio: random postfix parsing failed\n"); |
| 740 | free(nr); |
| 741 | return 1; |
| 742 | } |
| 743 | |
Jens Axboe | 078189c | 2012-11-07 13:47:22 +0100 | [diff] [blame] | 744 | free(nr); |
| 745 | |
Jens Axboe | 18ded91 | 2012-11-08 08:36:00 +0100 | [diff] [blame] | 746 | if (td->o.random_distribution == FIO_RAND_DIST_ZIPF) { |
| 747 | if (val == 1.00) { |
| 748 | log_err("fio: zipf theta must different than 1.0\n"); |
| 749 | return 1; |
| 750 | } |
Jens Axboe | 1e5324e | 2012-11-14 14:25:31 -0700 | [diff] [blame] | 751 | td->o.zipf_theta.u.f = val; |
Jens Axboe | 18ded91 | 2012-11-08 08:36:00 +0100 | [diff] [blame] | 752 | } else { |
Jens Axboe | 078189c | 2012-11-07 13:47:22 +0100 | [diff] [blame] | 753 | if (val <= 0.00 || val >= 1.00) { |
| 754 | log_err("fio: pareto input out of range (0 < input < 1.0)\n"); |
| 755 | return 1; |
| 756 | } |
Jens Axboe | 1e5324e | 2012-11-14 14:25:31 -0700 | [diff] [blame] | 757 | td->o.pareto_h.u.f = val; |
Jens Axboe | 078189c | 2012-11-07 13:47:22 +0100 | [diff] [blame] | 758 | } |
Jens Axboe | 925fee3 | 2012-11-06 13:50:32 +0100 | [diff] [blame] | 759 | |
Jens Axboe | e25839d | 2012-11-06 10:49:42 +0100 | [diff] [blame] | 760 | return 0; |
| 761 | } |
| 762 | |
Jens Axboe | 8e827d3 | 2009-08-04 09:51:48 +0200 | [diff] [blame] | 763 | /* |
Christian Ehrhardt | bcbfeef | 2014-02-20 09:13:06 -0800 | [diff] [blame] | 764 | * Return next name in the string. Files are separated with ':'. If the ':' |
Jens Axboe | 8e827d3 | 2009-08-04 09:51:48 +0200 | [diff] [blame] | 765 | * is escaped with a '\', then that ':' is part of the filename and does not |
| 766 | * indicate a new file. |
| 767 | */ |
Christian Ehrhardt | bcbfeef | 2014-02-20 09:13:06 -0800 | [diff] [blame] | 768 | static char *get_next_name(char **ptr) |
Jens Axboe | 8e827d3 | 2009-08-04 09:51:48 +0200 | [diff] [blame] | 769 | { |
| 770 | char *str = *ptr; |
| 771 | char *p, *start; |
| 772 | |
| 773 | if (!str || !strlen(str)) |
| 774 | return NULL; |
| 775 | |
| 776 | start = str; |
| 777 | do { |
| 778 | /* |
| 779 | * No colon, we are done |
| 780 | */ |
| 781 | p = strchr(str, ':'); |
| 782 | if (!p) { |
| 783 | *ptr = NULL; |
| 784 | break; |
| 785 | } |
| 786 | |
| 787 | /* |
| 788 | * We got a colon, but it's the first character. Skip and |
| 789 | * continue |
| 790 | */ |
| 791 | if (p == start) { |
| 792 | str = ++start; |
| 793 | continue; |
| 794 | } |
| 795 | |
| 796 | if (*(p - 1) != '\\') { |
| 797 | *p = '\0'; |
| 798 | *ptr = p + 1; |
| 799 | break; |
| 800 | } |
| 801 | |
| 802 | memmove(p - 1, p, strlen(p) + 1); |
| 803 | str = p; |
| 804 | } while (1); |
| 805 | |
| 806 | return start; |
| 807 | } |
| 808 | |
Christian Ehrhardt | bcbfeef | 2014-02-20 09:13:06 -0800 | [diff] [blame] | 809 | |
| 810 | static int get_max_name_idx(char *input) |
| 811 | { |
| 812 | unsigned int cur_idx; |
| 813 | char *str, *p; |
| 814 | |
| 815 | p = str = strdup(input); |
| 816 | for (cur_idx = 0; ; cur_idx++) |
| 817 | if (get_next_name(&str) == NULL) |
| 818 | break; |
| 819 | |
| 820 | free(p); |
| 821 | return cur_idx; |
| 822 | } |
| 823 | |
| 824 | /* |
| 825 | * Returns the directory at the index, indexes > entires will be |
| 826 | * assigned via modulo division of the index |
| 827 | */ |
| 828 | int set_name_idx(char *target, char *input, int index) |
| 829 | { |
| 830 | unsigned int cur_idx; |
| 831 | int len; |
| 832 | char *fname, *str, *p; |
| 833 | |
| 834 | p = str = strdup(input); |
| 835 | |
| 836 | index %= get_max_name_idx(input); |
| 837 | for (cur_idx = 0; cur_idx <= index; cur_idx++) |
| 838 | fname = get_next_name(&str); |
| 839 | |
| 840 | len = sprintf(target, "%s/", fname); |
| 841 | free(p); |
| 842 | |
| 843 | return len; |
| 844 | } |
| 845 | |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 846 | static int str_filename_cb(void *data, const char *input) |
| 847 | { |
| 848 | struct thread_data *td = data; |
| 849 | char *fname, *str, *p; |
| 850 | |
| 851 | p = str = strdup(input); |
| 852 | |
| 853 | strip_blank_front(&str); |
| 854 | strip_blank_end(str); |
| 855 | |
| 856 | if (!td->files_index) |
Jens Axboe | 2dc1bbe | 2007-03-15 15:01:33 +0100 | [diff] [blame] | 857 | td->o.nr_files = 0; |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 858 | |
Christian Ehrhardt | bcbfeef | 2014-02-20 09:13:06 -0800 | [diff] [blame] | 859 | while ((fname = get_next_name(&str)) != NULL) { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 860 | if (!strlen(fname)) |
| 861 | break; |
Jens Axboe | 5903e7b | 2014-02-26 13:42:13 -0800 | [diff] [blame] | 862 | add_file(td, fname, 0, 1); |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 863 | } |
| 864 | |
| 865 | free(p); |
| 866 | return 0; |
| 867 | } |
| 868 | |
Christian Ehrhardt | bcbfeef | 2014-02-20 09:13:06 -0800 | [diff] [blame] | 869 | static int str_directory_cb(void *data, const char fio_unused *unused) |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 870 | { |
| 871 | struct thread_data *td = data; |
| 872 | struct stat sb; |
Christian Ehrhardt | bcbfeef | 2014-02-20 09:13:06 -0800 | [diff] [blame] | 873 | char *dirname, *str, *p; |
| 874 | int ret = 0; |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 875 | |
Jens Axboe | f9633d7 | 2013-09-06 09:59:56 -0600 | [diff] [blame] | 876 | if (parse_dryrun()) |
| 877 | return 0; |
| 878 | |
Christian Ehrhardt | bcbfeef | 2014-02-20 09:13:06 -0800 | [diff] [blame] | 879 | p = str = strdup(td->o.directory); |
| 880 | while ((dirname = get_next_name(&str)) != NULL) { |
| 881 | if (lstat(dirname, &sb) < 0) { |
| 882 | ret = errno; |
Jens Axboe | 921c766 | 2008-03-26 09:17:55 +0100 | [diff] [blame] | 883 | |
Christian Ehrhardt | bcbfeef | 2014-02-20 09:13:06 -0800 | [diff] [blame] | 884 | log_err("fio: %s is not a directory\n", dirname); |
| 885 | td_verror(td, ret, "lstat"); |
| 886 | goto out; |
| 887 | } |
| 888 | if (!S_ISDIR(sb.st_mode)) { |
| 889 | log_err("fio: %s is not a directory\n", dirname); |
| 890 | ret = 1; |
| 891 | goto out; |
| 892 | } |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 893 | } |
| 894 | |
Christian Ehrhardt | bcbfeef | 2014-02-20 09:13:06 -0800 | [diff] [blame] | 895 | out: |
| 896 | free(p); |
| 897 | return ret; |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 898 | } |
| 899 | |
Jens Axboe | f2a2803 | 2014-02-11 09:12:06 -0700 | [diff] [blame] | 900 | static int str_lockfile_cb(void *data, const char fio_unused *str) |
| 901 | { |
| 902 | struct thread_data *td = data; |
| 903 | |
| 904 | if (td->files_index) { |
| 905 | log_err("fio: lockfile= option must precede filename=\n"); |
| 906 | return 1; |
| 907 | } |
| 908 | |
| 909 | return 0; |
| 910 | } |
| 911 | |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 912 | static int str_opendir_cb(void *data, const char fio_unused *str) |
| 913 | { |
| 914 | struct thread_data *td = data; |
| 915 | |
Jens Axboe | 52c0cea | 2013-09-06 10:07:37 -0600 | [diff] [blame] | 916 | if (parse_dryrun()) |
| 917 | return 0; |
| 918 | |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 919 | if (!td->files_index) |
Jens Axboe | 2dc1bbe | 2007-03-15 15:01:33 +0100 | [diff] [blame] | 920 | td->o.nr_files = 0; |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 921 | |
Jens Axboe | 2dc1bbe | 2007-03-15 15:01:33 +0100 | [diff] [blame] | 922 | return add_dir_files(td, td->o.opendir); |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 923 | } |
| 924 | |
Jens Axboe | ce35b1e | 2014-01-14 15:35:58 -0700 | [diff] [blame] | 925 | static int pattern_cb(char *pattern, unsigned int max_size, |
| 926 | const char *input, unsigned int *pattern_bytes) |
Jens Axboe | 90059d6 | 2007-07-30 09:33:12 +0200 | [diff] [blame] | 927 | { |
Radha Ramachandran | 0e92f87 | 2009-10-27 20:14:27 +0100 | [diff] [blame] | 928 | long off; |
Jens Axboe | ce35b1e | 2014-01-14 15:35:58 -0700 | [diff] [blame] | 929 | int i = 0, j = 0, len, k, base = 10; |
| 930 | uint32_t pattern_length; |
Jens Axboe | 3c3ed07 | 2012-03-27 09:12:39 +0200 | [diff] [blame] | 931 | char *loc1, *loc2; |
Jens Axboe | 90059d6 | 2007-07-30 09:33:12 +0200 | [diff] [blame] | 932 | |
Radha Ramachandran | 0e92f87 | 2009-10-27 20:14:27 +0100 | [diff] [blame] | 933 | loc1 = strstr(input, "0x"); |
| 934 | loc2 = strstr(input, "0X"); |
| 935 | if (loc1 || loc2) |
| 936 | base = 16; |
| 937 | off = strtol(input, NULL, base); |
| 938 | if (off != LONG_MAX || errno != ERANGE) { |
| 939 | while (off) { |
Jens Axboe | ce35b1e | 2014-01-14 15:35:58 -0700 | [diff] [blame] | 940 | pattern[i] = off & 0xff; |
Radha Ramachandran | 0e92f87 | 2009-10-27 20:14:27 +0100 | [diff] [blame] | 941 | off >>= 8; |
| 942 | i++; |
| 943 | } |
| 944 | } else { |
| 945 | len = strlen(input); |
| 946 | k = len - 1; |
| 947 | if (base == 16) { |
| 948 | if (loc1) |
| 949 | j = loc1 - input + 2; |
| 950 | else |
| 951 | j = loc2 - input + 2; |
| 952 | } else |
| 953 | return 1; |
Jens Axboe | ce35b1e | 2014-01-14 15:35:58 -0700 | [diff] [blame] | 954 | if (len - j < max_size * 2) { |
Radha Ramachandran | 0e92f87 | 2009-10-27 20:14:27 +0100 | [diff] [blame] | 955 | while (k >= j) { |
| 956 | off = converthexchartoint(input[k--]); |
| 957 | if (k >= j) |
| 958 | off += (converthexchartoint(input[k--]) |
| 959 | * 16); |
Jens Axboe | ce35b1e | 2014-01-14 15:35:58 -0700 | [diff] [blame] | 960 | pattern[i++] = (char) off; |
Radha Ramachandran | 0e92f87 | 2009-10-27 20:14:27 +0100 | [diff] [blame] | 961 | } |
| 962 | } |
| 963 | } |
Steven Lang | efcd9dc | 2012-02-02 20:22:04 +0100 | [diff] [blame] | 964 | |
| 965 | /* |
| 966 | * Fill the pattern all the way to the end. This greatly reduces |
| 967 | * the number of memcpy's we have to do when verifying the IO. |
| 968 | */ |
Jens Axboe | e078de4 | 2013-04-24 23:07:17 -0600 | [diff] [blame] | 969 | pattern_length = i; |
Jens Axboe | ce35b1e | 2014-01-14 15:35:58 -0700 | [diff] [blame] | 970 | while (i > 1 && i * 2 <= max_size) { |
| 971 | memcpy(&pattern[i], &pattern[0], i); |
Steven Lang | efcd9dc | 2012-02-02 20:22:04 +0100 | [diff] [blame] | 972 | i *= 2; |
| 973 | } |
Jens Axboe | e078de4 | 2013-04-24 23:07:17 -0600 | [diff] [blame] | 974 | |
| 975 | /* |
| 976 | * Fill remainder, if the pattern multiple ends up not being |
Jens Axboe | ce35b1e | 2014-01-14 15:35:58 -0700 | [diff] [blame] | 977 | * max_size. |
Jens Axboe | e078de4 | 2013-04-24 23:07:17 -0600 | [diff] [blame] | 978 | */ |
Jens Axboe | ce35b1e | 2014-01-14 15:35:58 -0700 | [diff] [blame] | 979 | while (i > 1 && i < max_size) { |
| 980 | unsigned int b = min(pattern_length, max_size - i); |
Jens Axboe | e078de4 | 2013-04-24 23:07:17 -0600 | [diff] [blame] | 981 | |
Jens Axboe | ce35b1e | 2014-01-14 15:35:58 -0700 | [diff] [blame] | 982 | memcpy(&pattern[i], &pattern[0], b); |
Jens Axboe | e078de4 | 2013-04-24 23:07:17 -0600 | [diff] [blame] | 983 | i += b; |
| 984 | } |
| 985 | |
Steven Lang | 9a2a86d | 2012-02-07 09:42:59 +0100 | [diff] [blame] | 986 | if (i == 1) { |
| 987 | /* |
| 988 | * The code in verify_io_u_pattern assumes a single byte pattern |
| 989 | * fills the whole verify pattern buffer. |
| 990 | */ |
Jens Axboe | ce35b1e | 2014-01-14 15:35:58 -0700 | [diff] [blame] | 991 | memset(pattern, pattern[0], max_size); |
Steven Lang | 9a2a86d | 2012-02-07 09:42:59 +0100 | [diff] [blame] | 992 | } |
Steven Lang | efcd9dc | 2012-02-02 20:22:04 +0100 | [diff] [blame] | 993 | |
Jens Axboe | ce35b1e | 2014-01-14 15:35:58 -0700 | [diff] [blame] | 994 | *pattern_bytes = i; |
| 995 | return 0; |
| 996 | } |
| 997 | |
| 998 | static int str_buffer_pattern_cb(void *data, const char *input) |
| 999 | { |
| 1000 | struct thread_data *td = data; |
| 1001 | int ret; |
| 1002 | |
| 1003 | ret = pattern_cb(td->o.buffer_pattern, MAX_PATTERN_SIZE, input, |
| 1004 | &td->o.buffer_pattern_bytes); |
| 1005 | |
| 1006 | if (!ret) { |
| 1007 | td->o.refill_buffers = 0; |
| 1008 | td->o.scramble_buffers = 0; |
| 1009 | td->o.zero_buffers = 0; |
| 1010 | } |
| 1011 | |
| 1012 | return ret; |
| 1013 | } |
| 1014 | |
Jens Axboe | bedc9dc | 2014-03-17 12:51:09 -0600 | [diff] [blame] | 1015 | static int str_buffer_compress_cb(void *data, unsigned long long *il) |
| 1016 | { |
| 1017 | struct thread_data *td = data; |
| 1018 | |
| 1019 | td->flags |= TD_F_COMPRESS; |
| 1020 | td->o.compress_percentage = *il; |
| 1021 | return 0; |
| 1022 | } |
| 1023 | |
Jens Axboe | ce35b1e | 2014-01-14 15:35:58 -0700 | [diff] [blame] | 1024 | static int str_verify_pattern_cb(void *data, const char *input) |
| 1025 | { |
| 1026 | struct thread_data *td = data; |
| 1027 | int ret; |
| 1028 | |
| 1029 | ret = pattern_cb(td->o.verify_pattern, MAX_PATTERN_SIZE, input, |
| 1030 | &td->o.verify_pattern_bytes); |
Steven Lang | efcd9dc | 2012-02-02 20:22:04 +0100 | [diff] [blame] | 1031 | |
Jens Axboe | 92bf48d | 2011-01-14 21:20:42 +0100 | [diff] [blame] | 1032 | /* |
| 1033 | * VERIFY_META could already be set |
| 1034 | */ |
Jens Axboe | ce35b1e | 2014-01-14 15:35:58 -0700 | [diff] [blame] | 1035 | if (!ret && td->o.verify == VERIFY_NONE) |
Jens Axboe | 92bf48d | 2011-01-14 21:20:42 +0100 | [diff] [blame] | 1036 | td->o.verify = VERIFY_PATTERN; |
Steven Lang | efcd9dc | 2012-02-02 20:22:04 +0100 | [diff] [blame] | 1037 | |
Jens Axboe | ce35b1e | 2014-01-14 15:35:58 -0700 | [diff] [blame] | 1038 | return ret; |
Jens Axboe | 90059d6 | 2007-07-30 09:33:12 +0200 | [diff] [blame] | 1039 | } |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1040 | |
Jens Axboe | 993bf48 | 2008-11-14 13:04:53 +0100 | [diff] [blame] | 1041 | static int str_gtod_reduce_cb(void *data, int *il) |
| 1042 | { |
| 1043 | struct thread_data *td = data; |
| 1044 | int val = *il; |
| 1045 | |
Jens Axboe | 02af098 | 2010-06-24 09:59:34 +0200 | [diff] [blame] | 1046 | td->o.disable_lat = !!val; |
Jens Axboe | 993bf48 | 2008-11-14 13:04:53 +0100 | [diff] [blame] | 1047 | td->o.disable_clat = !!val; |
| 1048 | td->o.disable_slat = !!val; |
| 1049 | td->o.disable_bw = !!val; |
Jens Axboe | 0dc1bc0 | 2011-10-13 08:55:29 +0200 | [diff] [blame] | 1050 | td->o.clat_percentiles = !val; |
Jens Axboe | 993bf48 | 2008-11-14 13:04:53 +0100 | [diff] [blame] | 1051 | if (val) |
| 1052 | td->tv_cache_mask = 63; |
| 1053 | |
| 1054 | return 0; |
| 1055 | } |
| 1056 | |
Cigy Cyriac | 85bc833 | 2010-08-10 19:21:09 -0400 | [diff] [blame] | 1057 | static int str_gtod_cpu_cb(void *data, long long *il) |
Jens Axboe | be4ecfd | 2008-12-08 14:10:52 +0100 | [diff] [blame] | 1058 | { |
| 1059 | struct thread_data *td = data; |
| 1060 | int val = *il; |
| 1061 | |
| 1062 | td->o.gtod_cpu = val; |
| 1063 | td->o.gtod_offload = 1; |
| 1064 | return 0; |
| 1065 | } |
| 1066 | |
Jens Axboe | 7bb5910 | 2011-07-12 19:47:03 +0200 | [diff] [blame] | 1067 | static int str_size_cb(void *data, unsigned long long *__val) |
| 1068 | { |
| 1069 | struct thread_data *td = data; |
| 1070 | unsigned long long v = *__val; |
| 1071 | |
| 1072 | if (parse_is_percent(v)) { |
| 1073 | td->o.size = 0; |
| 1074 | td->o.size_percent = -1ULL - v; |
| 1075 | } else |
| 1076 | td->o.size = v; |
| 1077 | |
| 1078 | return 0; |
| 1079 | } |
| 1080 | |
Jens Axboe | 896cac2 | 2009-07-01 10:38:35 +0200 | [diff] [blame] | 1081 | static int rw_verify(struct fio_option *o, void *data) |
| 1082 | { |
| 1083 | struct thread_data *td = data; |
| 1084 | |
| 1085 | if (read_only && td_write(td)) { |
| 1086 | log_err("fio: job <%s> has write bit set, but fio is in" |
| 1087 | " read-only mode\n", td->o.name); |
| 1088 | return 1; |
| 1089 | } |
| 1090 | |
| 1091 | return 0; |
| 1092 | } |
| 1093 | |
Jens Axboe | 276ca4f | 2009-07-01 10:43:05 +0200 | [diff] [blame] | 1094 | static int gtod_cpu_verify(struct fio_option *o, void *data) |
Jens Axboe | 29d43ff | 2009-07-01 10:42:18 +0200 | [diff] [blame] | 1095 | { |
Jens Axboe | 276ca4f | 2009-07-01 10:43:05 +0200 | [diff] [blame] | 1096 | #ifndef FIO_HAVE_CPU_AFFINITY |
Jens Axboe | 29d43ff | 2009-07-01 10:42:18 +0200 | [diff] [blame] | 1097 | struct thread_data *td = data; |
| 1098 | |
Jens Axboe | 29d43ff | 2009-07-01 10:42:18 +0200 | [diff] [blame] | 1099 | if (td->o.gtod_cpu) { |
| 1100 | log_err("fio: platform must support CPU affinity for" |
| 1101 | "gettimeofday() offloading\n"); |
| 1102 | return 1; |
| 1103 | } |
| 1104 | #endif |
| 1105 | |
| 1106 | return 0; |
| 1107 | } |
| 1108 | |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1109 | /* |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 1110 | * Option grouping |
| 1111 | */ |
| 1112 | static struct opt_group fio_opt_groups[] = { |
| 1113 | { |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1114 | .name = "General", |
| 1115 | .mask = FIO_OPT_C_GENERAL, |
| 1116 | }, |
| 1117 | { |
| 1118 | .name = "I/O", |
| 1119 | .mask = FIO_OPT_C_IO, |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 1120 | }, |
| 1121 | { |
| 1122 | .name = "File", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1123 | .mask = FIO_OPT_C_FILE, |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 1124 | }, |
| 1125 | { |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1126 | .name = "Statistics", |
| 1127 | .mask = FIO_OPT_C_STAT, |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 1128 | }, |
| 1129 | { |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1130 | .name = "Logging", |
| 1131 | .mask = FIO_OPT_C_LOG, |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 1132 | }, |
| 1133 | { |
Jens Axboe | 13fca82 | 2012-03-31 13:55:54 +0200 | [diff] [blame] | 1134 | .name = "Profiles", |
| 1135 | .mask = FIO_OPT_C_PROFILE, |
| 1136 | }, |
| 1137 | { |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 1138 | .name = NULL, |
| 1139 | }, |
| 1140 | }; |
| 1141 | |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1142 | static struct opt_group *__opt_group_from_mask(struct opt_group *ogs, unsigned int *mask, |
| 1143 | unsigned int inv_mask) |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 1144 | { |
| 1145 | struct opt_group *og; |
| 1146 | int i; |
| 1147 | |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1148 | if (*mask == inv_mask || !*mask) |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 1149 | return NULL; |
| 1150 | |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1151 | for (i = 0; ogs[i].name; i++) { |
| 1152 | og = &ogs[i]; |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 1153 | |
| 1154 | if (*mask & og->mask) { |
| 1155 | *mask &= ~(og->mask); |
| 1156 | return og; |
| 1157 | } |
| 1158 | } |
| 1159 | |
| 1160 | return NULL; |
| 1161 | } |
| 1162 | |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1163 | struct opt_group *opt_group_from_mask(unsigned int *mask) |
| 1164 | { |
| 1165 | return __opt_group_from_mask(fio_opt_groups, mask, FIO_OPT_C_INVALID); |
| 1166 | } |
| 1167 | |
| 1168 | static struct opt_group fio_opt_cat_groups[] = { |
| 1169 | { |
Jens Axboe | 3e260a4 | 2013-12-09 12:38:53 -0700 | [diff] [blame] | 1170 | .name = "Latency profiling", |
| 1171 | .mask = FIO_OPT_G_LATPROF, |
| 1172 | }, |
| 1173 | { |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1174 | .name = "Rate", |
| 1175 | .mask = FIO_OPT_G_RATE, |
| 1176 | }, |
| 1177 | { |
| 1178 | .name = "Zone", |
| 1179 | .mask = FIO_OPT_G_ZONE, |
| 1180 | }, |
| 1181 | { |
| 1182 | .name = "Read/write mix", |
| 1183 | .mask = FIO_OPT_G_RWMIX, |
| 1184 | }, |
| 1185 | { |
| 1186 | .name = "Verify", |
| 1187 | .mask = FIO_OPT_G_VERIFY, |
| 1188 | }, |
| 1189 | { |
| 1190 | .name = "Trim", |
| 1191 | .mask = FIO_OPT_G_TRIM, |
| 1192 | }, |
| 1193 | { |
| 1194 | .name = "I/O Logging", |
| 1195 | .mask = FIO_OPT_G_IOLOG, |
| 1196 | }, |
| 1197 | { |
| 1198 | .name = "I/O Depth", |
| 1199 | .mask = FIO_OPT_G_IO_DEPTH, |
| 1200 | }, |
| 1201 | { |
| 1202 | .name = "I/O Flow", |
| 1203 | .mask = FIO_OPT_G_IO_FLOW, |
| 1204 | }, |
| 1205 | { |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1206 | .name = "Description", |
| 1207 | .mask = FIO_OPT_G_DESC, |
| 1208 | }, |
| 1209 | { |
| 1210 | .name = "Filename", |
| 1211 | .mask = FIO_OPT_G_FILENAME, |
| 1212 | }, |
| 1213 | { |
| 1214 | .name = "General I/O", |
| 1215 | .mask = FIO_OPT_G_IO_BASIC, |
| 1216 | }, |
| 1217 | { |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 1218 | .name = "Cgroups", |
| 1219 | .mask = FIO_OPT_G_CGROUP, |
| 1220 | }, |
| 1221 | { |
| 1222 | .name = "Runtime", |
| 1223 | .mask = FIO_OPT_G_RUNTIME, |
| 1224 | }, |
| 1225 | { |
Jens Axboe | 1086005 | 2012-03-19 20:56:53 +0100 | [diff] [blame] | 1226 | .name = "Process", |
| 1227 | .mask = FIO_OPT_G_PROCESS, |
| 1228 | }, |
| 1229 | { |
| 1230 | .name = "Job credentials / priority", |
| 1231 | .mask = FIO_OPT_G_CRED, |
| 1232 | }, |
| 1233 | { |
| 1234 | .name = "Clock settings", |
| 1235 | .mask = FIO_OPT_G_CLOCK, |
| 1236 | }, |
| 1237 | { |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 1238 | .name = "I/O Type", |
| 1239 | .mask = FIO_OPT_G_IO_TYPE, |
| 1240 | }, |
| 1241 | { |
| 1242 | .name = "I/O Thinktime", |
| 1243 | .mask = FIO_OPT_G_THINKTIME, |
| 1244 | }, |
| 1245 | { |
| 1246 | .name = "Randomizations", |
| 1247 | .mask = FIO_OPT_G_RANDOM, |
| 1248 | }, |
| 1249 | { |
| 1250 | .name = "I/O buffers", |
| 1251 | .mask = FIO_OPT_G_IO_BUF, |
| 1252 | }, |
| 1253 | { |
Jens Axboe | 13fca82 | 2012-03-31 13:55:54 +0200 | [diff] [blame] | 1254 | .name = "Tiobench profile", |
| 1255 | .mask = FIO_OPT_G_TIOBENCH, |
| 1256 | }, |
| 1257 | |
| 1258 | { |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1259 | .name = NULL, |
| 1260 | } |
| 1261 | }; |
| 1262 | |
| 1263 | struct opt_group *opt_group_cat_from_mask(unsigned int *mask) |
| 1264 | { |
| 1265 | return __opt_group_from_mask(fio_opt_cat_groups, mask, FIO_OPT_G_INVALID); |
| 1266 | } |
| 1267 | |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 1268 | /* |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1269 | * Map of job/command line options |
| 1270 | */ |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 1271 | struct fio_option fio_options[FIO_MAX_OPTS] = { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1272 | { |
| 1273 | .name = "description", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1274 | .lname = "Description of job", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1275 | .type = FIO_OPT_STR_STORE, |
| 1276 | .off1 = td_var_offset(description), |
| 1277 | .help = "Text job description", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1278 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1279 | .group = FIO_OPT_G_DESC, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1280 | }, |
| 1281 | { |
| 1282 | .name = "name", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1283 | .lname = "Job name", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1284 | .type = FIO_OPT_STR_STORE, |
| 1285 | .off1 = td_var_offset(name), |
| 1286 | .help = "Name of this job", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1287 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1288 | .group = FIO_OPT_G_DESC, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1289 | }, |
| 1290 | { |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1291 | .name = "filename", |
| 1292 | .lname = "Filename(s)", |
| 1293 | .type = FIO_OPT_STR_STORE, |
| 1294 | .off1 = td_var_offset(filename), |
| 1295 | .cb = str_filename_cb, |
| 1296 | .prio = -1, /* must come after "directory" */ |
| 1297 | .help = "File(s) to use for the workload", |
| 1298 | .category = FIO_OPT_C_FILE, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1299 | .group = FIO_OPT_G_FILENAME, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1300 | }, |
| 1301 | { |
| 1302 | .name = "directory", |
| 1303 | .lname = "Directory", |
| 1304 | .type = FIO_OPT_STR_STORE, |
| 1305 | .off1 = td_var_offset(directory), |
| 1306 | .cb = str_directory_cb, |
| 1307 | .help = "Directory to store files in", |
| 1308 | .category = FIO_OPT_C_FILE, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1309 | .group = FIO_OPT_G_FILENAME, |
Jens Axboe | 90fef2d | 2009-07-17 22:33:32 +0200 | [diff] [blame] | 1310 | }, |
| 1311 | { |
Jens Axboe | de98bd3 | 2013-04-05 11:09:20 +0200 | [diff] [blame] | 1312 | .name = "filename_format", |
| 1313 | .type = FIO_OPT_STR_STORE, |
| 1314 | .off1 = td_var_offset(filename_format), |
| 1315 | .prio = -1, /* must come after "directory" */ |
| 1316 | .help = "Override default $jobname.$jobnum.$filenum naming", |
| 1317 | .def = "$jobname.$jobnum.$filenum", |
Jens Axboe | 93bb626 | 2013-04-10 13:01:30 +0200 | [diff] [blame] | 1318 | .category = FIO_OPT_C_FILE, |
| 1319 | .group = FIO_OPT_G_FILENAME, |
Steven Noonan | ad705bc | 2013-04-08 15:05:25 -0700 | [diff] [blame] | 1320 | }, |
| 1321 | { |
Jens Axboe | 29c1349 | 2008-03-01 19:25:20 +0100 | [diff] [blame] | 1322 | .name = "lockfile", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1323 | .lname = "Lockfile", |
Jens Axboe | 4d4e80f | 2008-03-04 10:18:56 +0100 | [diff] [blame] | 1324 | .type = FIO_OPT_STR, |
Jens Axboe | 4d4e80f | 2008-03-04 10:18:56 +0100 | [diff] [blame] | 1325 | .off1 = td_var_offset(file_lock_mode), |
Jens Axboe | 29c1349 | 2008-03-01 19:25:20 +0100 | [diff] [blame] | 1326 | .help = "Lock file when doing IO to it", |
Jens Axboe | bc6a0a5 | 2014-02-07 10:57:13 -0700 | [diff] [blame] | 1327 | .prio = 1, |
Jens Axboe | 29c1349 | 2008-03-01 19:25:20 +0100 | [diff] [blame] | 1328 | .parent = "filename", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1329 | .hide = 0, |
Jens Axboe | 4d4e80f | 2008-03-04 10:18:56 +0100 | [diff] [blame] | 1330 | .def = "none", |
Jens Axboe | f2a2803 | 2014-02-11 09:12:06 -0700 | [diff] [blame] | 1331 | .cb = str_lockfile_cb, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1332 | .category = FIO_OPT_C_FILE, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1333 | .group = FIO_OPT_G_FILENAME, |
Jens Axboe | 4d4e80f | 2008-03-04 10:18:56 +0100 | [diff] [blame] | 1334 | .posval = { |
| 1335 | { .ival = "none", |
| 1336 | .oval = FILE_LOCK_NONE, |
| 1337 | .help = "No file locking", |
| 1338 | }, |
| 1339 | { .ival = "exclusive", |
| 1340 | .oval = FILE_LOCK_EXCLUSIVE, |
| 1341 | .help = "Exclusive file lock", |
| 1342 | }, |
| 1343 | { |
| 1344 | .ival = "readwrite", |
| 1345 | .oval = FILE_LOCK_READWRITE, |
| 1346 | .help = "Read vs write lock", |
| 1347 | }, |
| 1348 | }, |
Jens Axboe | 29c1349 | 2008-03-01 19:25:20 +0100 | [diff] [blame] | 1349 | }, |
| 1350 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1351 | .name = "opendir", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1352 | .lname = "Open directory", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1353 | .type = FIO_OPT_STR_STORE, |
| 1354 | .off1 = td_var_offset(opendir), |
| 1355 | .cb = str_opendir_cb, |
| 1356 | .help = "Recursively add files from this directory and down", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1357 | .category = FIO_OPT_C_FILE, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1358 | .group = FIO_OPT_G_FILENAME, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1359 | }, |
| 1360 | { |
| 1361 | .name = "rw", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1362 | .lname = "Read/write", |
Jens Axboe | d3aad8f | 2007-03-15 14:12:05 +0100 | [diff] [blame] | 1363 | .alias = "readwrite", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1364 | .type = FIO_OPT_STR, |
Jens Axboe | 211097b | 2007-03-22 18:56:45 +0100 | [diff] [blame] | 1365 | .cb = str_rw_cb, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1366 | .off1 = td_var_offset(td_ddir), |
| 1367 | .help = "IO direction", |
| 1368 | .def = "read", |
Jens Axboe | 896cac2 | 2009-07-01 10:38:35 +0200 | [diff] [blame] | 1369 | .verify = rw_verify, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1370 | .category = FIO_OPT_C_IO, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1371 | .group = FIO_OPT_G_IO_BASIC, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1372 | .posval = { |
| 1373 | { .ival = "read", |
| 1374 | .oval = TD_DDIR_READ, |
| 1375 | .help = "Sequential read", |
| 1376 | }, |
| 1377 | { .ival = "write", |
| 1378 | .oval = TD_DDIR_WRITE, |
| 1379 | .help = "Sequential write", |
| 1380 | }, |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 1381 | { .ival = "trim", |
| 1382 | .oval = TD_DDIR_TRIM, |
| 1383 | .help = "Sequential trim", |
| 1384 | }, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1385 | { .ival = "randread", |
| 1386 | .oval = TD_DDIR_RANDREAD, |
| 1387 | .help = "Random read", |
| 1388 | }, |
| 1389 | { .ival = "randwrite", |
| 1390 | .oval = TD_DDIR_RANDWRITE, |
| 1391 | .help = "Random write", |
| 1392 | }, |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 1393 | { .ival = "randtrim", |
| 1394 | .oval = TD_DDIR_RANDTRIM, |
| 1395 | .help = "Random trim", |
| 1396 | }, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1397 | { .ival = "rw", |
| 1398 | .oval = TD_DDIR_RW, |
| 1399 | .help = "Sequential read and write mix", |
| 1400 | }, |
Jens Axboe | 10b023d | 2012-03-23 13:40:06 +0100 | [diff] [blame] | 1401 | { .ival = "readwrite", |
| 1402 | .oval = TD_DDIR_RW, |
| 1403 | .help = "Sequential read and write mix", |
| 1404 | }, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1405 | { .ival = "randrw", |
| 1406 | .oval = TD_DDIR_RANDRW, |
| 1407 | .help = "Random read and write mix" |
| 1408 | }, |
| 1409 | }, |
| 1410 | }, |
| 1411 | { |
Jens Axboe | 38dad62 | 2010-07-20 14:46:00 -0600 | [diff] [blame] | 1412 | .name = "rw_sequencer", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1413 | .lname = "RW Sequencer", |
Jens Axboe | 38dad62 | 2010-07-20 14:46:00 -0600 | [diff] [blame] | 1414 | .type = FIO_OPT_STR, |
| 1415 | .off1 = td_var_offset(rw_seq), |
| 1416 | .help = "IO offset generator modifier", |
| 1417 | .def = "sequential", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1418 | .category = FIO_OPT_C_IO, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1419 | .group = FIO_OPT_G_IO_BASIC, |
Jens Axboe | 38dad62 | 2010-07-20 14:46:00 -0600 | [diff] [blame] | 1420 | .posval = { |
| 1421 | { .ival = "sequential", |
| 1422 | .oval = RW_SEQ_SEQ, |
| 1423 | .help = "Generate sequential offsets", |
| 1424 | }, |
| 1425 | { .ival = "identical", |
| 1426 | .oval = RW_SEQ_IDENT, |
| 1427 | .help = "Generate identical offsets", |
| 1428 | }, |
| 1429 | }, |
| 1430 | }, |
| 1431 | |
| 1432 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1433 | .name = "ioengine", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1434 | .lname = "IO Engine", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1435 | .type = FIO_OPT_STR_STORE, |
| 1436 | .off1 = td_var_offset(ioengine), |
| 1437 | .help = "IO engine to use", |
Jens Axboe | 58483fa | 2011-01-19 11:09:58 -0700 | [diff] [blame] | 1438 | .def = FIO_PREFERRED_ENGINE, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1439 | .category = FIO_OPT_C_IO, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1440 | .group = FIO_OPT_G_IO_BASIC, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1441 | .posval = { |
| 1442 | { .ival = "sync", |
| 1443 | .help = "Use read/write", |
| 1444 | }, |
gurudas pai | a31041e | 2007-10-23 15:12:30 +0200 | [diff] [blame] | 1445 | { .ival = "psync", |
| 1446 | .help = "Use pread/pwrite", |
| 1447 | }, |
Jens Axboe | 1d2af02 | 2008-02-04 10:59:07 +0100 | [diff] [blame] | 1448 | { .ival = "vsync", |
Bruce Cran | 03e20d6 | 2011-01-02 20:14:54 +0100 | [diff] [blame] | 1449 | .help = "Use readv/writev", |
Jens Axboe | 1d2af02 | 2008-02-04 10:59:07 +0100 | [diff] [blame] | 1450 | }, |
Jens Axboe | 07fc0ac | 2013-05-16 20:36:57 +0200 | [diff] [blame] | 1451 | #ifdef CONFIG_PWRITEV |
| 1452 | { .ival = "pvsync", |
| 1453 | .help = "Use preadv/pwritev", |
| 1454 | }, |
| 1455 | #endif |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1456 | #ifdef CONFIG_LIBAIO |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1457 | { .ival = "libaio", |
| 1458 | .help = "Linux native asynchronous IO", |
| 1459 | }, |
| 1460 | #endif |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1461 | #ifdef CONFIG_POSIXAIO |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1462 | { .ival = "posixaio", |
| 1463 | .help = "POSIX asynchronous IO", |
| 1464 | }, |
| 1465 | #endif |
Jens Axboe | 997843c | 2013-01-24 15:27:40 -0700 | [diff] [blame] | 1466 | #ifdef CONFIG_SOLARISAIO |
Jens Axboe | 417f006 | 2008-06-02 11:59:30 +0200 | [diff] [blame] | 1467 | { .ival = "solarisaio", |
| 1468 | .help = "Solaris native asynchronous IO", |
| 1469 | }, |
| 1470 | #endif |
Jens Axboe | 4700b23 | 2013-01-24 15:33:33 -0700 | [diff] [blame] | 1471 | #ifdef CONFIG_WINDOWSAIO |
Bruce Cran | 03e20d6 | 2011-01-02 20:14:54 +0100 | [diff] [blame] | 1472 | { .ival = "windowsaio", |
Jens Axboe | 3be8007 | 2011-01-19 11:07:28 -0700 | [diff] [blame] | 1473 | .help = "Windows native asynchronous IO" |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 1474 | }, |
Jens Axboe | 3be8007 | 2011-01-19 11:07:28 -0700 | [diff] [blame] | 1475 | #endif |
Daniel Gollub | fc5c034 | 2014-02-17 14:35:28 +0100 | [diff] [blame] | 1476 | #ifdef CONFIG_RBD |
| 1477 | { .ival = "rbd", |
| 1478 | .help = "Rados Block Device asynchronous IO" |
| 1479 | }, |
| 1480 | #endif |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1481 | { .ival = "mmap", |
Bruce Cran | 03e20d6 | 2011-01-02 20:14:54 +0100 | [diff] [blame] | 1482 | .help = "Memory mapped IO" |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1483 | }, |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1484 | #ifdef CONFIG_LINUX_SPLICE |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1485 | { .ival = "splice", |
| 1486 | .help = "splice/vmsplice based IO", |
| 1487 | }, |
Jens Axboe | 9cce02e | 2007-06-22 15:42:21 +0200 | [diff] [blame] | 1488 | { .ival = "netsplice", |
| 1489 | .help = "splice/vmsplice to/from the network", |
| 1490 | }, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1491 | #endif |
| 1492 | #ifdef FIO_HAVE_SGIO |
| 1493 | { .ival = "sg", |
| 1494 | .help = "SCSI generic v3 IO", |
| 1495 | }, |
| 1496 | #endif |
| 1497 | { .ival = "null", |
| 1498 | .help = "Testing engine (no data transfer)", |
| 1499 | }, |
| 1500 | { .ival = "net", |
| 1501 | .help = "Network IO", |
| 1502 | }, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1503 | { .ival = "cpuio", |
Bruce Cran | 03e20d6 | 2011-01-02 20:14:54 +0100 | [diff] [blame] | 1504 | .help = "CPU cycle burner engine", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1505 | }, |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1506 | #ifdef CONFIG_GUASI |
Jens Axboe | b8c82a4 | 2007-03-21 08:48:26 +0100 | [diff] [blame] | 1507 | { .ival = "guasi", |
| 1508 | .help = "GUASI IO engine", |
| 1509 | }, |
| 1510 | #endif |
Jens Axboe | 79a4318 | 2010-09-07 13:28:58 +0200 | [diff] [blame] | 1511 | #ifdef FIO_HAVE_BINJECT |
| 1512 | { .ival = "binject", |
| 1513 | .help = "binject direct inject block engine", |
| 1514 | }, |
| 1515 | #endif |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1516 | #ifdef CONFIG_RDMA |
ren yufei | 21b8aee | 2011-08-01 10:01:57 +0200 | [diff] [blame] | 1517 | { .ival = "rdma", |
| 1518 | .help = "RDMA IO engine", |
| 1519 | }, |
| 1520 | #endif |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1521 | #ifdef CONFIG_FUSION_AW |
Jens Axboe | 8200b8c | 2012-09-18 23:55:43 +0200 | [diff] [blame] | 1522 | { .ival = "fusion-aw-sync", |
| 1523 | .help = "Fusion-io atomic write engine", |
| 1524 | }, |
| 1525 | #endif |
Jens Axboe | 997843c | 2013-01-24 15:27:40 -0700 | [diff] [blame] | 1526 | #ifdef CONFIG_LINUX_EXT4_MOVE_EXTENT |
Jens Axboe | 1ecc95c | 2012-09-20 13:46:34 +0200 | [diff] [blame] | 1527 | { .ival = "e4defrag", |
| 1528 | .help = "ext4 defrag engine", |
| 1529 | }, |
| 1530 | #endif |
Jens Axboe | 997843c | 2013-01-24 15:27:40 -0700 | [diff] [blame] | 1531 | #ifdef CONFIG_LINUX_FALLOCATE |
Jens Axboe | 1ecc95c | 2012-09-20 13:46:34 +0200 | [diff] [blame] | 1532 | { .ival = "falloc", |
| 1533 | .help = "fallocate() file based engine", |
| 1534 | }, |
| 1535 | #endif |
chenh | 321fc5a | 2014-03-31 11:32:29 -0400 | [diff] [blame] | 1536 | #ifdef CONFIG_GFAPI |
| 1537 | { .ival = "gfapi", |
chenh | cb92c7f | 2014-04-02 13:01:01 -0400 | [diff] [blame] | 1538 | .help = "Glusterfs libgfapi(sync) based engine" |
| 1539 | }, |
| 1540 | { .ival = "gfapi_async", |
| 1541 | .help = "Glusterfs libgfapi(async) based engine" |
chenh | 321fc5a | 2014-03-31 11:32:29 -0400 | [diff] [blame] | 1542 | }, |
| 1543 | #endif |
| 1544 | |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1545 | { .ival = "external", |
| 1546 | .help = "Load external engine (append name)", |
| 1547 | }, |
| 1548 | }, |
| 1549 | }, |
| 1550 | { |
| 1551 | .name = "iodepth", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1552 | .lname = "IO Depth", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1553 | .type = FIO_OPT_INT, |
| 1554 | .off1 = td_var_offset(iodepth), |
Bruce Cran | 03e20d6 | 2011-01-02 20:14:54 +0100 | [diff] [blame] | 1555 | .help = "Number of IO buffers to keep in flight", |
Jens Axboe | 757aff4 | 2007-12-12 19:42:13 +0100 | [diff] [blame] | 1556 | .minval = 1, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1557 | .interval = 1, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1558 | .def = "1", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1559 | .category = FIO_OPT_C_IO, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1560 | .group = FIO_OPT_G_IO_BASIC, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1561 | }, |
| 1562 | { |
| 1563 | .name = "iodepth_batch", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1564 | .lname = "IO Depth batch", |
Jens Axboe | 4950421 | 2008-06-05 09:03:30 +0200 | [diff] [blame] | 1565 | .alias = "iodepth_batch_submit", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1566 | .type = FIO_OPT_INT, |
| 1567 | .off1 = td_var_offset(iodepth_batch), |
Jens Axboe | d65db44 | 2009-01-16 19:15:33 +0100 | [diff] [blame] | 1568 | .help = "Number of IO buffers to submit in one go", |
Jens Axboe | afdf935 | 2007-07-31 16:14:34 +0200 | [diff] [blame] | 1569 | .parent = "iodepth", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1570 | .hide = 1, |
Jens Axboe | a2e6f8a | 2008-01-18 10:28:11 +0100 | [diff] [blame] | 1571 | .minval = 1, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1572 | .interval = 1, |
Jens Axboe | a2e6f8a | 2008-01-18 10:28:11 +0100 | [diff] [blame] | 1573 | .def = "1", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1574 | .category = FIO_OPT_C_IO, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1575 | .group = FIO_OPT_G_IO_BASIC, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1576 | }, |
| 1577 | { |
Jens Axboe | 4950421 | 2008-06-05 09:03:30 +0200 | [diff] [blame] | 1578 | .name = "iodepth_batch_complete", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1579 | .lname = "IO Depth batch complete", |
Jens Axboe | 4950421 | 2008-06-05 09:03:30 +0200 | [diff] [blame] | 1580 | .type = FIO_OPT_INT, |
| 1581 | .off1 = td_var_offset(iodepth_batch_complete), |
Jens Axboe | d65db44 | 2009-01-16 19:15:33 +0100 | [diff] [blame] | 1582 | .help = "Number of IO buffers to retrieve in one go", |
Jens Axboe | 4950421 | 2008-06-05 09:03:30 +0200 | [diff] [blame] | 1583 | .parent = "iodepth", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1584 | .hide = 1, |
Jens Axboe | 4950421 | 2008-06-05 09:03:30 +0200 | [diff] [blame] | 1585 | .minval = 0, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1586 | .interval = 1, |
Jens Axboe | 4950421 | 2008-06-05 09:03:30 +0200 | [diff] [blame] | 1587 | .def = "1", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1588 | .category = FIO_OPT_C_IO, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1589 | .group = FIO_OPT_G_IO_BASIC, |
Jens Axboe | 4950421 | 2008-06-05 09:03:30 +0200 | [diff] [blame] | 1590 | }, |
| 1591 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1592 | .name = "iodepth_low", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1593 | .lname = "IO Depth batch low", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1594 | .type = FIO_OPT_INT, |
| 1595 | .off1 = td_var_offset(iodepth_low), |
| 1596 | .help = "Low water mark for queuing depth", |
Jens Axboe | afdf935 | 2007-07-31 16:14:34 +0200 | [diff] [blame] | 1597 | .parent = "iodepth", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1598 | .hide = 1, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1599 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1600 | .category = FIO_OPT_C_IO, |
Jens Axboe | 0626037 | 2012-03-19 15:16:08 +0100 | [diff] [blame] | 1601 | .group = FIO_OPT_G_IO_BASIC, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1602 | }, |
| 1603 | { |
| 1604 | .name = "size", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1605 | .lname = "Size", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1606 | .type = FIO_OPT_STR_VAL, |
Jens Axboe | 7bb5910 | 2011-07-12 19:47:03 +0200 | [diff] [blame] | 1607 | .cb = str_size_cb, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1608 | .help = "Total size of device or files", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1609 | .interval = 1024 * 1024, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1610 | .category = FIO_OPT_C_IO, |
| 1611 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1612 | }, |
| 1613 | { |
Jens Axboe | 77731b2 | 2014-04-28 12:08:47 -0600 | [diff] [blame] | 1614 | .name = "io_limit", |
| 1615 | .lname = "IO Limit", |
| 1616 | .type = FIO_OPT_STR_VAL, |
| 1617 | .off1 = td_var_offset(io_limit), |
| 1618 | .interval = 1024 * 1024, |
| 1619 | .category = FIO_OPT_C_IO, |
| 1620 | .group = FIO_OPT_G_INVALID, |
| 1621 | }, |
| 1622 | { |
Shawn Lewis | aa31f1f | 2008-01-11 09:45:11 +0100 | [diff] [blame] | 1623 | .name = "fill_device", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1624 | .lname = "Fill device", |
Jens Axboe | 74586c1 | 2011-01-20 10:16:03 -0700 | [diff] [blame] | 1625 | .alias = "fill_fs", |
Shawn Lewis | aa31f1f | 2008-01-11 09:45:11 +0100 | [diff] [blame] | 1626 | .type = FIO_OPT_BOOL, |
| 1627 | .off1 = td_var_offset(fill_device), |
| 1628 | .help = "Write until an ENOSPC error occurs", |
| 1629 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1630 | .category = FIO_OPT_C_FILE, |
| 1631 | .group = FIO_OPT_G_INVALID, |
Shawn Lewis | aa31f1f | 2008-01-11 09:45:11 +0100 | [diff] [blame] | 1632 | }, |
| 1633 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1634 | .name = "filesize", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1635 | .lname = "File size", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1636 | .type = FIO_OPT_STR_VAL, |
| 1637 | .off1 = td_var_offset(file_size_low), |
| 1638 | .off2 = td_var_offset(file_size_high), |
Jens Axboe | c3edbdb | 2007-07-20 14:25:31 +0200 | [diff] [blame] | 1639 | .minval = 1, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1640 | .help = "Size of individual files", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1641 | .interval = 1024 * 1024, |
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 | { |
Jens Axboe | bedc9dc | 2014-03-17 12:51:09 -0600 | [diff] [blame] | 1646 | .name = "file_append", |
| 1647 | .lname = "File append", |
| 1648 | .type = FIO_OPT_BOOL, |
| 1649 | .off1 = td_var_offset(file_append), |
| 1650 | .help = "IO will start at the end of the file(s)", |
| 1651 | .def = "0", |
| 1652 | .category = FIO_OPT_C_FILE, |
| 1653 | .group = FIO_OPT_G_INVALID, |
| 1654 | }, |
| 1655 | { |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1656 | .name = "offset", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1657 | .lname = "IO offset", |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1658 | .alias = "fileoffset", |
| 1659 | .type = FIO_OPT_STR_VAL, |
| 1660 | .off1 = td_var_offset(start_offset), |
| 1661 | .help = "Start IO from this offset", |
| 1662 | .def = "0", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1663 | .interval = 1024 * 1024, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1664 | .category = FIO_OPT_C_IO, |
| 1665 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1666 | }, |
| 1667 | { |
Jens Axboe | 2d7cd86 | 2012-03-15 14:53:38 +0100 | [diff] [blame] | 1668 | .name = "offset_increment", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1669 | .lname = "IO offset increment", |
Jens Axboe | 2d7cd86 | 2012-03-15 14:53:38 +0100 | [diff] [blame] | 1670 | .type = FIO_OPT_STR_VAL, |
| 1671 | .off1 = td_var_offset(offset_increment), |
| 1672 | .help = "What is the increment from one offset to the next", |
| 1673 | .parent = "offset", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1674 | .hide = 1, |
Jens Axboe | 2d7cd86 | 2012-03-15 14:53:38 +0100 | [diff] [blame] | 1675 | .def = "0", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1676 | .interval = 1024 * 1024, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1677 | .category = FIO_OPT_C_IO, |
| 1678 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 2d7cd86 | 2012-03-15 14:53:38 +0100 | [diff] [blame] | 1679 | }, |
| 1680 | { |
Jens Axboe | ddf24e4 | 2013-08-09 12:53:44 -0600 | [diff] [blame] | 1681 | .name = "number_ios", |
| 1682 | .lname = "Number of IOs to perform", |
| 1683 | .type = FIO_OPT_STR_VAL, |
| 1684 | .off1 = td_var_offset(number_ios), |
| 1685 | .help = "Force job completion of this number of IOs", |
| 1686 | .def = "0", |
| 1687 | .category = FIO_OPT_C_IO, |
| 1688 | .group = FIO_OPT_G_INVALID, |
| 1689 | }, |
| 1690 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1691 | .name = "bs", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1692 | .lname = "Block size", |
Jens Axboe | d3aad8f | 2007-03-15 14:12:05 +0100 | [diff] [blame] | 1693 | .alias = "blocksize", |
Jens Axboe | e01b22b | 2009-06-09 15:43:25 +0200 | [diff] [blame] | 1694 | .type = FIO_OPT_INT, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1695 | .off1 = td_var_offset(bs[DDIR_READ]), |
| 1696 | .off2 = td_var_offset(bs[DDIR_WRITE]), |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 1697 | .off3 = td_var_offset(bs[DDIR_TRIM]), |
Jens Axboe | c3edbdb | 2007-07-20 14:25:31 +0200 | [diff] [blame] | 1698 | .minval = 1, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1699 | .help = "Block size unit", |
| 1700 | .def = "4k", |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1701 | .parent = "rw", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1702 | .hide = 1, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1703 | .interval = 512, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1704 | .category = FIO_OPT_C_IO, |
| 1705 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1706 | }, |
| 1707 | { |
Jens Axboe | 2b7a01d | 2009-03-11 11:00:13 +0100 | [diff] [blame] | 1708 | .name = "ba", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1709 | .lname = "Block size align", |
Jens Axboe | 2b7a01d | 2009-03-11 11:00:13 +0100 | [diff] [blame] | 1710 | .alias = "blockalign", |
Jens Axboe | e01b22b | 2009-06-09 15:43:25 +0200 | [diff] [blame] | 1711 | .type = FIO_OPT_INT, |
Jens Axboe | 2b7a01d | 2009-03-11 11:00:13 +0100 | [diff] [blame] | 1712 | .off1 = td_var_offset(ba[DDIR_READ]), |
| 1713 | .off2 = td_var_offset(ba[DDIR_WRITE]), |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 1714 | .off3 = td_var_offset(ba[DDIR_TRIM]), |
Jens Axboe | 2b7a01d | 2009-03-11 11:00:13 +0100 | [diff] [blame] | 1715 | .minval = 1, |
| 1716 | .help = "IO block offset alignment", |
| 1717 | .parent = "rw", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1718 | .hide = 1, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1719 | .interval = 512, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1720 | .category = FIO_OPT_C_IO, |
| 1721 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 2b7a01d | 2009-03-11 11:00:13 +0100 | [diff] [blame] | 1722 | }, |
| 1723 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1724 | .name = "bsrange", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1725 | .lname = "Block size range", |
Jens Axboe | d3aad8f | 2007-03-15 14:12:05 +0100 | [diff] [blame] | 1726 | .alias = "blocksize_range", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1727 | .type = FIO_OPT_RANGE, |
| 1728 | .off1 = td_var_offset(min_bs[DDIR_READ]), |
| 1729 | .off2 = td_var_offset(max_bs[DDIR_READ]), |
| 1730 | .off3 = td_var_offset(min_bs[DDIR_WRITE]), |
| 1731 | .off4 = td_var_offset(max_bs[DDIR_WRITE]), |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 1732 | .off5 = td_var_offset(min_bs[DDIR_TRIM]), |
| 1733 | .off6 = td_var_offset(max_bs[DDIR_TRIM]), |
Jens Axboe | c3edbdb | 2007-07-20 14:25:31 +0200 | [diff] [blame] | 1734 | .minval = 1, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1735 | .help = "Set block size range (in more detail than bs)", |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1736 | .parent = "rw", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1737 | .hide = 1, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1738 | .interval = 4096, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1739 | .category = FIO_OPT_C_IO, |
| 1740 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1741 | }, |
| 1742 | { |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 1743 | .name = "bssplit", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1744 | .lname = "Block size split", |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 1745 | .type = FIO_OPT_STR, |
| 1746 | .cb = str_bssplit_cb, |
| 1747 | .help = "Set a specific mix of block sizes", |
| 1748 | .parent = "rw", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1749 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1750 | .category = FIO_OPT_C_IO, |
| 1751 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 564ca97 | 2007-12-14 12:21:19 +0100 | [diff] [blame] | 1752 | }, |
| 1753 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1754 | .name = "bs_unaligned", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1755 | .lname = "Block size unaligned", |
Jens Axboe | d3aad8f | 2007-03-15 14:12:05 +0100 | [diff] [blame] | 1756 | .alias = "blocksize_unaligned", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1757 | .type = FIO_OPT_STR_SET, |
| 1758 | .off1 = td_var_offset(bs_unaligned), |
| 1759 | .help = "Don't sector align IO buffer sizes", |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1760 | .parent = "rw", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1761 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1762 | .category = FIO_OPT_C_IO, |
| 1763 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1764 | }, |
| 1765 | { |
Jens Axboe | 6aca9b3 | 2013-07-25 12:45:26 -0600 | [diff] [blame] | 1766 | .name = "bs_is_seq_rand", |
| 1767 | .lname = "Block size division is seq/random (not read/write)", |
| 1768 | .type = FIO_OPT_BOOL, |
| 1769 | .off1 = td_var_offset(bs_is_seq_rand), |
| 1770 | .help = "Consider any blocksize setting to be sequential,ramdom", |
| 1771 | .def = "0", |
| 1772 | .parent = "blocksize", |
| 1773 | .category = FIO_OPT_C_IO, |
| 1774 | .group = FIO_OPT_G_INVALID, |
| 1775 | }, |
| 1776 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1777 | .name = "randrepeat", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1778 | .lname = "Random repeatable", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1779 | .type = FIO_OPT_BOOL, |
| 1780 | .off1 = td_var_offset(rand_repeatable), |
| 1781 | .help = "Use repeatable random IO pattern", |
| 1782 | .def = "1", |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1783 | .parent = "rw", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1784 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1785 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 1786 | .group = FIO_OPT_G_RANDOM, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1787 | }, |
| 1788 | { |
Jens Axboe | 04778ba | 2014-01-10 20:57:01 -0700 | [diff] [blame] | 1789 | .name = "randseed", |
| 1790 | .lname = "The random generator seed", |
Grant Grundler | 363cffa | 2014-01-28 15:11:23 -0700 | [diff] [blame] | 1791 | .type = FIO_OPT_STR_VAL, |
Jens Axboe | 04778ba | 2014-01-10 20:57:01 -0700 | [diff] [blame] | 1792 | .off1 = td_var_offset(rand_seed), |
| 1793 | .help = "Set the random generator seed value", |
| 1794 | .parent = "rw", |
| 1795 | .category = FIO_OPT_C_IO, |
| 1796 | .group = FIO_OPT_G_RANDOM, |
| 1797 | }, |
| 1798 | { |
Jens Axboe | 2615cc4 | 2011-03-28 09:35:09 +0200 | [diff] [blame] | 1799 | .name = "use_os_rand", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1800 | .lname = "Use OS random", |
Jens Axboe | 2615cc4 | 2011-03-28 09:35:09 +0200 | [diff] [blame] | 1801 | .type = FIO_OPT_BOOL, |
| 1802 | .off1 = td_var_offset(use_os_rand), |
| 1803 | .help = "Set to use OS random generator", |
| 1804 | .def = "0", |
| 1805 | .parent = "rw", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1806 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1807 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 1808 | .group = FIO_OPT_G_RANDOM, |
Jens Axboe | 2615cc4 | 2011-03-28 09:35:09 +0200 | [diff] [blame] | 1809 | }, |
| 1810 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1811 | .name = "norandommap", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1812 | .lname = "No randommap", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1813 | .type = FIO_OPT_STR_SET, |
| 1814 | .off1 = td_var_offset(norandommap), |
| 1815 | .help = "Accept potential duplicate random blocks", |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1816 | .parent = "rw", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1817 | .hide = 1, |
Jens Axboe | b2452a4 | 2012-03-20 10:29:45 +0100 | [diff] [blame] | 1818 | .hide_on_set = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1819 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 1820 | .group = FIO_OPT_G_RANDOM, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1821 | }, |
| 1822 | { |
Jens Axboe | 2b386d2 | 2008-03-26 10:32:57 +0100 | [diff] [blame] | 1823 | .name = "softrandommap", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1824 | .lname = "Soft randommap", |
Jens Axboe | 2b386d2 | 2008-03-26 10:32:57 +0100 | [diff] [blame] | 1825 | .type = FIO_OPT_BOOL, |
| 1826 | .off1 = td_var_offset(softrandommap), |
Jens Axboe | f66ab3c | 2008-06-05 11:48:22 +0200 | [diff] [blame] | 1827 | .help = "Set norandommap if randommap allocation fails", |
Jens Axboe | 2b386d2 | 2008-03-26 10:32:57 +0100 | [diff] [blame] | 1828 | .parent = "norandommap", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1829 | .hide = 1, |
Jens Axboe | 2b386d2 | 2008-03-26 10:32:57 +0100 | [diff] [blame] | 1830 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1831 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 1832 | .group = FIO_OPT_G_RANDOM, |
Jens Axboe | 2b386d2 | 2008-03-26 10:32:57 +0100 | [diff] [blame] | 1833 | }, |
| 1834 | { |
Jens Axboe | 8055e41 | 2012-11-26 08:43:47 +0100 | [diff] [blame] | 1835 | .name = "random_generator", |
| 1836 | .type = FIO_OPT_STR, |
| 1837 | .off1 = td_var_offset(random_generator), |
| 1838 | .help = "Type of random number generator to use", |
| 1839 | .def = "tausworthe", |
| 1840 | .posval = { |
| 1841 | { .ival = "tausworthe", |
| 1842 | .oval = FIO_RAND_GEN_TAUSWORTHE, |
| 1843 | .help = "Strong Tausworthe generator", |
| 1844 | }, |
| 1845 | { .ival = "lfsr", |
| 1846 | .oval = FIO_RAND_GEN_LFSR, |
| 1847 | .help = "Variable length LFSR", |
| 1848 | }, |
| 1849 | }, |
Jens Axboe | 4810759 | 2012-12-04 09:43:11 +0100 | [diff] [blame] | 1850 | .category = FIO_OPT_C_IO, |
| 1851 | .group = FIO_OPT_G_RANDOM, |
Jens Axboe | 8055e41 | 2012-11-26 08:43:47 +0100 | [diff] [blame] | 1852 | }, |
| 1853 | { |
Jens Axboe | e25839d | 2012-11-06 10:49:42 +0100 | [diff] [blame] | 1854 | .name = "random_distribution", |
| 1855 | .type = FIO_OPT_STR, |
| 1856 | .off1 = td_var_offset(random_distribution), |
| 1857 | .cb = str_random_distribution_cb, |
| 1858 | .help = "Random offset distribution generator", |
| 1859 | .def = "random", |
| 1860 | .posval = { |
| 1861 | { .ival = "random", |
| 1862 | .oval = FIO_RAND_DIST_RANDOM, |
| 1863 | .help = "Completely random", |
| 1864 | }, |
| 1865 | { .ival = "zipf", |
| 1866 | .oval = FIO_RAND_DIST_ZIPF, |
| 1867 | .help = "Zipf distribution", |
| 1868 | }, |
Jens Axboe | 925fee3 | 2012-11-06 13:50:32 +0100 | [diff] [blame] | 1869 | { .ival = "pareto", |
| 1870 | .oval = FIO_RAND_DIST_PARETO, |
| 1871 | .help = "Pareto distribution", |
| 1872 | }, |
Jens Axboe | e25839d | 2012-11-06 10:49:42 +0100 | [diff] [blame] | 1873 | }, |
Jens Axboe | 4810759 | 2012-12-04 09:43:11 +0100 | [diff] [blame] | 1874 | .category = FIO_OPT_C_IO, |
| 1875 | .group = FIO_OPT_G_RANDOM, |
Jens Axboe | e25839d | 2012-11-06 10:49:42 +0100 | [diff] [blame] | 1876 | }, |
| 1877 | { |
Jens Axboe | 211c9b8 | 2013-04-26 08:56:17 -0600 | [diff] [blame] | 1878 | .name = "percentage_random", |
| 1879 | .lname = "Percentage Random", |
| 1880 | .type = FIO_OPT_INT, |
Jens Axboe | d947227 | 2013-07-25 10:20:45 -0600 | [diff] [blame] | 1881 | .off1 = td_var_offset(perc_rand[DDIR_READ]), |
| 1882 | .off2 = td_var_offset(perc_rand[DDIR_WRITE]), |
| 1883 | .off3 = td_var_offset(perc_rand[DDIR_TRIM]), |
Jens Axboe | 211c9b8 | 2013-04-26 08:56:17 -0600 | [diff] [blame] | 1884 | .maxval = 100, |
| 1885 | .help = "Percentage of seq/random mix that should be random", |
Jens Axboe | d947227 | 2013-07-25 10:20:45 -0600 | [diff] [blame] | 1886 | .def = "100,100,100", |
Jens Axboe | 211c9b8 | 2013-04-26 08:56:17 -0600 | [diff] [blame] | 1887 | .interval = 5, |
| 1888 | .inverse = "percentage_sequential", |
| 1889 | .category = FIO_OPT_C_IO, |
| 1890 | .group = FIO_OPT_G_RANDOM, |
| 1891 | }, |
| 1892 | { |
| 1893 | .name = "percentage_sequential", |
| 1894 | .lname = "Percentage Sequential", |
Jens Axboe | d947227 | 2013-07-25 10:20:45 -0600 | [diff] [blame] | 1895 | .type = FIO_OPT_DEPRECATED, |
Jens Axboe | 211c9b8 | 2013-04-26 08:56:17 -0600 | [diff] [blame] | 1896 | .category = FIO_OPT_C_IO, |
| 1897 | .group = FIO_OPT_G_RANDOM, |
| 1898 | }, |
| 1899 | { |
Christian Ehrhardt | 56e2a5f | 2014-02-20 09:10:17 -0800 | [diff] [blame] | 1900 | .name = "allrandrepeat", |
| 1901 | .type = FIO_OPT_BOOL, |
| 1902 | .off1 = td_var_offset(allrand_repeatable), |
| 1903 | .help = "Use repeatable random numbers for everything", |
| 1904 | .def = "0", |
Jens Axboe | a869d9c | 2014-02-20 13:22:48 -0800 | [diff] [blame] | 1905 | .category = FIO_OPT_C_IO, |
| 1906 | .group = FIO_OPT_G_RANDOM, |
Christian Ehrhardt | 56e2a5f | 2014-02-20 09:10:17 -0800 | [diff] [blame] | 1907 | }, |
| 1908 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1909 | .name = "nrfiles", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1910 | .lname = "Number of files", |
Jens Axboe | d7c8be0 | 2010-11-25 08:21:39 +0100 | [diff] [blame] | 1911 | .alias = "nr_files", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1912 | .type = FIO_OPT_INT, |
| 1913 | .off1 = td_var_offset(nr_files), |
| 1914 | .help = "Split job workload between this number of files", |
| 1915 | .def = "1", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 1916 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1917 | .category = FIO_OPT_C_FILE, |
| 1918 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1919 | }, |
| 1920 | { |
| 1921 | .name = "openfiles", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1922 | .lname = "Number of open files", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1923 | .type = FIO_OPT_INT, |
| 1924 | .off1 = td_var_offset(open_files), |
| 1925 | .help = "Number of files to keep open at the same time", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1926 | .category = FIO_OPT_C_FILE, |
| 1927 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1928 | }, |
| 1929 | { |
| 1930 | .name = "file_service_type", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1931 | .lname = "File service type", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1932 | .type = FIO_OPT_STR, |
| 1933 | .cb = str_fst_cb, |
| 1934 | .off1 = td_var_offset(file_service_type), |
| 1935 | .help = "How to select which file to service next", |
| 1936 | .def = "roundrobin", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1937 | .category = FIO_OPT_C_FILE, |
| 1938 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1939 | .posval = { |
| 1940 | { .ival = "random", |
| 1941 | .oval = FIO_FSERVICE_RANDOM, |
| 1942 | .help = "Choose a file at random", |
| 1943 | }, |
| 1944 | { .ival = "roundrobin", |
| 1945 | .oval = FIO_FSERVICE_RR, |
| 1946 | .help = "Round robin select files", |
| 1947 | }, |
Jens Axboe | a086c25 | 2009-03-04 08:27:37 +0100 | [diff] [blame] | 1948 | { .ival = "sequential", |
| 1949 | .oval = FIO_FSERVICE_SEQ, |
| 1950 | .help = "Finish one file before moving to the next", |
| 1951 | }, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 1952 | }, |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1953 | .parent = "nrfiles", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 1954 | .hide = 1, |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1955 | }, |
Jens Axboe | 97ac992 | 2013-01-24 15:00:25 -0700 | [diff] [blame] | 1956 | #ifdef CONFIG_POSIX_FALLOCATE |
Jens Axboe | 7bc8c2c | 2010-01-28 11:31:31 +0100 | [diff] [blame] | 1957 | { |
| 1958 | .name = "fallocate", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1959 | .lname = "Fallocate", |
Eric Gouriou | a596f04 | 2011-06-17 09:11:45 +0200 | [diff] [blame] | 1960 | .type = FIO_OPT_STR, |
| 1961 | .off1 = td_var_offset(fallocate_mode), |
| 1962 | .help = "Whether pre-allocation is performed when laying out files", |
| 1963 | .def = "posix", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1964 | .category = FIO_OPT_C_FILE, |
| 1965 | .group = FIO_OPT_G_INVALID, |
Eric Gouriou | a596f04 | 2011-06-17 09:11:45 +0200 | [diff] [blame] | 1966 | .posval = { |
| 1967 | { .ival = "none", |
| 1968 | .oval = FIO_FALLOCATE_NONE, |
| 1969 | .help = "Do not pre-allocate space", |
| 1970 | }, |
| 1971 | { .ival = "posix", |
| 1972 | .oval = FIO_FALLOCATE_POSIX, |
| 1973 | .help = "Use posix_fallocate()", |
| 1974 | }, |
Jens Axboe | 97ac992 | 2013-01-24 15:00:25 -0700 | [diff] [blame] | 1975 | #ifdef CONFIG_LINUX_FALLOCATE |
Eric Gouriou | a596f04 | 2011-06-17 09:11:45 +0200 | [diff] [blame] | 1976 | { .ival = "keep", |
| 1977 | .oval = FIO_FALLOCATE_KEEP_SIZE, |
| 1978 | .help = "Use fallocate(..., FALLOC_FL_KEEP_SIZE, ...)", |
| 1979 | }, |
Jens Axboe | 7bc8c2c | 2010-01-28 11:31:31 +0100 | [diff] [blame] | 1980 | #endif |
Eric Gouriou | a596f04 | 2011-06-17 09:11:45 +0200 | [diff] [blame] | 1981 | /* Compatibility with former boolean values */ |
| 1982 | { .ival = "0", |
| 1983 | .oval = FIO_FALLOCATE_NONE, |
| 1984 | .help = "Alias for 'none'", |
| 1985 | }, |
| 1986 | { .ival = "1", |
| 1987 | .oval = FIO_FALLOCATE_POSIX, |
| 1988 | .help = "Alias for 'posix'", |
| 1989 | }, |
| 1990 | }, |
| 1991 | }, |
Jens Axboe | 97ac992 | 2013-01-24 15:00:25 -0700 | [diff] [blame] | 1992 | #endif /* CONFIG_POSIX_FALLOCATE */ |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1993 | { |
| 1994 | .name = "fadvise_hint", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 1995 | .lname = "Fadvise hint", |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 1996 | .type = FIO_OPT_BOOL, |
| 1997 | .off1 = td_var_offset(fadvise_hint), |
| 1998 | .help = "Use fadvise() to advise the kernel on IO pattern", |
| 1999 | .def = "1", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2000 | .category = FIO_OPT_C_FILE, |
| 2001 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2002 | }, |
| 2003 | { |
| 2004 | .name = "fsync", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2005 | .lname = "Fsync", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2006 | .type = FIO_OPT_INT, |
| 2007 | .off1 = td_var_offset(fsync_blocks), |
| 2008 | .help = "Issue fsync for writes every given number of blocks", |
| 2009 | .def = "0", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2010 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2011 | .category = FIO_OPT_C_FILE, |
| 2012 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2013 | }, |
| 2014 | { |
Jens Axboe | 5f9099e | 2009-06-16 22:40:26 +0200 | [diff] [blame] | 2015 | .name = "fdatasync", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2016 | .lname = "Fdatasync", |
Jens Axboe | 5f9099e | 2009-06-16 22:40:26 +0200 | [diff] [blame] | 2017 | .type = FIO_OPT_INT, |
| 2018 | .off1 = td_var_offset(fdatasync_blocks), |
| 2019 | .help = "Issue fdatasync for writes every given number of blocks", |
| 2020 | .def = "0", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2021 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2022 | .category = FIO_OPT_C_FILE, |
| 2023 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 5f9099e | 2009-06-16 22:40:26 +0200 | [diff] [blame] | 2024 | }, |
Jens Axboe | 1ef2b6b | 2010-10-08 15:07:01 +0200 | [diff] [blame] | 2025 | { |
| 2026 | .name = "write_barrier", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2027 | .lname = "Write barrier", |
Jens Axboe | 1ef2b6b | 2010-10-08 15:07:01 +0200 | [diff] [blame] | 2028 | .type = FIO_OPT_INT, |
| 2029 | .off1 = td_var_offset(barrier_blocks), |
| 2030 | .help = "Make every Nth write a barrier write", |
| 2031 | .def = "0", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2032 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2033 | .category = FIO_OPT_C_IO, |
| 2034 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 1ef2b6b | 2010-10-08 15:07:01 +0200 | [diff] [blame] | 2035 | }, |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 2036 | #ifdef CONFIG_SYNC_FILE_RANGE |
Jens Axboe | 44f2969 | 2010-03-09 20:09:44 +0100 | [diff] [blame] | 2037 | { |
| 2038 | .name = "sync_file_range", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2039 | .lname = "Sync file range", |
Jens Axboe | 44f2969 | 2010-03-09 20:09:44 +0100 | [diff] [blame] | 2040 | .posval = { |
| 2041 | { .ival = "wait_before", |
| 2042 | .oval = SYNC_FILE_RANGE_WAIT_BEFORE, |
| 2043 | .help = "SYNC_FILE_RANGE_WAIT_BEFORE", |
Daniel Gollub | ebadc0c | 2014-02-12 08:24:57 -0700 | [diff] [blame] | 2044 | .orval = 1, |
Jens Axboe | 44f2969 | 2010-03-09 20:09:44 +0100 | [diff] [blame] | 2045 | }, |
| 2046 | { .ival = "write", |
| 2047 | .oval = SYNC_FILE_RANGE_WRITE, |
| 2048 | .help = "SYNC_FILE_RANGE_WRITE", |
Daniel Gollub | ebadc0c | 2014-02-12 08:24:57 -0700 | [diff] [blame] | 2049 | .orval = 1, |
Jens Axboe | 44f2969 | 2010-03-09 20:09:44 +0100 | [diff] [blame] | 2050 | }, |
| 2051 | { |
| 2052 | .ival = "wait_after", |
| 2053 | .oval = SYNC_FILE_RANGE_WAIT_AFTER, |
| 2054 | .help = "SYNC_FILE_RANGE_WAIT_AFTER", |
Daniel Gollub | ebadc0c | 2014-02-12 08:24:57 -0700 | [diff] [blame] | 2055 | .orval = 1, |
Jens Axboe | 44f2969 | 2010-03-09 20:09:44 +0100 | [diff] [blame] | 2056 | }, |
| 2057 | }, |
Jens Axboe | 3843deb | 2010-03-09 20:41:15 +0100 | [diff] [blame] | 2058 | .type = FIO_OPT_STR_MULTI, |
Jens Axboe | 44f2969 | 2010-03-09 20:09:44 +0100 | [diff] [blame] | 2059 | .cb = str_sfr_cb, |
| 2060 | .off1 = td_var_offset(sync_file_range), |
| 2061 | .help = "Use sync_file_range()", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2062 | .category = FIO_OPT_C_FILE, |
| 2063 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 44f2969 | 2010-03-09 20:09:44 +0100 | [diff] [blame] | 2064 | }, |
| 2065 | #endif |
Jens Axboe | 5f9099e | 2009-06-16 22:40:26 +0200 | [diff] [blame] | 2066 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2067 | .name = "direct", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2068 | .lname = "Direct I/O", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2069 | .type = FIO_OPT_BOOL, |
| 2070 | .off1 = td_var_offset(odirect), |
| 2071 | .help = "Use O_DIRECT IO (negates buffered)", |
| 2072 | .def = "0", |
Jens Axboe | a01a1bc | 2012-03-19 21:13:01 +0100 | [diff] [blame] | 2073 | .inverse = "buffered", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2074 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 2075 | .group = FIO_OPT_G_IO_TYPE, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2076 | }, |
| 2077 | { |
Chris Mason | d01612f | 2013-11-15 15:52:58 -0700 | [diff] [blame] | 2078 | .name = "atomic", |
| 2079 | .lname = "Atomic I/O", |
| 2080 | .type = FIO_OPT_BOOL, |
| 2081 | .off1 = td_var_offset(oatomic), |
| 2082 | .help = "Use Atomic IO with O_DIRECT (implies O_DIRECT)", |
| 2083 | .def = "0", |
| 2084 | .category = FIO_OPT_C_IO, |
| 2085 | .group = FIO_OPT_G_IO_TYPE, |
| 2086 | }, |
| 2087 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2088 | .name = "buffered", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2089 | .lname = "Buffered I/O", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2090 | .type = FIO_OPT_BOOL, |
| 2091 | .off1 = td_var_offset(odirect), |
| 2092 | .neg = 1, |
| 2093 | .help = "Use buffered IO (negates direct)", |
| 2094 | .def = "1", |
Jens Axboe | a01a1bc | 2012-03-19 21:13:01 +0100 | [diff] [blame] | 2095 | .inverse = "direct", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2096 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 2097 | .group = FIO_OPT_G_IO_TYPE, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2098 | }, |
| 2099 | { |
| 2100 | .name = "overwrite", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2101 | .lname = "Overwrite", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2102 | .type = FIO_OPT_BOOL, |
| 2103 | .off1 = td_var_offset(overwrite), |
| 2104 | .help = "When writing, set whether to overwrite current data", |
| 2105 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2106 | .category = FIO_OPT_C_FILE, |
| 2107 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2108 | }, |
| 2109 | { |
| 2110 | .name = "loops", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2111 | .lname = "Loops", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2112 | .type = FIO_OPT_INT, |
| 2113 | .off1 = td_var_offset(loops), |
| 2114 | .help = "Number of times to run the job", |
| 2115 | .def = "1", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2116 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2117 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 2118 | .group = FIO_OPT_G_RUNTIME, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2119 | }, |
| 2120 | { |
| 2121 | .name = "numjobs", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2122 | .lname = "Number of jobs", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2123 | .type = FIO_OPT_INT, |
| 2124 | .off1 = td_var_offset(numjobs), |
| 2125 | .help = "Duplicate this job this many times", |
| 2126 | .def = "1", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2127 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2128 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 2129 | .group = FIO_OPT_G_RUNTIME, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2130 | }, |
| 2131 | { |
| 2132 | .name = "startdelay", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2133 | .lname = "Start delay", |
Jens Axboe | a5737c9 | 2010-06-29 10:40:30 +0200 | [diff] [blame] | 2134 | .type = FIO_OPT_STR_VAL_TIME, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2135 | .off1 = td_var_offset(start_delay), |
Christian Ehrhardt | 23ed19b | 2014-02-20 09:07:02 -0800 | [diff] [blame] | 2136 | .off2 = td_var_offset(start_delay_high), |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2137 | .help = "Only start job when this period has passed", |
| 2138 | .def = "0", |
Jens Axboe | 0de5b26 | 2014-02-21 15:26:01 -0800 | [diff] [blame] | 2139 | .is_seconds = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2140 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 2141 | .group = FIO_OPT_G_RUNTIME, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2142 | }, |
| 2143 | { |
| 2144 | .name = "runtime", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2145 | .lname = "Runtime", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2146 | .alias = "timeout", |
| 2147 | .type = FIO_OPT_STR_VAL_TIME, |
| 2148 | .off1 = td_var_offset(timeout), |
| 2149 | .help = "Stop workload when this amount of time has passed", |
| 2150 | .def = "0", |
Jens Axboe | 0de5b26 | 2014-02-21 15:26:01 -0800 | [diff] [blame] | 2151 | .is_seconds = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2152 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 2153 | .group = FIO_OPT_G_RUNTIME, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2154 | }, |
| 2155 | { |
Jens Axboe | cf4464c | 2007-04-17 20:14:42 +0200 | [diff] [blame] | 2156 | .name = "time_based", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2157 | .lname = "Time based", |
Jens Axboe | cf4464c | 2007-04-17 20:14:42 +0200 | [diff] [blame] | 2158 | .type = FIO_OPT_STR_SET, |
| 2159 | .off1 = td_var_offset(time_based), |
| 2160 | .help = "Keep running until runtime/timeout is met", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2161 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 2162 | .group = FIO_OPT_G_RUNTIME, |
Jens Axboe | cf4464c | 2007-04-17 20:14:42 +0200 | [diff] [blame] | 2163 | }, |
| 2164 | { |
Juan Casse | 6216776 | 2013-09-17 14:06:13 -0700 | [diff] [blame] | 2165 | .name = "verify_only", |
| 2166 | .lname = "Verify only", |
| 2167 | .type = FIO_OPT_STR_SET, |
| 2168 | .off1 = td_var_offset(verify_only), |
| 2169 | .help = "Verifies previously written data is still valid", |
| 2170 | .category = FIO_OPT_C_GENERAL, |
| 2171 | .group = FIO_OPT_G_RUNTIME, |
| 2172 | }, |
| 2173 | { |
Jens Axboe | 721938a | 2008-09-10 09:46:16 +0200 | [diff] [blame] | 2174 | .name = "ramp_time", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2175 | .lname = "Ramp time", |
Jens Axboe | 721938a | 2008-09-10 09:46:16 +0200 | [diff] [blame] | 2176 | .type = FIO_OPT_STR_VAL_TIME, |
| 2177 | .off1 = td_var_offset(ramp_time), |
| 2178 | .help = "Ramp up time before measuring performance", |
Jens Axboe | 0de5b26 | 2014-02-21 15:26:01 -0800 | [diff] [blame] | 2179 | .is_seconds = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2180 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 2181 | .group = FIO_OPT_G_RUNTIME, |
Jens Axboe | 721938a | 2008-09-10 09:46:16 +0200 | [diff] [blame] | 2182 | }, |
| 2183 | { |
Jens Axboe | c223da8 | 2010-03-24 13:23:53 +0100 | [diff] [blame] | 2184 | .name = "clocksource", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2185 | .lname = "Clock source", |
Jens Axboe | c223da8 | 2010-03-24 13:23:53 +0100 | [diff] [blame] | 2186 | .type = FIO_OPT_STR, |
| 2187 | .cb = fio_clock_source_cb, |
| 2188 | .off1 = td_var_offset(clocksource), |
| 2189 | .help = "What type of timing source to use", |
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_CLOCK, |
Jens Axboe | c223da8 | 2010-03-24 13:23:53 +0100 | [diff] [blame] | 2192 | .posval = { |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 2193 | #ifdef CONFIG_GETTIMEOFDAY |
Jens Axboe | c223da8 | 2010-03-24 13:23:53 +0100 | [diff] [blame] | 2194 | { .ival = "gettimeofday", |
| 2195 | .oval = CS_GTOD, |
| 2196 | .help = "Use gettimeofday(2) for timing", |
| 2197 | }, |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 2198 | #endif |
| 2199 | #ifdef CONFIG_CLOCK_GETTIME |
Jens Axboe | c223da8 | 2010-03-24 13:23:53 +0100 | [diff] [blame] | 2200 | { .ival = "clock_gettime", |
| 2201 | .oval = CS_CGETTIME, |
| 2202 | .help = "Use clock_gettime(2) for timing", |
| 2203 | }, |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 2204 | #endif |
Jens Axboe | c223da8 | 2010-03-24 13:23:53 +0100 | [diff] [blame] | 2205 | #ifdef ARCH_HAVE_CPU_CLOCK |
| 2206 | { .ival = "cpu", |
| 2207 | .oval = CS_CPUCLOCK, |
| 2208 | .help = "Use CPU private clock", |
| 2209 | }, |
| 2210 | #endif |
| 2211 | }, |
| 2212 | }, |
| 2213 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2214 | .name = "mem", |
Jens Axboe | d3aad8f | 2007-03-15 14:12:05 +0100 | [diff] [blame] | 2215 | .alias = "iomem", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2216 | .lname = "I/O Memory", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2217 | .type = FIO_OPT_STR, |
| 2218 | .cb = str_mem_cb, |
| 2219 | .off1 = td_var_offset(mem_type), |
| 2220 | .help = "Backing type for IO buffers", |
| 2221 | .def = "malloc", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2222 | .category = FIO_OPT_C_IO, |
| 2223 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2224 | .posval = { |
| 2225 | { .ival = "malloc", |
| 2226 | .oval = MEM_MALLOC, |
| 2227 | .help = "Use malloc(3) for IO buffers", |
| 2228 | }, |
Jens Axboe | ef7035a | 2014-06-18 15:30:09 -0700 | [diff] [blame] | 2229 | #ifndef CONFIG_NO_SHM |
Jens Axboe | b370e46 | 2007-03-19 10:51:49 +0100 | [diff] [blame] | 2230 | { .ival = "shm", |
| 2231 | .oval = MEM_SHM, |
| 2232 | .help = "Use shared memory segments for IO buffers", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2233 | }, |
| 2234 | #ifdef FIO_HAVE_HUGETLB |
Jens Axboe | 37c8cdf | 2007-03-19 13:14:03 +0100 | [diff] [blame] | 2235 | { .ival = "shmhuge", |
| 2236 | .oval = MEM_SHMHUGE, |
| 2237 | .help = "Like shm, but use huge pages", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2238 | }, |
| 2239 | #endif |
Jens Axboe | ef7035a | 2014-06-18 15:30:09 -0700 | [diff] [blame] | 2240 | #endif |
Jens Axboe | b370e46 | 2007-03-19 10:51:49 +0100 | [diff] [blame] | 2241 | { .ival = "mmap", |
| 2242 | .oval = MEM_MMAP, |
| 2243 | .help = "Use mmap(2) (file or anon) for IO buffers", |
| 2244 | }, |
Jens Axboe | 37c8cdf | 2007-03-19 13:14:03 +0100 | [diff] [blame] | 2245 | #ifdef FIO_HAVE_HUGETLB |
| 2246 | { .ival = "mmaphuge", |
| 2247 | .oval = MEM_MMAPHUGE, |
| 2248 | .help = "Like mmap, but use huge pages", |
| 2249 | }, |
| 2250 | #endif |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2251 | }, |
| 2252 | }, |
| 2253 | { |
Jens Axboe | d529ee1 | 2009-07-01 10:33:03 +0200 | [diff] [blame] | 2254 | .name = "iomem_align", |
| 2255 | .alias = "mem_align", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2256 | .lname = "I/O memory alignment", |
Jens Axboe | d529ee1 | 2009-07-01 10:33:03 +0200 | [diff] [blame] | 2257 | .type = FIO_OPT_INT, |
| 2258 | .off1 = td_var_offset(mem_align), |
| 2259 | .minval = 0, |
| 2260 | .help = "IO memory buffer offset alignment", |
| 2261 | .def = "0", |
| 2262 | .parent = "iomem", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2263 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2264 | .category = FIO_OPT_C_IO, |
| 2265 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | d529ee1 | 2009-07-01 10:33:03 +0200 | [diff] [blame] | 2266 | }, |
| 2267 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2268 | .name = "verify", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2269 | .lname = "Verify", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2270 | .type = FIO_OPT_STR, |
| 2271 | .off1 = td_var_offset(verify), |
| 2272 | .help = "Verify data written", |
| 2273 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2274 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 2275 | .group = FIO_OPT_G_VERIFY, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2276 | .posval = { |
| 2277 | { .ival = "0", |
| 2278 | .oval = VERIFY_NONE, |
| 2279 | .help = "Don't do IO verification", |
| 2280 | }, |
Jens Axboe | fcca4b5 | 2007-07-27 15:42:00 +0200 | [diff] [blame] | 2281 | { .ival = "md5", |
| 2282 | .oval = VERIFY_MD5, |
| 2283 | .help = "Use md5 checksums for verification", |
| 2284 | }, |
Jens Axboe | d77a7af | 2007-07-27 15:35:06 +0200 | [diff] [blame] | 2285 | { .ival = "crc64", |
| 2286 | .oval = VERIFY_CRC64, |
| 2287 | .help = "Use crc64 checksums for verification", |
| 2288 | }, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2289 | { .ival = "crc32", |
| 2290 | .oval = VERIFY_CRC32, |
| 2291 | .help = "Use crc32 checksums for verification", |
| 2292 | }, |
Jens Axboe | af497e6 | 2008-08-04 15:40:35 +0200 | [diff] [blame] | 2293 | { .ival = "crc32c-intel", |
Jens Axboe | e3aaafc | 2012-02-22 20:28:17 +0100 | [diff] [blame] | 2294 | .oval = VERIFY_CRC32C, |
| 2295 | .help = "Use crc32c checksums for verification (hw assisted, if available)", |
Jens Axboe | af497e6 | 2008-08-04 15:40:35 +0200 | [diff] [blame] | 2296 | }, |
Jens Axboe | bac39e0 | 2008-06-11 20:46:19 +0200 | [diff] [blame] | 2297 | { .ival = "crc32c", |
| 2298 | .oval = VERIFY_CRC32C, |
Jens Axboe | e3aaafc | 2012-02-22 20:28:17 +0100 | [diff] [blame] | 2299 | .help = "Use crc32c checksums for verification (hw assisted, if available)", |
Jens Axboe | bac39e0 | 2008-06-11 20:46:19 +0200 | [diff] [blame] | 2300 | }, |
Jens Axboe | 969f7ed | 2007-07-27 09:07:17 +0200 | [diff] [blame] | 2301 | { .ival = "crc16", |
| 2302 | .oval = VERIFY_CRC16, |
| 2303 | .help = "Use crc16 checksums for verification", |
| 2304 | }, |
Jens Axboe | 1e154bd | 2007-07-27 09:52:40 +0200 | [diff] [blame] | 2305 | { .ival = "crc7", |
| 2306 | .oval = VERIFY_CRC7, |
| 2307 | .help = "Use crc7 checksums for verification", |
| 2308 | }, |
Jens Axboe | 7c353ce | 2009-08-09 22:40:33 +0200 | [diff] [blame] | 2309 | { .ival = "sha1", |
| 2310 | .oval = VERIFY_SHA1, |
| 2311 | .help = "Use sha1 checksums for verification", |
| 2312 | }, |
Jens Axboe | cd14cc1 | 2007-07-30 10:59:33 +0200 | [diff] [blame] | 2313 | { .ival = "sha256", |
| 2314 | .oval = VERIFY_SHA256, |
| 2315 | .help = "Use sha256 checksums for verification", |
| 2316 | }, |
| 2317 | { .ival = "sha512", |
| 2318 | .oval = VERIFY_SHA512, |
| 2319 | .help = "Use sha512 checksums for verification", |
| 2320 | }, |
Jens Axboe | 844ea60 | 2014-02-20 13:21:45 -0800 | [diff] [blame] | 2321 | { .ival = "xxhash", |
| 2322 | .oval = VERIFY_XXHASH, |
| 2323 | .help = "Use xxhash checksums for verification", |
| 2324 | }, |
Shawn Lewis | 7437ee8 | 2007-08-02 21:05:58 +0200 | [diff] [blame] | 2325 | { .ival = "meta", |
| 2326 | .oval = VERIFY_META, |
| 2327 | .help = "Use io information", |
| 2328 | }, |
Jens Axboe | 36690c9 | 2007-03-26 10:23:34 +0200 | [diff] [blame] | 2329 | { |
| 2330 | .ival = "null", |
| 2331 | .oval = VERIFY_NULL, |
| 2332 | .help = "Pretend to verify", |
| 2333 | }, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2334 | }, |
| 2335 | }, |
| 2336 | { |
Jens Axboe | 005c565 | 2007-08-02 22:21:36 +0200 | [diff] [blame] | 2337 | .name = "do_verify", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2338 | .lname = "Perform verify step", |
Jens Axboe | 68e1f29 | 2007-08-10 10:32:14 +0200 | [diff] [blame] | 2339 | .type = FIO_OPT_BOOL, |
Jens Axboe | 005c565 | 2007-08-02 22:21:36 +0200 | [diff] [blame] | 2340 | .off1 = td_var_offset(do_verify), |
| 2341 | .help = "Run verification stage after write", |
| 2342 | .def = "1", |
| 2343 | .parent = "verify", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2344 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2345 | .category = FIO_OPT_C_IO, |
| 2346 | .group = FIO_OPT_G_VERIFY, |
Jens Axboe | 005c565 | 2007-08-02 22:21:36 +0200 | [diff] [blame] | 2347 | }, |
| 2348 | { |
Jens Axboe | 160b966 | 2007-03-27 10:59:49 +0200 | [diff] [blame] | 2349 | .name = "verifysort", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2350 | .lname = "Verify sort", |
Jens Axboe | 160b966 | 2007-03-27 10:59:49 +0200 | [diff] [blame] | 2351 | .type = FIO_OPT_BOOL, |
| 2352 | .off1 = td_var_offset(verifysort), |
| 2353 | .help = "Sort written verify blocks for read back", |
| 2354 | .def = "1", |
Jens Axboe | c83f2df | 2007-07-31 22:51:47 +0200 | [diff] [blame] | 2355 | .parent = "verify", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2356 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2357 | .category = FIO_OPT_C_IO, |
| 2358 | .group = FIO_OPT_G_VERIFY, |
Jens Axboe | 160b966 | 2007-03-27 10:59:49 +0200 | [diff] [blame] | 2359 | }, |
| 2360 | { |
Jens Axboe | 1ae83d4 | 2013-01-12 01:44:15 -0700 | [diff] [blame] | 2361 | .name = "verifysort_nr", |
| 2362 | .type = FIO_OPT_INT, |
| 2363 | .off1 = td_var_offset(verifysort_nr), |
| 2364 | .help = "Pre-load and sort verify blocks for a read workload", |
| 2365 | .minval = 0, |
| 2366 | .maxval = 131072, |
| 2367 | .def = "1024", |
| 2368 | .parent = "verify", |
Jens Axboe | 836fcc0 | 2013-01-24 09:08:45 -0700 | [diff] [blame] | 2369 | .category = FIO_OPT_C_IO, |
| 2370 | .group = FIO_OPT_G_VERIFY, |
Jens Axboe | 1ae83d4 | 2013-01-12 01:44:15 -0700 | [diff] [blame] | 2371 | }, |
| 2372 | { |
Jens Axboe | a59e170 | 2007-07-30 08:53:27 +0200 | [diff] [blame] | 2373 | .name = "verify_interval", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2374 | .lname = "Verify interval", |
Jens Axboe | e01b22b | 2009-06-09 15:43:25 +0200 | [diff] [blame] | 2375 | .type = FIO_OPT_INT, |
Jens Axboe | a59e170 | 2007-07-30 08:53:27 +0200 | [diff] [blame] | 2376 | .off1 = td_var_offset(verify_interval), |
Jens Axboe | 819a968 | 2007-07-28 21:30:31 +0200 | [diff] [blame] | 2377 | .minval = 2 * sizeof(struct verify_header), |
Jens Axboe | a59e170 | 2007-07-30 08:53:27 +0200 | [diff] [blame] | 2378 | .help = "Store verify buffer header every N bytes", |
Jens Axboe | afdf935 | 2007-07-31 16:14:34 +0200 | [diff] [blame] | 2379 | .parent = "verify", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2380 | .hide = 1, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2381 | .interval = 2 * sizeof(struct verify_header), |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2382 | .category = FIO_OPT_C_IO, |
| 2383 | .group = FIO_OPT_G_VERIFY, |
Shawn Lewis | 3f9f4e2 | 2007-07-28 21:10:37 +0200 | [diff] [blame] | 2384 | }, |
| 2385 | { |
Jens Axboe | a59e170 | 2007-07-30 08:53:27 +0200 | [diff] [blame] | 2386 | .name = "verify_offset", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2387 | .lname = "Verify offset", |
Jens Axboe | e01b22b | 2009-06-09 15:43:25 +0200 | [diff] [blame] | 2388 | .type = FIO_OPT_INT, |
Jens Axboe | a59e170 | 2007-07-30 08:53:27 +0200 | [diff] [blame] | 2389 | .help = "Offset verify header location by N bytes", |
Jens Axboe | 203160d | 2012-03-29 21:17:12 +0200 | [diff] [blame] | 2390 | .off1 = td_var_offset(verify_offset), |
| 2391 | .minval = sizeof(struct verify_header), |
Jens Axboe | afdf935 | 2007-07-31 16:14:34 +0200 | [diff] [blame] | 2392 | .parent = "verify", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2393 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2394 | .category = FIO_OPT_C_IO, |
| 2395 | .group = FIO_OPT_G_VERIFY, |
Shawn Lewis | 546a914 | 2007-07-28 21:11:37 +0200 | [diff] [blame] | 2396 | }, |
| 2397 | { |
Shawn Lewis | e28218f | 2008-01-16 11:01:33 +0100 | [diff] [blame] | 2398 | .name = "verify_pattern", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2399 | .lname = "Verify pattern", |
Radha Ramachandran | 0e92f87 | 2009-10-27 20:14:27 +0100 | [diff] [blame] | 2400 | .type = FIO_OPT_STR, |
Shawn Lewis | e28218f | 2008-01-16 11:01:33 +0100 | [diff] [blame] | 2401 | .cb = str_verify_pattern_cb, |
| 2402 | .help = "Fill pattern for IO buffers", |
| 2403 | .parent = "verify", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2404 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2405 | .category = FIO_OPT_C_IO, |
| 2406 | .group = FIO_OPT_G_VERIFY, |
Shawn Lewis | e28218f | 2008-01-16 11:01:33 +0100 | [diff] [blame] | 2407 | }, |
| 2408 | { |
Jens Axboe | a12a3b4 | 2007-08-09 10:20:54 +0200 | [diff] [blame] | 2409 | .name = "verify_fatal", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2410 | .lname = "Verify fatal", |
Jens Axboe | 68e1f29 | 2007-08-10 10:32:14 +0200 | [diff] [blame] | 2411 | .type = FIO_OPT_BOOL, |
Jens Axboe | a12a3b4 | 2007-08-09 10:20:54 +0200 | [diff] [blame] | 2412 | .off1 = td_var_offset(verify_fatal), |
| 2413 | .def = "0", |
| 2414 | .help = "Exit on a single verify failure, don't continue", |
| 2415 | .parent = "verify", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2416 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2417 | .category = FIO_OPT_C_IO, |
| 2418 | .group = FIO_OPT_G_VERIFY, |
Jens Axboe | a12a3b4 | 2007-08-09 10:20:54 +0200 | [diff] [blame] | 2419 | }, |
| 2420 | { |
Jens Axboe | b463e93 | 2011-01-12 09:03:23 +0100 | [diff] [blame] | 2421 | .name = "verify_dump", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2422 | .lname = "Verify dump", |
Jens Axboe | b463e93 | 2011-01-12 09:03:23 +0100 | [diff] [blame] | 2423 | .type = FIO_OPT_BOOL, |
| 2424 | .off1 = td_var_offset(verify_dump), |
Jens Axboe | ef71e31 | 2011-10-25 22:43:36 +0200 | [diff] [blame] | 2425 | .def = "0", |
Jens Axboe | b463e93 | 2011-01-12 09:03:23 +0100 | [diff] [blame] | 2426 | .help = "Dump contents of good and bad blocks on failure", |
| 2427 | .parent = "verify", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2428 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2429 | .category = FIO_OPT_C_IO, |
| 2430 | .group = FIO_OPT_G_VERIFY, |
Jens Axboe | b463e93 | 2011-01-12 09:03:23 +0100 | [diff] [blame] | 2431 | }, |
| 2432 | { |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 2433 | .name = "verify_async", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2434 | .lname = "Verify asynchronously", |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 2435 | .type = FIO_OPT_INT, |
| 2436 | .off1 = td_var_offset(verify_async), |
| 2437 | .def = "0", |
| 2438 | .help = "Number of async verifier threads to use", |
| 2439 | .parent = "verify", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2440 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2441 | .category = FIO_OPT_C_IO, |
| 2442 | .group = FIO_OPT_G_VERIFY, |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 2443 | }, |
Jens Axboe | 9e14418 | 2010-06-15 14:25:36 +0200 | [diff] [blame] | 2444 | { |
| 2445 | .name = "verify_backlog", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2446 | .lname = "Verify backlog", |
Jens Axboe | 9e14418 | 2010-06-15 14:25:36 +0200 | [diff] [blame] | 2447 | .type = FIO_OPT_STR_VAL, |
| 2448 | .off1 = td_var_offset(verify_backlog), |
| 2449 | .help = "Verify after this number of blocks are written", |
| 2450 | .parent = "verify", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2451 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2452 | .category = FIO_OPT_C_IO, |
| 2453 | .group = FIO_OPT_G_VERIFY, |
Jens Axboe | 9e14418 | 2010-06-15 14:25:36 +0200 | [diff] [blame] | 2454 | }, |
| 2455 | { |
| 2456 | .name = "verify_backlog_batch", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2457 | .lname = "Verify backlog batch", |
Jens Axboe | 9e14418 | 2010-06-15 14:25:36 +0200 | [diff] [blame] | 2458 | .type = FIO_OPT_INT, |
| 2459 | .off1 = td_var_offset(verify_batch), |
| 2460 | .help = "Verify this number of IO blocks", |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 2461 | .parent = "verify", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2462 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2463 | .category = FIO_OPT_C_IO, |
| 2464 | .group = FIO_OPT_G_VERIFY, |
Jens Axboe | 9e14418 | 2010-06-15 14:25:36 +0200 | [diff] [blame] | 2465 | }, |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 2466 | #ifdef FIO_HAVE_CPU_AFFINITY |
| 2467 | { |
| 2468 | .name = "verify_async_cpus", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2469 | .lname = "Async verify CPUs", |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 2470 | .type = FIO_OPT_STR, |
| 2471 | .cb = str_verify_cpus_allowed_cb, |
| 2472 | .help = "Set CPUs allowed for async verify threads", |
| 2473 | .parent = "verify_async", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2474 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2475 | .category = FIO_OPT_C_IO, |
| 2476 | .group = FIO_OPT_G_VERIFY, |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 2477 | }, |
| 2478 | #endif |
Jens Axboe | 51aa2da | 2013-01-21 10:55:02 -0700 | [diff] [blame] | 2479 | { |
| 2480 | .name = "experimental_verify", |
| 2481 | .off1 = td_var_offset(experimental_verify), |
| 2482 | .type = FIO_OPT_BOOL, |
Jens Axboe | b31eaac | 2013-01-24 15:29:58 -0700 | [diff] [blame] | 2483 | .help = "Enable experimental verification", |
Jens Axboe | 836fcc0 | 2013-01-24 09:08:45 -0700 | [diff] [blame] | 2484 | .category = FIO_OPT_C_IO, |
| 2485 | .group = FIO_OPT_G_VERIFY, |
Jens Axboe | 51aa2da | 2013-01-21 10:55:02 -0700 | [diff] [blame] | 2486 | }, |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 2487 | #ifdef FIO_HAVE_TRIM |
| 2488 | { |
| 2489 | .name = "trim_percentage", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2490 | .lname = "Trim percentage", |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 2491 | .type = FIO_OPT_INT, |
Jens Axboe | 203160d | 2012-03-29 21:17:12 +0200 | [diff] [blame] | 2492 | .off1 = td_var_offset(trim_percentage), |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2493 | .minval = 0, |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 2494 | .maxval = 100, |
| 2495 | .help = "Number of verify blocks to discard/trim", |
| 2496 | .parent = "verify", |
| 2497 | .def = "0", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2498 | .interval = 1, |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2499 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2500 | .category = FIO_OPT_C_IO, |
| 2501 | .group = FIO_OPT_G_TRIM, |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 2502 | }, |
| 2503 | { |
| 2504 | .name = "trim_verify_zero", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2505 | .lname = "Verify trim zero", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2506 | .type = FIO_OPT_BOOL, |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 2507 | .help = "Verify that trim/discarded blocks are returned as zeroes", |
| 2508 | .off1 = td_var_offset(trim_zero), |
| 2509 | .parent = "trim_percentage", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2510 | .hide = 1, |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 2511 | .def = "1", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2512 | .category = FIO_OPT_C_IO, |
| 2513 | .group = FIO_OPT_G_TRIM, |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 2514 | }, |
| 2515 | { |
| 2516 | .name = "trim_backlog", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2517 | .lname = "Trim backlog", |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 2518 | .type = FIO_OPT_STR_VAL, |
| 2519 | .off1 = td_var_offset(trim_backlog), |
| 2520 | .help = "Trim after this number of blocks are written", |
| 2521 | .parent = "trim_percentage", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2522 | .hide = 1, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2523 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2524 | .category = FIO_OPT_C_IO, |
| 2525 | .group = FIO_OPT_G_TRIM, |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 2526 | }, |
| 2527 | { |
| 2528 | .name = "trim_backlog_batch", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2529 | .lname = "Trim backlog batch", |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 2530 | .type = FIO_OPT_INT, |
| 2531 | .off1 = td_var_offset(trim_batch), |
| 2532 | .help = "Trim this number of IO blocks", |
| 2533 | .parent = "trim_percentage", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2534 | .hide = 1, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2535 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2536 | .category = FIO_OPT_C_IO, |
| 2537 | .group = FIO_OPT_G_TRIM, |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 2538 | }, |
| 2539 | #endif |
Jens Axboe | e8462bd | 2009-07-06 12:59:04 +0200 | [diff] [blame] | 2540 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2541 | .name = "write_iolog", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2542 | .lname = "Write I/O log", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2543 | .type = FIO_OPT_STR_STORE, |
| 2544 | .off1 = td_var_offset(write_iolog_file), |
| 2545 | .help = "Store IO pattern to file", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2546 | .category = FIO_OPT_C_IO, |
| 2547 | .group = FIO_OPT_G_IOLOG, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2548 | }, |
| 2549 | { |
| 2550 | .name = "read_iolog", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2551 | .lname = "Read I/O log", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2552 | .type = FIO_OPT_STR_STORE, |
| 2553 | .off1 = td_var_offset(read_iolog_file), |
| 2554 | .help = "Playback IO pattern from file", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2555 | .category = FIO_OPT_C_IO, |
| 2556 | .group = FIO_OPT_G_IOLOG, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2557 | }, |
| 2558 | { |
David Nellans | 64bbb86 | 2010-08-24 22:13:30 +0200 | [diff] [blame] | 2559 | .name = "replay_no_stall", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2560 | .lname = "Don't stall on replay", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2561 | .type = FIO_OPT_BOOL, |
David Nellans | 64bbb86 | 2010-08-24 22:13:30 +0200 | [diff] [blame] | 2562 | .off1 = td_var_offset(no_stall), |
| 2563 | .def = "0", |
Jens Axboe | 87e7a97 | 2010-08-25 09:01:25 +0200 | [diff] [blame] | 2564 | .parent = "read_iolog", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2565 | .hide = 1, |
David Nellans | 64bbb86 | 2010-08-24 22:13:30 +0200 | [diff] [blame] | 2566 | .help = "Playback IO pattern file as fast as possible without stalls", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2567 | .category = FIO_OPT_C_IO, |
| 2568 | .group = FIO_OPT_G_IOLOG, |
David Nellans | 64bbb86 | 2010-08-24 22:13:30 +0200 | [diff] [blame] | 2569 | }, |
| 2570 | { |
David Nellans | d1c46c0 | 2010-08-31 21:20:47 +0200 | [diff] [blame] | 2571 | .name = "replay_redirect", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2572 | .lname = "Redirect device for replay", |
David Nellans | d1c46c0 | 2010-08-31 21:20:47 +0200 | [diff] [blame] | 2573 | .type = FIO_OPT_STR_STORE, |
| 2574 | .off1 = td_var_offset(replay_redirect), |
| 2575 | .parent = "read_iolog", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2576 | .hide = 1, |
David Nellans | d1c46c0 | 2010-08-31 21:20:47 +0200 | [diff] [blame] | 2577 | .help = "Replay all I/O onto this device, regardless of trace device", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2578 | .category = FIO_OPT_C_IO, |
| 2579 | .group = FIO_OPT_G_IOLOG, |
David Nellans | d1c46c0 | 2010-08-31 21:20:47 +0200 | [diff] [blame] | 2580 | }, |
| 2581 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2582 | .name = "exec_prerun", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2583 | .lname = "Pre-execute runnable", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2584 | .type = FIO_OPT_STR_STORE, |
| 2585 | .off1 = td_var_offset(exec_prerun), |
| 2586 | .help = "Execute this file prior to running job", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2587 | .category = FIO_OPT_C_GENERAL, |
| 2588 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2589 | }, |
| 2590 | { |
| 2591 | .name = "exec_postrun", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2592 | .lname = "Post-execute runnable", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2593 | .type = FIO_OPT_STR_STORE, |
| 2594 | .off1 = td_var_offset(exec_postrun), |
| 2595 | .help = "Execute this file after running job", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2596 | .category = FIO_OPT_C_GENERAL, |
| 2597 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2598 | }, |
| 2599 | #ifdef FIO_HAVE_IOSCHED_SWITCH |
| 2600 | { |
| 2601 | .name = "ioscheduler", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2602 | .lname = "I/O scheduler", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2603 | .type = FIO_OPT_STR_STORE, |
| 2604 | .off1 = td_var_offset(ioscheduler), |
| 2605 | .help = "Use this IO scheduler on the backing device", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2606 | .category = FIO_OPT_C_FILE, |
| 2607 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2608 | }, |
| 2609 | #endif |
| 2610 | { |
| 2611 | .name = "zonesize", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2612 | .lname = "Zone size", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2613 | .type = FIO_OPT_STR_VAL, |
| 2614 | .off1 = td_var_offset(zone_size), |
Steven Noonan | ed33585 | 2012-01-31 13:58:00 +0100 | [diff] [blame] | 2615 | .help = "Amount of data to read per zone", |
| 2616 | .def = "0", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2617 | .interval = 1024 * 1024, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2618 | .category = FIO_OPT_C_IO, |
| 2619 | .group = FIO_OPT_G_ZONE, |
Steven Noonan | ed33585 | 2012-01-31 13:58:00 +0100 | [diff] [blame] | 2620 | }, |
| 2621 | { |
| 2622 | .name = "zonerange", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2623 | .lname = "Zone range", |
Steven Noonan | ed33585 | 2012-01-31 13:58:00 +0100 | [diff] [blame] | 2624 | .type = FIO_OPT_STR_VAL, |
| 2625 | .off1 = td_var_offset(zone_range), |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2626 | .help = "Give size of an IO zone", |
| 2627 | .def = "0", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2628 | .interval = 1024 * 1024, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2629 | .category = FIO_OPT_C_IO, |
| 2630 | .group = FIO_OPT_G_ZONE, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2631 | }, |
| 2632 | { |
| 2633 | .name = "zoneskip", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2634 | .lname = "Zone skip", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2635 | .type = FIO_OPT_STR_VAL, |
| 2636 | .off1 = td_var_offset(zone_skip), |
| 2637 | .help = "Space between IO zones", |
| 2638 | .def = "0", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2639 | .interval = 1024 * 1024, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2640 | .category = FIO_OPT_C_IO, |
| 2641 | .group = FIO_OPT_G_ZONE, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2642 | }, |
| 2643 | { |
| 2644 | .name = "lockmem", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2645 | .lname = "Lock memory", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2646 | .type = FIO_OPT_STR_VAL, |
Jens Axboe | 1b79a07 | 2012-03-28 20:50:15 +0200 | [diff] [blame] | 2647 | .off1 = td_var_offset(lockmem), |
Jens Axboe | 81c6b6c | 2013-04-10 19:30:50 +0200 | [diff] [blame] | 2648 | .help = "Lock down this amount of memory (per worker)", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2649 | .def = "0", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2650 | .interval = 1024 * 1024, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2651 | .category = FIO_OPT_C_GENERAL, |
| 2652 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2653 | }, |
| 2654 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2655 | .name = "rwmixread", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2656 | .lname = "Read/write mix read", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2657 | .type = FIO_OPT_INT, |
Jens Axboe | cb499fc | 2008-05-28 10:33:32 +0200 | [diff] [blame] | 2658 | .cb = str_rwmix_read_cb, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2659 | .maxval = 100, |
| 2660 | .help = "Percentage of mixed workload that is reads", |
| 2661 | .def = "50", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2662 | .interval = 5, |
Jens Axboe | 9026535 | 2012-03-19 20:29:44 +0100 | [diff] [blame] | 2663 | .inverse = "rwmixwrite", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2664 | .category = FIO_OPT_C_IO, |
| 2665 | .group = FIO_OPT_G_RWMIX, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2666 | }, |
| 2667 | { |
| 2668 | .name = "rwmixwrite", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2669 | .lname = "Read/write mix write", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2670 | .type = FIO_OPT_INT, |
Jens Axboe | cb499fc | 2008-05-28 10:33:32 +0200 | [diff] [blame] | 2671 | .cb = str_rwmix_write_cb, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2672 | .maxval = 100, |
| 2673 | .help = "Percentage of mixed workload that is writes", |
| 2674 | .def = "50", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2675 | .interval = 5, |
Jens Axboe | 9026535 | 2012-03-19 20:29:44 +0100 | [diff] [blame] | 2676 | .inverse = "rwmixread", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2677 | .category = FIO_OPT_C_IO, |
| 2678 | .group = FIO_OPT_G_RWMIX, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2679 | }, |
| 2680 | { |
Jens Axboe | afdf935 | 2007-07-31 16:14:34 +0200 | [diff] [blame] | 2681 | .name = "rwmixcycle", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2682 | .lname = "Read/write mix cycle", |
Jens Axboe | 15ca150 | 2008-04-07 09:26:02 +0200 | [diff] [blame] | 2683 | .type = FIO_OPT_DEPRECATED, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2684 | .category = FIO_OPT_C_IO, |
| 2685 | .group = FIO_OPT_G_RWMIX, |
Jens Axboe | afdf935 | 2007-07-31 16:14:34 +0200 | [diff] [blame] | 2686 | }, |
| 2687 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2688 | .name = "nice", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2689 | .lname = "Nice", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2690 | .type = FIO_OPT_INT, |
| 2691 | .off1 = td_var_offset(nice), |
| 2692 | .help = "Set job CPU nice value", |
| 2693 | .minval = -19, |
| 2694 | .maxval = 20, |
| 2695 | .def = "0", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2696 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2697 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | 1086005 | 2012-03-19 20:56:53 +0100 | [diff] [blame] | 2698 | .group = FIO_OPT_G_CRED, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2699 | }, |
| 2700 | #ifdef FIO_HAVE_IOPRIO |
| 2701 | { |
| 2702 | .name = "prio", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2703 | .lname = "I/O nice priority", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2704 | .type = FIO_OPT_INT, |
Jens Axboe | 28727df | 2012-03-29 08:33:15 +0200 | [diff] [blame] | 2705 | .off1 = td_var_offset(ioprio), |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2706 | .help = "Set job IO priority value", |
| 2707 | .minval = 0, |
| 2708 | .maxval = 7, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2709 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2710 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | 1086005 | 2012-03-19 20:56:53 +0100 | [diff] [blame] | 2711 | .group = FIO_OPT_G_CRED, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2712 | }, |
| 2713 | { |
| 2714 | .name = "prioclass", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2715 | .lname = "I/O nice priority class", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2716 | .type = FIO_OPT_INT, |
Jens Axboe | 28727df | 2012-03-29 08:33:15 +0200 | [diff] [blame] | 2717 | .off1 = td_var_offset(ioprio_class), |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2718 | .help = "Set job IO priority class", |
| 2719 | .minval = 0, |
| 2720 | .maxval = 3, |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 2721 | .interval = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2722 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | 1086005 | 2012-03-19 20:56:53 +0100 | [diff] [blame] | 2723 | .group = FIO_OPT_G_CRED, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2724 | }, |
| 2725 | #endif |
| 2726 | { |
| 2727 | .name = "thinktime", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2728 | .lname = "Thinktime", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2729 | .type = FIO_OPT_INT, |
| 2730 | .off1 = td_var_offset(thinktime), |
| 2731 | .help = "Idle time between IO buffers (usec)", |
| 2732 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2733 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 2734 | .group = FIO_OPT_G_THINKTIME, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2735 | }, |
| 2736 | { |
| 2737 | .name = "thinktime_spin", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2738 | .lname = "Thinktime spin", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2739 | .type = FIO_OPT_INT, |
| 2740 | .off1 = td_var_offset(thinktime_spin), |
| 2741 | .help = "Start think time by spinning this amount (usec)", |
| 2742 | .def = "0", |
Jens Axboe | afdf935 | 2007-07-31 16:14:34 +0200 | [diff] [blame] | 2743 | .parent = "thinktime", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2744 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2745 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 2746 | .group = FIO_OPT_G_THINKTIME, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2747 | }, |
| 2748 | { |
| 2749 | .name = "thinktime_blocks", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2750 | .lname = "Thinktime blocks", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2751 | .type = FIO_OPT_INT, |
| 2752 | .off1 = td_var_offset(thinktime_blocks), |
| 2753 | .help = "IO buffer period between 'thinktime'", |
| 2754 | .def = "1", |
Jens Axboe | afdf935 | 2007-07-31 16:14:34 +0200 | [diff] [blame] | 2755 | .parent = "thinktime", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2756 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2757 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 2758 | .group = FIO_OPT_G_THINKTIME, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2759 | }, |
| 2760 | { |
| 2761 | .name = "rate", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2762 | .lname = "I/O rate", |
Jens Axboe | e01b22b | 2009-06-09 15:43:25 +0200 | [diff] [blame] | 2763 | .type = FIO_OPT_INT, |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 2764 | .off1 = td_var_offset(rate[DDIR_READ]), |
| 2765 | .off2 = td_var_offset(rate[DDIR_WRITE]), |
| 2766 | .off3 = td_var_offset(rate[DDIR_TRIM]), |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2767 | .help = "Set bandwidth rate", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2768 | .category = FIO_OPT_C_IO, |
| 2769 | .group = FIO_OPT_G_RATE, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2770 | }, |
| 2771 | { |
| 2772 | .name = "ratemin", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2773 | .lname = "I/O min rate", |
Jens Axboe | e01b22b | 2009-06-09 15:43:25 +0200 | [diff] [blame] | 2774 | .type = FIO_OPT_INT, |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 2775 | .off1 = td_var_offset(ratemin[DDIR_READ]), |
| 2776 | .off2 = td_var_offset(ratemin[DDIR_WRITE]), |
| 2777 | .off3 = td_var_offset(ratemin[DDIR_TRIM]), |
Jens Axboe | 4e991c2 | 2007-03-15 11:41:11 +0100 | [diff] [blame] | 2778 | .help = "Job must meet this rate or it will be shutdown", |
Jens Axboe | afdf935 | 2007-07-31 16:14:34 +0200 | [diff] [blame] | 2779 | .parent = "rate", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2780 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2781 | .category = FIO_OPT_C_IO, |
| 2782 | .group = FIO_OPT_G_RATE, |
Jens Axboe | 4e991c2 | 2007-03-15 11:41:11 +0100 | [diff] [blame] | 2783 | }, |
| 2784 | { |
| 2785 | .name = "rate_iops", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2786 | .lname = "I/O rate IOPS", |
Jens Axboe | e01b22b | 2009-06-09 15:43:25 +0200 | [diff] [blame] | 2787 | .type = FIO_OPT_INT, |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 2788 | .off1 = td_var_offset(rate_iops[DDIR_READ]), |
| 2789 | .off2 = td_var_offset(rate_iops[DDIR_WRITE]), |
| 2790 | .off3 = td_var_offset(rate_iops[DDIR_TRIM]), |
Jens Axboe | 4e991c2 | 2007-03-15 11:41:11 +0100 | [diff] [blame] | 2791 | .help = "Limit IO used to this number of IO operations/sec", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2792 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2793 | .category = FIO_OPT_C_IO, |
| 2794 | .group = FIO_OPT_G_RATE, |
Jens Axboe | 4e991c2 | 2007-03-15 11:41:11 +0100 | [diff] [blame] | 2795 | }, |
| 2796 | { |
| 2797 | .name = "rate_iops_min", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2798 | .lname = "I/O min rate IOPS", |
Jens Axboe | e01b22b | 2009-06-09 15:43:25 +0200 | [diff] [blame] | 2799 | .type = FIO_OPT_INT, |
Shaohua Li | 6eaf09d | 2012-09-14 08:49:43 +0200 | [diff] [blame] | 2800 | .off1 = td_var_offset(rate_iops_min[DDIR_READ]), |
| 2801 | .off2 = td_var_offset(rate_iops_min[DDIR_WRITE]), |
| 2802 | .off3 = td_var_offset(rate_iops_min[DDIR_TRIM]), |
Bruce Cran | 03e20d6 | 2011-01-02 20:14:54 +0100 | [diff] [blame] | 2803 | .help = "Job must meet this rate or it will be shut down", |
Jens Axboe | afdf935 | 2007-07-31 16:14:34 +0200 | [diff] [blame] | 2804 | .parent = "rate_iops", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2805 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2806 | .category = FIO_OPT_C_IO, |
| 2807 | .group = FIO_OPT_G_RATE, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2808 | }, |
| 2809 | { |
| 2810 | .name = "ratecycle", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2811 | .lname = "I/O rate cycle", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2812 | .type = FIO_OPT_INT, |
| 2813 | .off1 = td_var_offset(ratecycle), |
| 2814 | .help = "Window average for rate limits (msec)", |
| 2815 | .def = "1000", |
Jens Axboe | afdf935 | 2007-07-31 16:14:34 +0200 | [diff] [blame] | 2816 | .parent = "rate", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2817 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2818 | .category = FIO_OPT_C_IO, |
| 2819 | .group = FIO_OPT_G_RATE, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2820 | }, |
| 2821 | { |
Jens Axboe | 1550153 | 2012-10-24 16:37:45 +0200 | [diff] [blame] | 2822 | .name = "max_latency", |
| 2823 | .type = FIO_OPT_INT, |
| 2824 | .off1 = td_var_offset(max_latency), |
| 2825 | .help = "Maximum tolerated IO latency (usec)", |
Jens Axboe | 1e5324e | 2012-11-14 14:25:31 -0700 | [diff] [blame] | 2826 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3e260a4 | 2013-12-09 12:38:53 -0700 | [diff] [blame] | 2827 | .group = FIO_OPT_G_LATPROF, |
| 2828 | }, |
| 2829 | { |
| 2830 | .name = "latency_target", |
| 2831 | .lname = "Latency Target (usec)", |
| 2832 | .type = FIO_OPT_STR_VAL_TIME, |
| 2833 | .off1 = td_var_offset(latency_target), |
| 2834 | .help = "Ramp to max queue depth supporting this latency", |
| 2835 | .category = FIO_OPT_C_IO, |
| 2836 | .group = FIO_OPT_G_LATPROF, |
| 2837 | }, |
| 2838 | { |
| 2839 | .name = "latency_window", |
| 2840 | .lname = "Latency Window (usec)", |
| 2841 | .type = FIO_OPT_STR_VAL_TIME, |
| 2842 | .off1 = td_var_offset(latency_window), |
| 2843 | .help = "Time to sustain latency_target", |
| 2844 | .category = FIO_OPT_C_IO, |
| 2845 | .group = FIO_OPT_G_LATPROF, |
| 2846 | }, |
| 2847 | { |
| 2848 | .name = "latency_percentile", |
| 2849 | .lname = "Latency Percentile", |
| 2850 | .type = FIO_OPT_FLOAT_LIST, |
| 2851 | .off1 = td_var_offset(latency_percentile), |
| 2852 | .help = "Percentile of IOs must be below latency_target", |
| 2853 | .def = "100", |
| 2854 | .maxlen = 1, |
| 2855 | .minfp = 0.0, |
| 2856 | .maxfp = 100.0, |
| 2857 | .category = FIO_OPT_C_IO, |
| 2858 | .group = FIO_OPT_G_LATPROF, |
Jens Axboe | 1550153 | 2012-10-24 16:37:45 +0200 | [diff] [blame] | 2859 | }, |
| 2860 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2861 | .name = "invalidate", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2862 | .lname = "Cache invalidate", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2863 | .type = FIO_OPT_BOOL, |
| 2864 | .off1 = td_var_offset(invalidate_cache), |
| 2865 | .help = "Invalidate buffer/page cache prior to running job", |
| 2866 | .def = "1", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2867 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 2868 | .group = FIO_OPT_G_IO_TYPE, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2869 | }, |
| 2870 | { |
| 2871 | .name = "sync", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2872 | .lname = "Synchronous I/O", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2873 | .type = FIO_OPT_BOOL, |
| 2874 | .off1 = td_var_offset(sync_io), |
| 2875 | .help = "Use O_SYNC for buffered writes", |
| 2876 | .def = "0", |
Jens Axboe | 67a1000 | 2007-07-31 23:12:16 +0200 | [diff] [blame] | 2877 | .parent = "buffered", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 2878 | .hide = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2879 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 2880 | .group = FIO_OPT_G_IO_TYPE, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2881 | }, |
| 2882 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2883 | .name = "create_serialize", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2884 | .lname = "Create serialize", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2885 | .type = FIO_OPT_BOOL, |
| 2886 | .off1 = td_var_offset(create_serialize), |
| 2887 | .help = "Serialize creating of job files", |
| 2888 | .def = "1", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2889 | .category = FIO_OPT_C_FILE, |
| 2890 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2891 | }, |
| 2892 | { |
| 2893 | .name = "create_fsync", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2894 | .lname = "Create fsync", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2895 | .type = FIO_OPT_BOOL, |
| 2896 | .off1 = td_var_offset(create_fsync), |
Bruce Cran | 03e20d6 | 2011-01-02 20:14:54 +0100 | [diff] [blame] | 2897 | .help = "fsync file after creation", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2898 | .def = "1", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2899 | .category = FIO_OPT_C_FILE, |
| 2900 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2901 | }, |
| 2902 | { |
Jens Axboe | 814452b | 2009-03-04 12:53:13 +0100 | [diff] [blame] | 2903 | .name = "create_on_open", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2904 | .lname = "Create on open", |
Jens Axboe | 814452b | 2009-03-04 12:53:13 +0100 | [diff] [blame] | 2905 | .type = FIO_OPT_BOOL, |
| 2906 | .off1 = td_var_offset(create_on_open), |
| 2907 | .help = "Create files when they are opened for IO", |
| 2908 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2909 | .category = FIO_OPT_C_FILE, |
| 2910 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 814452b | 2009-03-04 12:53:13 +0100 | [diff] [blame] | 2911 | }, |
Jens Axboe | 0b9d69e | 2009-09-11 22:29:54 +0200 | [diff] [blame] | 2912 | { |
Jens Axboe | 25460cf | 2012-05-02 13:58:02 +0200 | [diff] [blame] | 2913 | .name = "create_only", |
| 2914 | .type = FIO_OPT_BOOL, |
| 2915 | .off1 = td_var_offset(create_only), |
| 2916 | .help = "Only perform file creation phase", |
Jens Axboe | d17fda7 | 2012-05-07 09:56:00 +0200 | [diff] [blame] | 2917 | .category = FIO_OPT_C_FILE, |
Jens Axboe | 25460cf | 2012-05-02 13:58:02 +0200 | [diff] [blame] | 2918 | .def = "0", |
| 2919 | }, |
| 2920 | { |
Zhang, Yanmin | afad68f | 2009-05-20 11:30:55 +0200 | [diff] [blame] | 2921 | .name = "pre_read", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2922 | .lname = "Pre-read files", |
Zhang, Yanmin | afad68f | 2009-05-20 11:30:55 +0200 | [diff] [blame] | 2923 | .type = FIO_OPT_BOOL, |
| 2924 | .off1 = td_var_offset(pre_read), |
Bruce Cran | 03e20d6 | 2011-01-02 20:14:54 +0100 | [diff] [blame] | 2925 | .help = "Pre-read files before starting official testing", |
Zhang, Yanmin | afad68f | 2009-05-20 11:30:55 +0200 | [diff] [blame] | 2926 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2927 | .category = FIO_OPT_C_FILE, |
| 2928 | .group = FIO_OPT_G_INVALID, |
Zhang, Yanmin | afad68f | 2009-05-20 11:30:55 +0200 | [diff] [blame] | 2929 | }, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2930 | #ifdef FIO_HAVE_CPU_AFFINITY |
| 2931 | { |
| 2932 | .name = "cpumask", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2933 | .lname = "CPU mask", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2934 | .type = FIO_OPT_INT, |
| 2935 | .cb = str_cpumask_cb, |
| 2936 | .help = "CPU affinity mask", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2937 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | 1086005 | 2012-03-19 20:56:53 +0100 | [diff] [blame] | 2938 | .group = FIO_OPT_G_CRED, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2939 | }, |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 2940 | { |
| 2941 | .name = "cpus_allowed", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2942 | .lname = "CPUs allowed", |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 2943 | .type = FIO_OPT_STR, |
| 2944 | .cb = str_cpus_allowed_cb, |
| 2945 | .help = "Set CPUs allowed", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2946 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | 1086005 | 2012-03-19 20:56:53 +0100 | [diff] [blame] | 2947 | .group = FIO_OPT_G_CRED, |
Jens Axboe | d2e268b | 2007-06-15 10:33:49 +0200 | [diff] [blame] | 2948 | }, |
Jens Axboe | c2acfba | 2014-02-27 15:52:02 -0800 | [diff] [blame] | 2949 | { |
| 2950 | .name = "cpus_allowed_policy", |
| 2951 | .lname = "CPUs allowed distribution policy", |
| 2952 | .type = FIO_OPT_STR, |
| 2953 | .off1 = td_var_offset(cpus_allowed_policy), |
| 2954 | .help = "Distribution policy for cpus_allowed", |
| 2955 | .parent = "cpus_allowed", |
| 2956 | .prio = 1, |
| 2957 | .posval = { |
| 2958 | { .ival = "shared", |
| 2959 | .oval = FIO_CPUS_SHARED, |
| 2960 | .help = "Mask shared between threads", |
| 2961 | }, |
| 2962 | { .ival = "split", |
| 2963 | .oval = FIO_CPUS_SPLIT, |
| 2964 | .help = "Mask split between threads", |
| 2965 | }, |
| 2966 | }, |
| 2967 | .category = FIO_OPT_C_GENERAL, |
| 2968 | .group = FIO_OPT_G_CRED, |
| 2969 | }, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2970 | #endif |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 2971 | #ifdef CONFIG_LIBNUMA |
Yufei Ren | d0b937e | 2012-10-19 23:11:52 -0400 | [diff] [blame] | 2972 | { |
| 2973 | .name = "numa_cpu_nodes", |
| 2974 | .type = FIO_OPT_STR, |
| 2975 | .cb = str_numa_cpunodes_cb, |
| 2976 | .help = "NUMA CPU nodes bind", |
Jens Axboe | 6be54b2 | 2013-04-10 13:08:02 +0200 | [diff] [blame] | 2977 | .category = FIO_OPT_C_GENERAL, |
| 2978 | .group = FIO_OPT_G_INVALID, |
Yufei Ren | d0b937e | 2012-10-19 23:11:52 -0400 | [diff] [blame] | 2979 | }, |
| 2980 | { |
| 2981 | .name = "numa_mem_policy", |
| 2982 | .type = FIO_OPT_STR, |
| 2983 | .cb = str_numa_mpol_cb, |
| 2984 | .help = "NUMA memory policy setup", |
Jens Axboe | 6be54b2 | 2013-04-10 13:08:02 +0200 | [diff] [blame] | 2985 | .category = FIO_OPT_C_GENERAL, |
| 2986 | .group = FIO_OPT_G_INVALID, |
Yufei Ren | d0b937e | 2012-10-19 23:11:52 -0400 | [diff] [blame] | 2987 | }, |
| 2988 | #endif |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2989 | { |
| 2990 | .name = "end_fsync", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2991 | .lname = "End fsync", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2992 | .type = FIO_OPT_BOOL, |
| 2993 | .off1 = td_var_offset(end_fsync), |
| 2994 | .help = "Include fsync at the end of job", |
| 2995 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 2996 | .category = FIO_OPT_C_FILE, |
| 2997 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 2998 | }, |
| 2999 | { |
| 3000 | .name = "fsync_on_close", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3001 | .lname = "Fsync on close", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3002 | .type = FIO_OPT_BOOL, |
| 3003 | .off1 = td_var_offset(fsync_on_close), |
| 3004 | .help = "fsync files on close", |
| 3005 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3006 | .category = FIO_OPT_C_FILE, |
| 3007 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3008 | }, |
| 3009 | { |
| 3010 | .name = "unlink", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3011 | .lname = "Unlink file", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3012 | .type = FIO_OPT_BOOL, |
| 3013 | .off1 = td_var_offset(unlink), |
| 3014 | .help = "Unlink created files after job has completed", |
| 3015 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3016 | .category = FIO_OPT_C_FILE, |
| 3017 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3018 | }, |
| 3019 | { |
| 3020 | .name = "exitall", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3021 | .lname = "Exit-all on terminate", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3022 | .type = FIO_OPT_STR_SET, |
| 3023 | .cb = str_exitall_cb, |
| 3024 | .help = "Terminate all jobs when one exits", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3025 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 3026 | .group = FIO_OPT_G_PROCESS, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3027 | }, |
| 3028 | { |
| 3029 | .name = "stonewall", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3030 | .lname = "Wait for previous", |
Jens Axboe | d392365 | 2011-08-03 12:38:39 +0200 | [diff] [blame] | 3031 | .alias = "wait_for_previous", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3032 | .type = FIO_OPT_STR_SET, |
| 3033 | .off1 = td_var_offset(stonewall), |
| 3034 | .help = "Insert a hard barrier between this job and previous", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3035 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 3036 | .group = FIO_OPT_G_PROCESS, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3037 | }, |
| 3038 | { |
Jens Axboe | b3d62a7 | 2007-03-20 14:23:26 +0100 | [diff] [blame] | 3039 | .name = "new_group", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3040 | .lname = "New group", |
Jens Axboe | b3d62a7 | 2007-03-20 14:23:26 +0100 | [diff] [blame] | 3041 | .type = FIO_OPT_STR_SET, |
| 3042 | .off1 = td_var_offset(new_group), |
| 3043 | .help = "Mark the start of a new group (for reporting)", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3044 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 3045 | .group = FIO_OPT_G_PROCESS, |
Jens Axboe | b3d62a7 | 2007-03-20 14:23:26 +0100 | [diff] [blame] | 3046 | }, |
| 3047 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3048 | .name = "thread", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3049 | .lname = "Thread", |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3050 | .type = FIO_OPT_STR_SET, |
| 3051 | .off1 = td_var_offset(use_thread), |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 3052 | .help = "Use threads instead of processes", |
Jens Axboe | ef7035a | 2014-06-18 15:30:09 -0700 | [diff] [blame] | 3053 | #ifdef CONFIG_NO_SHM |
| 3054 | .def = "1", |
| 3055 | .no_warn_def = 1, |
| 3056 | #endif |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3057 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 3058 | .group = FIO_OPT_G_PROCESS, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3059 | }, |
| 3060 | { |
| 3061 | .name = "write_bw_log", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3062 | .lname = "Write bandwidth log", |
Jens Axboe | 203160d | 2012-03-29 21:17:12 +0200 | [diff] [blame] | 3063 | .type = FIO_OPT_STR_STORE, |
| 3064 | .off1 = td_var_offset(bw_log_file), |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3065 | .help = "Write log of bandwidth during run", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3066 | .category = FIO_OPT_C_LOG, |
| 3067 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3068 | }, |
| 3069 | { |
| 3070 | .name = "write_lat_log", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3071 | .lname = "Write latency log", |
Jens Axboe | 203160d | 2012-03-29 21:17:12 +0200 | [diff] [blame] | 3072 | .type = FIO_OPT_STR_STORE, |
| 3073 | .off1 = td_var_offset(lat_log_file), |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3074 | .help = "Write log of latency during run", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3075 | .category = FIO_OPT_C_LOG, |
| 3076 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3077 | }, |
| 3078 | { |
Jens Axboe | c8eeb9d | 2011-10-05 14:02:22 +0200 | [diff] [blame] | 3079 | .name = "write_iops_log", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3080 | .lname = "Write IOPS log", |
Jens Axboe | 577c83b | 2013-05-29 10:45:16 +0200 | [diff] [blame] | 3081 | .type = FIO_OPT_STR_STORE, |
Jens Axboe | 203160d | 2012-03-29 21:17:12 +0200 | [diff] [blame] | 3082 | .off1 = td_var_offset(iops_log_file), |
Jens Axboe | c8eeb9d | 2011-10-05 14:02:22 +0200 | [diff] [blame] | 3083 | .help = "Write log of IOPS during run", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3084 | .category = FIO_OPT_C_LOG, |
| 3085 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | c8eeb9d | 2011-10-05 14:02:22 +0200 | [diff] [blame] | 3086 | }, |
| 3087 | { |
Jens Axboe | b8bc8cb | 2011-12-01 09:04:31 +0100 | [diff] [blame] | 3088 | .name = "log_avg_msec", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3089 | .lname = "Log averaging (msec)", |
Jens Axboe | b8bc8cb | 2011-12-01 09:04:31 +0100 | [diff] [blame] | 3090 | .type = FIO_OPT_INT, |
| 3091 | .off1 = td_var_offset(log_avg_msec), |
| 3092 | .help = "Average bw/iops/lat logs over this period of time", |
| 3093 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3094 | .category = FIO_OPT_C_LOG, |
| 3095 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | b8bc8cb | 2011-12-01 09:04:31 +0100 | [diff] [blame] | 3096 | }, |
| 3097 | { |
Jens Axboe | ccefd5f | 2014-06-30 20:59:03 -0600 | [diff] [blame] | 3098 | .name = "log_offset", |
| 3099 | .lname = "Log offset of IO", |
| 3100 | .type = FIO_OPT_BOOL, |
| 3101 | .off1 = td_var_offset(log_offset), |
| 3102 | .help = "Include offset of IO for each log entry", |
| 3103 | .def = "0", |
| 3104 | .category = FIO_OPT_C_LOG, |
| 3105 | .group = FIO_OPT_G_INVALID, |
| 3106 | }, |
Jens Axboe | 38a812d | 2014-07-03 09:10:39 -0600 | [diff] [blame] | 3107 | #ifdef CONFIG_ZLIB |
| 3108 | { |
| 3109 | .name = "log_compression", |
| 3110 | .lname = "Log compression", |
| 3111 | .type = FIO_OPT_INT, |
| 3112 | .off1 = td_var_offset(log_gz), |
| 3113 | .help = "Log in compressed chunks of this size", |
| 3114 | .minval = 32 * 1024 * 1024ULL, |
| 3115 | .maxval = 512 * 1024 * 1024ULL, |
| 3116 | .category = FIO_OPT_C_LOG, |
| 3117 | .group = FIO_OPT_G_INVALID, |
| 3118 | }, |
Jens Axboe | bac4af1 | 2014-07-03 13:42:28 -0600 | [diff] [blame] | 3119 | { |
| 3120 | .name = "log_store_compressed", |
| 3121 | .lname = "Log store compressed", |
| 3122 | .type = FIO_OPT_BOOL, |
| 3123 | .off1 = td_var_offset(log_gz_store), |
| 3124 | .help = "Store logs in a compressed format", |
| 3125 | .category = FIO_OPT_C_LOG, |
| 3126 | .group = FIO_OPT_G_INVALID, |
| 3127 | }, |
Jens Axboe | 38a812d | 2014-07-03 09:10:39 -0600 | [diff] [blame] | 3128 | #endif |
Jens Axboe | ccefd5f | 2014-06-30 20:59:03 -0600 | [diff] [blame] | 3129 | { |
Jens Axboe | c504ee5 | 2012-03-20 11:29:09 +0100 | [diff] [blame] | 3130 | .name = "bwavgtime", |
| 3131 | .lname = "Bandwidth average time", |
| 3132 | .type = FIO_OPT_INT, |
| 3133 | .off1 = td_var_offset(bw_avg_time), |
| 3134 | .help = "Time window over which to calculate bandwidth" |
| 3135 | " (msec)", |
| 3136 | .def = "500", |
| 3137 | .parent = "write_bw_log", |
| 3138 | .hide = 1, |
| 3139 | .interval = 100, |
| 3140 | .category = FIO_OPT_C_LOG, |
| 3141 | .group = FIO_OPT_G_INVALID, |
| 3142 | }, |
| 3143 | { |
| 3144 | .name = "iopsavgtime", |
| 3145 | .lname = "IOPS average time", |
| 3146 | .type = FIO_OPT_INT, |
| 3147 | .off1 = td_var_offset(iops_avg_time), |
| 3148 | .help = "Time window over which to calculate IOPS (msec)", |
| 3149 | .def = "500", |
| 3150 | .parent = "write_iops_log", |
| 3151 | .hide = 1, |
| 3152 | .interval = 100, |
| 3153 | .category = FIO_OPT_C_LOG, |
| 3154 | .group = FIO_OPT_G_INVALID, |
| 3155 | }, |
| 3156 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3157 | .name = "group_reporting", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3158 | .lname = "Group reporting", |
Jens Axboe | d250704 | 2013-05-23 20:24:12 +0200 | [diff] [blame] | 3159 | .type = FIO_OPT_STR_SET, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3160 | .off1 = td_var_offset(group_reporting), |
| 3161 | .help = "Do reporting on a per-group basis", |
Jens Axboe | 1086005 | 2012-03-19 20:56:53 +0100 | [diff] [blame] | 3162 | .category = FIO_OPT_C_STAT, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3163 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3164 | }, |
| 3165 | { |
Jens Axboe | e9459e5 | 2007-04-17 15:46:32 +0200 | [diff] [blame] | 3166 | .name = "zero_buffers", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3167 | .lname = "Zero I/O buffers", |
Jens Axboe | e9459e5 | 2007-04-17 15:46:32 +0200 | [diff] [blame] | 3168 | .type = FIO_OPT_STR_SET, |
| 3169 | .off1 = td_var_offset(zero_buffers), |
| 3170 | .help = "Init IO buffers to all zeroes", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3171 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 3172 | .group = FIO_OPT_G_IO_BUF, |
Jens Axboe | e9459e5 | 2007-04-17 15:46:32 +0200 | [diff] [blame] | 3173 | }, |
Jens Axboe | 5973caf | 2008-05-21 19:52:35 +0200 | [diff] [blame] | 3174 | { |
| 3175 | .name = "refill_buffers", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3176 | .lname = "Refill I/O buffers", |
Jens Axboe | 5973caf | 2008-05-21 19:52:35 +0200 | [diff] [blame] | 3177 | .type = FIO_OPT_STR_SET, |
| 3178 | .off1 = td_var_offset(refill_buffers), |
| 3179 | .help = "Refill IO buffers on every IO submit", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3180 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 3181 | .group = FIO_OPT_G_IO_BUF, |
Jens Axboe | 5973caf | 2008-05-21 19:52:35 +0200 | [diff] [blame] | 3182 | }, |
Yu-ju Hong | 8334919 | 2011-08-13 00:53:44 +0200 | [diff] [blame] | 3183 | { |
Jens Axboe | fd68418 | 2011-09-19 09:24:44 +0200 | [diff] [blame] | 3184 | .name = "scramble_buffers", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3185 | .lname = "Scramble I/O buffers", |
Jens Axboe | fd68418 | 2011-09-19 09:24:44 +0200 | [diff] [blame] | 3186 | .type = FIO_OPT_BOOL, |
| 3187 | .off1 = td_var_offset(scramble_buffers), |
| 3188 | .help = "Slightly scramble buffers on every IO submit", |
| 3189 | .def = "1", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3190 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 3191 | .group = FIO_OPT_G_IO_BUF, |
Jens Axboe | fd68418 | 2011-09-19 09:24:44 +0200 | [diff] [blame] | 3192 | }, |
| 3193 | { |
Jens Axboe | ce35b1e | 2014-01-14 15:35:58 -0700 | [diff] [blame] | 3194 | .name = "buffer_pattern", |
| 3195 | .lname = "Buffer pattern", |
| 3196 | .type = FIO_OPT_STR, |
| 3197 | .cb = str_buffer_pattern_cb, |
| 3198 | .help = "Fill pattern for IO buffers", |
| 3199 | .category = FIO_OPT_C_IO, |
| 3200 | .group = FIO_OPT_G_IO_BUF, |
| 3201 | }, |
| 3202 | { |
Jens Axboe | 9c42684 | 2012-03-02 21:02:12 +0100 | [diff] [blame] | 3203 | .name = "buffer_compress_percentage", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3204 | .lname = "Buffer compression percentage", |
Jens Axboe | 9c42684 | 2012-03-02 21:02:12 +0100 | [diff] [blame] | 3205 | .type = FIO_OPT_INT, |
Jens Axboe | bedc9dc | 2014-03-17 12:51:09 -0600 | [diff] [blame] | 3206 | .cb = str_buffer_compress_cb, |
Jens Axboe | 9c42684 | 2012-03-02 21:02:12 +0100 | [diff] [blame] | 3207 | .maxval = 100, |
Peter Oberparleiter | e7f5de9 | 2014-02-20 14:20:07 +0100 | [diff] [blame] | 3208 | .minval = 0, |
Jens Axboe | 9c42684 | 2012-03-02 21:02:12 +0100 | [diff] [blame] | 3209 | .help = "How compressible the buffer is (approximately)", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 3210 | .interval = 5, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3211 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 3212 | .group = FIO_OPT_G_IO_BUF, |
Jens Axboe | 9c42684 | 2012-03-02 21:02:12 +0100 | [diff] [blame] | 3213 | }, |
| 3214 | { |
Jens Axboe | f97a43a | 2012-03-09 19:06:24 +0100 | [diff] [blame] | 3215 | .name = "buffer_compress_chunk", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3216 | .lname = "Buffer compression chunk size", |
Jens Axboe | f97a43a | 2012-03-09 19:06:24 +0100 | [diff] [blame] | 3217 | .type = FIO_OPT_INT, |
| 3218 | .off1 = td_var_offset(compress_chunk), |
Jens Axboe | 207b18e | 2012-03-09 19:11:25 +0100 | [diff] [blame] | 3219 | .parent = "buffer_compress_percentage", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 3220 | .hide = 1, |
Jens Axboe | f97a43a | 2012-03-09 19:06:24 +0100 | [diff] [blame] | 3221 | .help = "Size of compressible region in buffer", |
Jens Axboe | 20eb06b | 2012-03-16 19:57:23 +0100 | [diff] [blame] | 3222 | .interval = 256, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3223 | .category = FIO_OPT_C_IO, |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 3224 | .group = FIO_OPT_G_IO_BUF, |
Jens Axboe | f97a43a | 2012-03-09 19:06:24 +0100 | [diff] [blame] | 3225 | }, |
| 3226 | { |
Yu-ju Hong | 8334919 | 2011-08-13 00:53:44 +0200 | [diff] [blame] | 3227 | .name = "clat_percentiles", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3228 | .lname = "Completion latency percentiles", |
Yu-ju Hong | 8334919 | 2011-08-13 00:53:44 +0200 | [diff] [blame] | 3229 | .type = FIO_OPT_BOOL, |
| 3230 | .off1 = td_var_offset(clat_percentiles), |
| 3231 | .help = "Enable the reporting of completion latency percentiles", |
Jens Axboe | 467b35e | 2011-10-13 08:53:24 +0200 | [diff] [blame] | 3232 | .def = "1", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3233 | .category = FIO_OPT_C_STAT, |
| 3234 | .group = FIO_OPT_G_INVALID, |
Yu-ju Hong | 8334919 | 2011-08-13 00:53:44 +0200 | [diff] [blame] | 3235 | }, |
| 3236 | { |
| 3237 | .name = "percentile_list", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3238 | .lname = "Completion latency percentile list", |
Yu-ju Hong | 8334919 | 2011-08-13 00:53:44 +0200 | [diff] [blame] | 3239 | .type = FIO_OPT_FLOAT_LIST, |
| 3240 | .off1 = td_var_offset(percentile_list), |
Vincent Kang Fu | 435d195 | 2013-02-06 08:43:40 +0100 | [diff] [blame] | 3241 | .off2 = td_var_offset(percentile_precision), |
Yu-ju Hong | 8334919 | 2011-08-13 00:53:44 +0200 | [diff] [blame] | 3242 | .help = "Specify a custom list of percentiles to report", |
Vincent Kang Fu | fd112d3 | 2013-02-02 09:28:55 +0100 | [diff] [blame] | 3243 | .def = "1:5:10:20:30:40:50:60:70:80:90:95:99:99.5:99.9:99.95:99.99", |
Yu-ju Hong | 8334919 | 2011-08-13 00:53:44 +0200 | [diff] [blame] | 3244 | .maxlen = FIO_IO_U_LIST_MAX_LEN, |
| 3245 | .minfp = 0.0, |
| 3246 | .maxfp = 100.0, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3247 | .category = FIO_OPT_C_STAT, |
| 3248 | .group = FIO_OPT_G_INVALID, |
Yu-ju Hong | 8334919 | 2011-08-13 00:53:44 +0200 | [diff] [blame] | 3249 | }, |
| 3250 | |
Jens Axboe | 0a839f3 | 2007-04-26 09:02:34 +0200 | [diff] [blame] | 3251 | #ifdef FIO_HAVE_DISK_UTIL |
| 3252 | { |
| 3253 | .name = "disk_util", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3254 | .lname = "Disk utilization", |
Jens Axboe | 0a839f3 | 2007-04-26 09:02:34 +0200 | [diff] [blame] | 3255 | .type = FIO_OPT_BOOL, |
| 3256 | .off1 = td_var_offset(do_disk_util), |
Jens Axboe | f66ab3c | 2008-06-05 11:48:22 +0200 | [diff] [blame] | 3257 | .help = "Log disk utilization statistics", |
Jens Axboe | 0a839f3 | 2007-04-26 09:02:34 +0200 | [diff] [blame] | 3258 | .def = "1", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3259 | .category = FIO_OPT_C_STAT, |
| 3260 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 0a839f3 | 2007-04-26 09:02:34 +0200 | [diff] [blame] | 3261 | }, |
| 3262 | #endif |
Jens Axboe | e9459e5 | 2007-04-17 15:46:32 +0200 | [diff] [blame] | 3263 | { |
Jens Axboe | 993bf48 | 2008-11-14 13:04:53 +0100 | [diff] [blame] | 3264 | .name = "gtod_reduce", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3265 | .lname = "Reduce gettimeofday() calls", |
Jens Axboe | 993bf48 | 2008-11-14 13:04:53 +0100 | [diff] [blame] | 3266 | .type = FIO_OPT_BOOL, |
| 3267 | .help = "Greatly reduce number of gettimeofday() calls", |
| 3268 | .cb = str_gtod_reduce_cb, |
| 3269 | .def = "0", |
Jens Axboe | a4ed77f | 2012-03-20 10:19:44 +0100 | [diff] [blame] | 3270 | .hide_on_set = 1, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3271 | .category = FIO_OPT_C_STAT, |
| 3272 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 993bf48 | 2008-11-14 13:04:53 +0100 | [diff] [blame] | 3273 | }, |
| 3274 | { |
Jens Axboe | 02af098 | 2010-06-24 09:59:34 +0200 | [diff] [blame] | 3275 | .name = "disable_lat", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3276 | .lname = "Disable all latency stats", |
Jens Axboe | 02af098 | 2010-06-24 09:59:34 +0200 | [diff] [blame] | 3277 | .type = FIO_OPT_BOOL, |
| 3278 | .off1 = td_var_offset(disable_lat), |
| 3279 | .help = "Disable latency numbers", |
| 3280 | .parent = "gtod_reduce", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 3281 | .hide = 1, |
Jens Axboe | 02af098 | 2010-06-24 09:59:34 +0200 | [diff] [blame] | 3282 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3283 | .category = FIO_OPT_C_STAT, |
| 3284 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 02af098 | 2010-06-24 09:59:34 +0200 | [diff] [blame] | 3285 | }, |
| 3286 | { |
Jens Axboe | 9520ebb | 2008-10-16 21:03:27 +0200 | [diff] [blame] | 3287 | .name = "disable_clat", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3288 | .lname = "Disable completion latency stats", |
Jens Axboe | 9520ebb | 2008-10-16 21:03:27 +0200 | [diff] [blame] | 3289 | .type = FIO_OPT_BOOL, |
| 3290 | .off1 = td_var_offset(disable_clat), |
| 3291 | .help = "Disable completion latency numbers", |
Jens Axboe | 993bf48 | 2008-11-14 13:04:53 +0100 | [diff] [blame] | 3292 | .parent = "gtod_reduce", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 3293 | .hide = 1, |
Jens Axboe | 9520ebb | 2008-10-16 21:03:27 +0200 | [diff] [blame] | 3294 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3295 | .category = FIO_OPT_C_STAT, |
| 3296 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 9520ebb | 2008-10-16 21:03:27 +0200 | [diff] [blame] | 3297 | }, |
| 3298 | { |
| 3299 | .name = "disable_slat", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3300 | .lname = "Disable submission latency stats", |
Jens Axboe | 9520ebb | 2008-10-16 21:03:27 +0200 | [diff] [blame] | 3301 | .type = FIO_OPT_BOOL, |
| 3302 | .off1 = td_var_offset(disable_slat), |
Bruce Cran | 03e20d6 | 2011-01-02 20:14:54 +0100 | [diff] [blame] | 3303 | .help = "Disable submission latency numbers", |
Jens Axboe | 993bf48 | 2008-11-14 13:04:53 +0100 | [diff] [blame] | 3304 | .parent = "gtod_reduce", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 3305 | .hide = 1, |
Jens Axboe | 9520ebb | 2008-10-16 21:03:27 +0200 | [diff] [blame] | 3306 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3307 | .category = FIO_OPT_C_STAT, |
| 3308 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 9520ebb | 2008-10-16 21:03:27 +0200 | [diff] [blame] | 3309 | }, |
| 3310 | { |
| 3311 | .name = "disable_bw_measurement", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3312 | .lname = "Disable bandwidth stats", |
Jens Axboe | 9520ebb | 2008-10-16 21:03:27 +0200 | [diff] [blame] | 3313 | .type = FIO_OPT_BOOL, |
| 3314 | .off1 = td_var_offset(disable_bw), |
| 3315 | .help = "Disable bandwidth logging", |
Jens Axboe | 993bf48 | 2008-11-14 13:04:53 +0100 | [diff] [blame] | 3316 | .parent = "gtod_reduce", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 3317 | .hide = 1, |
Jens Axboe | 9520ebb | 2008-10-16 21:03:27 +0200 | [diff] [blame] | 3318 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3319 | .category = FIO_OPT_C_STAT, |
| 3320 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 9520ebb | 2008-10-16 21:03:27 +0200 | [diff] [blame] | 3321 | }, |
| 3322 | { |
Jens Axboe | be4ecfd | 2008-12-08 14:10:52 +0100 | [diff] [blame] | 3323 | .name = "gtod_cpu", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3324 | .lname = "Dedicated gettimeofday() CPU", |
Jens Axboe | be4ecfd | 2008-12-08 14:10:52 +0100 | [diff] [blame] | 3325 | .type = FIO_OPT_INT, |
| 3326 | .cb = str_gtod_cpu_cb, |
Bruce Cran | 03e20d6 | 2011-01-02 20:14:54 +0100 | [diff] [blame] | 3327 | .help = "Set up dedicated gettimeofday() thread on this CPU", |
Jens Axboe | 29d43ff | 2009-07-01 10:42:18 +0200 | [diff] [blame] | 3328 | .verify = gtod_cpu_verify, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3329 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | 1086005 | 2012-03-19 20:56:53 +0100 | [diff] [blame] | 3330 | .group = FIO_OPT_G_CLOCK, |
Jens Axboe | be4ecfd | 2008-12-08 14:10:52 +0100 | [diff] [blame] | 3331 | }, |
| 3332 | { |
Jens Axboe | 771e58b | 2013-01-30 12:56:23 +0100 | [diff] [blame] | 3333 | .name = "unified_rw_reporting", |
| 3334 | .type = FIO_OPT_BOOL, |
| 3335 | .off1 = td_var_offset(unified_rw_rep), |
| 3336 | .help = "Unify reporting across data direction", |
| 3337 | .def = "0", |
Jens Axboe | 90b7a96 | 2013-02-04 12:51:09 +0100 | [diff] [blame] | 3338 | .category = FIO_OPT_C_GENERAL, |
| 3339 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 771e58b | 2013-01-30 12:56:23 +0100 | [diff] [blame] | 3340 | }, |
| 3341 | { |
Radha Ramachandran | f2bba18 | 2009-06-15 08:40:16 +0200 | [diff] [blame] | 3342 | .name = "continue_on_error", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3343 | .lname = "Continue on error", |
Steven Lang | 0684202 | 2011-11-17 09:45:17 +0100 | [diff] [blame] | 3344 | .type = FIO_OPT_STR, |
Radha Ramachandran | f2bba18 | 2009-06-15 08:40:16 +0200 | [diff] [blame] | 3345 | .off1 = td_var_offset(continue_on_error), |
Bruce Cran | 03e20d6 | 2011-01-02 20:14:54 +0100 | [diff] [blame] | 3346 | .help = "Continue on non-fatal errors during IO", |
Steven Lang | 0684202 | 2011-11-17 09:45:17 +0100 | [diff] [blame] | 3347 | .def = "none", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3348 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | bc3f552 | 2012-09-27 19:28:11 +0200 | [diff] [blame] | 3349 | .group = FIO_OPT_G_ERR, |
Steven Lang | 0684202 | 2011-11-17 09:45:17 +0100 | [diff] [blame] | 3350 | .posval = { |
| 3351 | { .ival = "none", |
| 3352 | .oval = ERROR_TYPE_NONE, |
| 3353 | .help = "Exit when an error is encountered", |
| 3354 | }, |
| 3355 | { .ival = "read", |
| 3356 | .oval = ERROR_TYPE_READ, |
| 3357 | .help = "Continue on read errors only", |
| 3358 | }, |
| 3359 | { .ival = "write", |
| 3360 | .oval = ERROR_TYPE_WRITE, |
| 3361 | .help = "Continue on write errors only", |
| 3362 | }, |
| 3363 | { .ival = "io", |
| 3364 | .oval = ERROR_TYPE_READ | ERROR_TYPE_WRITE, |
| 3365 | .help = "Continue on any IO errors", |
| 3366 | }, |
| 3367 | { .ival = "verify", |
| 3368 | .oval = ERROR_TYPE_VERIFY, |
| 3369 | .help = "Continue on verify errors only", |
| 3370 | }, |
| 3371 | { .ival = "all", |
| 3372 | .oval = ERROR_TYPE_ANY, |
| 3373 | .help = "Continue on all io and verify errors", |
| 3374 | }, |
| 3375 | { .ival = "0", |
| 3376 | .oval = ERROR_TYPE_NONE, |
| 3377 | .help = "Alias for 'none'", |
| 3378 | }, |
| 3379 | { .ival = "1", |
| 3380 | .oval = ERROR_TYPE_ANY, |
| 3381 | .help = "Alias for 'all'", |
| 3382 | }, |
| 3383 | }, |
Radha Ramachandran | f2bba18 | 2009-06-15 08:40:16 +0200 | [diff] [blame] | 3384 | }, |
| 3385 | { |
Dmitry Monakhov | 8b28bd4 | 2012-09-23 15:46:09 +0400 | [diff] [blame] | 3386 | .name = "ignore_error", |
| 3387 | .type = FIO_OPT_STR, |
| 3388 | .cb = str_ignore_error_cb, |
| 3389 | .help = "Set a specific list of errors to ignore", |
| 3390 | .parent = "rw", |
Jens Axboe | a94eb99 | 2012-09-24 18:46:34 +0200 | [diff] [blame] | 3391 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | bc3f552 | 2012-09-27 19:28:11 +0200 | [diff] [blame] | 3392 | .group = FIO_OPT_G_ERR, |
Dmitry Monakhov | 8b28bd4 | 2012-09-23 15:46:09 +0400 | [diff] [blame] | 3393 | }, |
| 3394 | { |
| 3395 | .name = "error_dump", |
| 3396 | .type = FIO_OPT_BOOL, |
| 3397 | .off1 = td_var_offset(error_dump), |
| 3398 | .def = "0", |
| 3399 | .help = "Dump info on each error", |
Jens Axboe | a94eb99 | 2012-09-24 18:46:34 +0200 | [diff] [blame] | 3400 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | bc3f552 | 2012-09-27 19:28:11 +0200 | [diff] [blame] | 3401 | .group = FIO_OPT_G_ERR, |
Dmitry Monakhov | 8b28bd4 | 2012-09-23 15:46:09 +0400 | [diff] [blame] | 3402 | }, |
Dmitry Monakhov | 8b28bd4 | 2012-09-23 15:46:09 +0400 | [diff] [blame] | 3403 | { |
Jens Axboe | 9ac8a79 | 2009-11-13 21:23:07 +0100 | [diff] [blame] | 3404 | .name = "profile", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3405 | .lname = "Profile", |
Jens Axboe | 79d1631 | 2010-03-04 12:43:20 +0100 | [diff] [blame] | 3406 | .type = FIO_OPT_STR_STORE, |
Jens Axboe | 9ac8a79 | 2009-11-13 21:23:07 +0100 | [diff] [blame] | 3407 | .off1 = td_var_offset(profile), |
Jens Axboe | 9ac8a79 | 2009-11-13 21:23:07 +0100 | [diff] [blame] | 3408 | .help = "Select a specific builtin performance test", |
Jens Axboe | 13fca82 | 2012-03-31 13:55:54 +0200 | [diff] [blame] | 3409 | .category = FIO_OPT_C_PROFILE, |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3410 | .group = FIO_OPT_G_INVALID, |
Jens Axboe | 9ac8a79 | 2009-11-13 21:23:07 +0100 | [diff] [blame] | 3411 | }, |
| 3412 | { |
Jens Axboe | a696fa2 | 2009-12-04 10:05:02 +0100 | [diff] [blame] | 3413 | .name = "cgroup", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3414 | .lname = "Cgroup", |
Jens Axboe | a696fa2 | 2009-12-04 10:05:02 +0100 | [diff] [blame] | 3415 | .type = FIO_OPT_STR_STORE, |
| 3416 | .off1 = td_var_offset(cgroup), |
| 3417 | .help = "Add job to cgroup of this name", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3418 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 3419 | .group = FIO_OPT_G_CGROUP, |
| 3420 | }, |
| 3421 | { |
| 3422 | .name = "cgroup_nodelete", |
| 3423 | .lname = "Cgroup no-delete", |
| 3424 | .type = FIO_OPT_BOOL, |
| 3425 | .off1 = td_var_offset(cgroup_nodelete), |
| 3426 | .help = "Do not delete cgroups after job completion", |
| 3427 | .def = "0", |
| 3428 | .parent = "cgroup", |
| 3429 | .category = FIO_OPT_C_GENERAL, |
| 3430 | .group = FIO_OPT_G_CGROUP, |
Jens Axboe | a696fa2 | 2009-12-04 10:05:02 +0100 | [diff] [blame] | 3431 | }, |
| 3432 | { |
| 3433 | .name = "cgroup_weight", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3434 | .lname = "Cgroup weight", |
Jens Axboe | a696fa2 | 2009-12-04 10:05:02 +0100 | [diff] [blame] | 3435 | .type = FIO_OPT_INT, |
| 3436 | .off1 = td_var_offset(cgroup_weight), |
| 3437 | .help = "Use given weight for cgroup", |
| 3438 | .minval = 100, |
| 3439 | .maxval = 1000, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 3440 | .parent = "cgroup", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3441 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 3442 | .group = FIO_OPT_G_CGROUP, |
Vivek Goyal | 7de8709 | 2010-03-31 22:55:15 +0200 | [diff] [blame] | 3443 | }, |
| 3444 | { |
Jens Axboe | e0b0d89 | 2009-12-08 10:10:14 +0100 | [diff] [blame] | 3445 | .name = "uid", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3446 | .lname = "User ID", |
Jens Axboe | e0b0d89 | 2009-12-08 10:10:14 +0100 | [diff] [blame] | 3447 | .type = FIO_OPT_INT, |
| 3448 | .off1 = td_var_offset(uid), |
| 3449 | .help = "Run job with this user ID", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3450 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | 1086005 | 2012-03-19 20:56:53 +0100 | [diff] [blame] | 3451 | .group = FIO_OPT_G_CRED, |
Jens Axboe | e0b0d89 | 2009-12-08 10:10:14 +0100 | [diff] [blame] | 3452 | }, |
| 3453 | { |
| 3454 | .name = "gid", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3455 | .lname = "Group ID", |
Jens Axboe | e0b0d89 | 2009-12-08 10:10:14 +0100 | [diff] [blame] | 3456 | .type = FIO_OPT_INT, |
| 3457 | .off1 = td_var_offset(gid), |
| 3458 | .help = "Run job with this group ID", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3459 | .category = FIO_OPT_C_GENERAL, |
Jens Axboe | 1086005 | 2012-03-19 20:56:53 +0100 | [diff] [blame] | 3460 | .group = FIO_OPT_G_CRED, |
Jens Axboe | e0b0d89 | 2009-12-08 10:10:14 +0100 | [diff] [blame] | 3461 | }, |
| 3462 | { |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 3463 | .name = "kb_base", |
| 3464 | .lname = "KB Base", |
| 3465 | .type = FIO_OPT_INT, |
| 3466 | .off1 = td_var_offset(kb_base), |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 3467 | .prio = 1, |
| 3468 | .def = "1024", |
Jens Axboe | ba9c721 | 2013-04-10 11:12:21 +0200 | [diff] [blame] | 3469 | .posval = { |
| 3470 | { .ival = "1024", |
| 3471 | .oval = 1024, |
| 3472 | .help = "Use 1024 as the K base", |
| 3473 | }, |
| 3474 | { .ival = "1000", |
| 3475 | .oval = 1000, |
| 3476 | .help = "Use 1000 as the K base", |
| 3477 | }, |
| 3478 | }, |
Jens Axboe | a1f6afe | 2012-03-19 20:44:33 +0100 | [diff] [blame] | 3479 | .help = "How many bytes per KB for reporting (1000 or 1024)", |
| 3480 | .category = FIO_OPT_C_GENERAL, |
| 3481 | .group = FIO_OPT_G_INVALID, |
| 3482 | }, |
| 3483 | { |
Jens Axboe | cf3a051 | 2013-04-09 20:38:32 +0200 | [diff] [blame] | 3484 | .name = "unit_base", |
Jens Axboe | ba9c721 | 2013-04-10 11:12:21 +0200 | [diff] [blame] | 3485 | .lname = "Base unit for reporting (Bits or Bytes)", |
Jens Axboe | cf3a051 | 2013-04-09 20:38:32 +0200 | [diff] [blame] | 3486 | .type = FIO_OPT_INT, |
| 3487 | .off1 = td_var_offset(unit_base), |
Jens Axboe | cf3a051 | 2013-04-09 20:38:32 +0200 | [diff] [blame] | 3488 | .prio = 1, |
Jens Axboe | 71a0825 | 2013-04-09 20:49:45 +0200 | [diff] [blame] | 3489 | .posval = { |
| 3490 | { .ival = "0", |
| 3491 | .oval = 0, |
| 3492 | .help = "Auto-detect", |
| 3493 | }, |
| 3494 | { .ival = "8", |
| 3495 | .oval = 8, |
| 3496 | .help = "Normal (byte based)", |
| 3497 | }, |
| 3498 | { .ival = "1", |
| 3499 | .oval = 1, |
| 3500 | .help = "Bit based", |
| 3501 | }, |
| 3502 | }, |
Jens Axboe | cf3a051 | 2013-04-09 20:38:32 +0200 | [diff] [blame] | 3503 | .help = "Bit multiple of result summary data (8 for byte, 1 for bit)", |
| 3504 | .category = FIO_OPT_C_GENERAL, |
| 3505 | .group = FIO_OPT_G_INVALID, |
| 3506 | }, |
| 3507 | { |
Jens Axboe | 3ceb458 | 2012-03-19 21:27:02 +0100 | [diff] [blame] | 3508 | .name = "hugepage-size", |
| 3509 | .lname = "Hugepage size", |
| 3510 | .type = FIO_OPT_INT, |
| 3511 | .off1 = td_var_offset(hugepage_size), |
| 3512 | .help = "When using hugepages, specify size of each page", |
| 3513 | .def = __fio_stringify(FIO_HUGE_PAGE), |
| 3514 | .interval = 1024 * 1024, |
| 3515 | .category = FIO_OPT_C_GENERAL, |
| 3516 | .group = FIO_OPT_G_INVALID, |
| 3517 | }, |
| 3518 | { |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 3519 | .name = "flow_id", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3520 | .lname = "I/O flow ID", |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 3521 | .type = FIO_OPT_INT, |
| 3522 | .off1 = td_var_offset(flow_id), |
| 3523 | .help = "The flow index ID to use", |
| 3524 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3525 | .category = FIO_OPT_C_IO, |
| 3526 | .group = FIO_OPT_G_IO_FLOW, |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 3527 | }, |
| 3528 | { |
| 3529 | .name = "flow", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3530 | .lname = "I/O flow weight", |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 3531 | .type = FIO_OPT_INT, |
| 3532 | .off1 = td_var_offset(flow), |
| 3533 | .help = "Weight for flow control of this job", |
| 3534 | .parent = "flow_id", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 3535 | .hide = 1, |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 3536 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3537 | .category = FIO_OPT_C_IO, |
| 3538 | .group = FIO_OPT_G_IO_FLOW, |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 3539 | }, |
| 3540 | { |
| 3541 | .name = "flow_watermark", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3542 | .lname = "I/O flow watermark", |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 3543 | .type = FIO_OPT_INT, |
| 3544 | .off1 = td_var_offset(flow_watermark), |
| 3545 | .help = "High watermark for flow control. This option" |
| 3546 | " should be set to the same value for all threads" |
| 3547 | " with non-zero flow.", |
| 3548 | .parent = "flow_id", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 3549 | .hide = 1, |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 3550 | .def = "1024", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3551 | .category = FIO_OPT_C_IO, |
| 3552 | .group = FIO_OPT_G_IO_FLOW, |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 3553 | }, |
| 3554 | { |
| 3555 | .name = "flow_sleep", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3556 | .lname = "I/O flow sleep", |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 3557 | .type = FIO_OPT_INT, |
| 3558 | .off1 = td_var_offset(flow_sleep), |
| 3559 | .help = "How many microseconds to sleep after being held" |
| 3560 | " back by the flow control mechanism", |
| 3561 | .parent = "flow_id", |
Jens Axboe | d71c154 | 2012-03-16 20:16:59 +0100 | [diff] [blame] | 3562 | .hide = 1, |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 3563 | .def = "0", |
Jens Axboe | e8b0e95 | 2012-03-19 14:37:08 +0100 | [diff] [blame] | 3564 | .category = FIO_OPT_C_IO, |
| 3565 | .group = FIO_OPT_G_IO_FLOW, |
Dan Ehrenberg | 9e684a4 | 2012-02-20 11:05:14 +0100 | [diff] [blame] | 3566 | }, |
| 3567 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3568 | .name = NULL, |
| 3569 | }, |
| 3570 | }; |
| 3571 | |
Jens Axboe | 17af15d | 2010-04-13 10:38:16 +0200 | [diff] [blame] | 3572 | static void add_to_lopt(struct option *lopt, struct fio_option *o, |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3573 | const char *name, int val) |
Jens Axboe | 9f81736 | 2010-03-04 14:38:10 +0100 | [diff] [blame] | 3574 | { |
Jens Axboe | 17af15d | 2010-04-13 10:38:16 +0200 | [diff] [blame] | 3575 | lopt->name = (char *) name; |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3576 | lopt->val = val; |
Jens Axboe | 9f81736 | 2010-03-04 14:38:10 +0100 | [diff] [blame] | 3577 | if (o->type == FIO_OPT_STR_SET) |
Jens Axboe | ff52be3 | 2013-11-26 20:19:59 -0700 | [diff] [blame] | 3578 | lopt->has_arg = optional_argument; |
Jens Axboe | 9f81736 | 2010-03-04 14:38:10 +0100 | [diff] [blame] | 3579 | else |
| 3580 | lopt->has_arg = required_argument; |
| 3581 | } |
| 3582 | |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3583 | static void options_to_lopts(struct fio_option *opts, |
| 3584 | struct option *long_options, |
| 3585 | int i, int option_type) |
| 3586 | { |
| 3587 | struct fio_option *o = &opts[0]; |
| 3588 | while (o->name) { |
| 3589 | add_to_lopt(&long_options[i], o, o->name, option_type); |
| 3590 | if (o->alias) { |
| 3591 | i++; |
| 3592 | add_to_lopt(&long_options[i], o, o->alias, option_type); |
| 3593 | } |
| 3594 | |
| 3595 | i++; |
| 3596 | o++; |
| 3597 | assert(i < FIO_NR_OPTIONS); |
| 3598 | } |
| 3599 | } |
| 3600 | |
| 3601 | void fio_options_set_ioengine_opts(struct option *long_options, |
| 3602 | struct thread_data *td) |
| 3603 | { |
| 3604 | unsigned int i; |
| 3605 | |
| 3606 | i = 0; |
| 3607 | while (long_options[i].name) { |
| 3608 | if (long_options[i].val == FIO_GETOPT_IOENGINE) { |
| 3609 | memset(&long_options[i], 0, sizeof(*long_options)); |
| 3610 | break; |
| 3611 | } |
| 3612 | i++; |
| 3613 | } |
| 3614 | |
| 3615 | /* |
| 3616 | * Just clear out the prior ioengine options. |
| 3617 | */ |
| 3618 | if (!td || !td->eo) |
| 3619 | return; |
| 3620 | |
| 3621 | options_to_lopts(td->io_ops->options, long_options, i, |
| 3622 | FIO_GETOPT_IOENGINE); |
| 3623 | } |
| 3624 | |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3625 | void fio_options_dup_and_init(struct option *long_options) |
| 3626 | { |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3627 | unsigned int i; |
| 3628 | |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 3629 | options_init(fio_options); |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3630 | |
| 3631 | i = 0; |
| 3632 | while (long_options[i].name) |
| 3633 | i++; |
| 3634 | |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 3635 | options_to_lopts(fio_options, long_options, i, FIO_GETOPT_JOB); |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3636 | } |
| 3637 | |
Jens Axboe | 74929ac | 2009-08-05 11:42:37 +0200 | [diff] [blame] | 3638 | struct fio_keyword { |
| 3639 | const char *word; |
| 3640 | const char *desc; |
| 3641 | char *replace; |
| 3642 | }; |
| 3643 | |
| 3644 | static struct fio_keyword fio_keywords[] = { |
| 3645 | { |
| 3646 | .word = "$pagesize", |
| 3647 | .desc = "Page size in the system", |
| 3648 | }, |
| 3649 | { |
| 3650 | .word = "$mb_memory", |
| 3651 | .desc = "Megabytes of memory online", |
| 3652 | }, |
| 3653 | { |
| 3654 | .word = "$ncpus", |
| 3655 | .desc = "Number of CPUs online in the system", |
| 3656 | }, |
| 3657 | { |
| 3658 | .word = NULL, |
| 3659 | }, |
| 3660 | }; |
| 3661 | |
| 3662 | void fio_keywords_init(void) |
| 3663 | { |
Jens Axboe | 3b2e146 | 2009-12-15 08:58:10 +0100 | [diff] [blame] | 3664 | unsigned long long mb_memory; |
Jens Axboe | 74929ac | 2009-08-05 11:42:37 +0200 | [diff] [blame] | 3665 | char buf[128]; |
| 3666 | long l; |
| 3667 | |
Jens Axboe | a4cfc47 | 2012-10-09 10:30:48 -0600 | [diff] [blame] | 3668 | sprintf(buf, "%lu", (unsigned long) page_size); |
Jens Axboe | 74929ac | 2009-08-05 11:42:37 +0200 | [diff] [blame] | 3669 | fio_keywords[0].replace = strdup(buf); |
| 3670 | |
Jens Axboe | 8eb016d | 2011-07-11 10:24:20 +0200 | [diff] [blame] | 3671 | mb_memory = os_phys_mem() / (1024 * 1024); |
Jens Axboe | 3b2e146 | 2009-12-15 08:58:10 +0100 | [diff] [blame] | 3672 | sprintf(buf, "%llu", mb_memory); |
Jens Axboe | 74929ac | 2009-08-05 11:42:37 +0200 | [diff] [blame] | 3673 | fio_keywords[1].replace = strdup(buf); |
| 3674 | |
Jens Axboe | c00a228 | 2011-07-08 20:56:06 +0200 | [diff] [blame] | 3675 | l = cpus_online(); |
Jens Axboe | 74929ac | 2009-08-05 11:42:37 +0200 | [diff] [blame] | 3676 | sprintf(buf, "%lu", l); |
| 3677 | fio_keywords[2].replace = strdup(buf); |
| 3678 | } |
| 3679 | |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3680 | #define BC_APP "bc" |
| 3681 | |
| 3682 | static char *bc_calc(char *str) |
| 3683 | { |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3684 | char buf[128], *tmp; |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3685 | FILE *f; |
| 3686 | int ret; |
| 3687 | |
| 3688 | /* |
| 3689 | * No math, just return string |
| 3690 | */ |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3691 | if ((!strchr(str, '+') && !strchr(str, '-') && !strchr(str, '*') && |
| 3692 | !strchr(str, '/')) || strchr(str, '\'')) |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3693 | return str; |
| 3694 | |
| 3695 | /* |
| 3696 | * Split option from value, we only need to calculate the value |
| 3697 | */ |
| 3698 | tmp = strchr(str, '='); |
| 3699 | if (!tmp) |
| 3700 | return str; |
| 3701 | |
| 3702 | tmp++; |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3703 | |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3704 | /* |
| 3705 | * Prevent buffer overflows; such a case isn't reasonable anyway |
| 3706 | */ |
| 3707 | if (strlen(str) >= 128 || strlen(tmp) > 100) |
| 3708 | return str; |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3709 | |
| 3710 | sprintf(buf, "which %s > /dev/null", BC_APP); |
| 3711 | if (system(buf)) { |
| 3712 | log_err("fio: bc is needed for performing math\n"); |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3713 | return NULL; |
| 3714 | } |
| 3715 | |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3716 | sprintf(buf, "echo '%s' | %s", tmp, BC_APP); |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3717 | f = popen(buf, "r"); |
Jens Axboe | 3c3ed07 | 2012-03-27 09:12:39 +0200 | [diff] [blame] | 3718 | if (!f) |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3719 | return NULL; |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3720 | |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3721 | ret = fread(&buf[tmp - str], 1, 128 - (tmp - str), f); |
Jens Axboe | 1d824f3 | 2014-04-11 11:27:34 -0600 | [diff] [blame] | 3722 | if (ret <= 0) { |
| 3723 | pclose(f); |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3724 | return NULL; |
Jens Axboe | 1d824f3 | 2014-04-11 11:27:34 -0600 | [diff] [blame] | 3725 | } |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3726 | |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3727 | pclose(f); |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3728 | buf[(tmp - str) + ret - 1] = '\0'; |
| 3729 | memcpy(buf, str, tmp - str); |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3730 | free(str); |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3731 | return strdup(buf); |
| 3732 | } |
| 3733 | |
| 3734 | /* |
| 3735 | * Return a copy of the input string with substrings of the form ${VARNAME} |
| 3736 | * substituted with the value of the environment variable VARNAME. The |
| 3737 | * substitution always occurs, even if VARNAME is empty or the corresponding |
| 3738 | * environment variable undefined. |
| 3739 | */ |
| 3740 | static char *option_dup_subs(const char *opt) |
| 3741 | { |
| 3742 | char out[OPT_LEN_MAX+1]; |
| 3743 | char in[OPT_LEN_MAX+1]; |
| 3744 | char *outptr = out; |
| 3745 | char *inptr = in; |
| 3746 | char *ch1, *ch2, *env; |
| 3747 | ssize_t nchr = OPT_LEN_MAX; |
| 3748 | size_t envlen; |
| 3749 | |
| 3750 | if (strlen(opt) + 1 > OPT_LEN_MAX) { |
| 3751 | log_err("OPT_LEN_MAX (%d) is too small\n", OPT_LEN_MAX); |
| 3752 | return NULL; |
| 3753 | } |
| 3754 | |
| 3755 | in[OPT_LEN_MAX] = '\0'; |
| 3756 | strncpy(in, opt, OPT_LEN_MAX); |
| 3757 | |
| 3758 | while (*inptr && nchr > 0) { |
| 3759 | if (inptr[0] == '$' && inptr[1] == '{') { |
| 3760 | ch2 = strchr(inptr, '}'); |
| 3761 | if (ch2 && inptr+1 < ch2) { |
| 3762 | ch1 = inptr+2; |
| 3763 | inptr = ch2+1; |
| 3764 | *ch2 = '\0'; |
| 3765 | |
| 3766 | env = getenv(ch1); |
| 3767 | if (env) { |
| 3768 | envlen = strlen(env); |
| 3769 | if (envlen <= nchr) { |
| 3770 | memcpy(outptr, env, envlen); |
| 3771 | outptr += envlen; |
| 3772 | nchr -= envlen; |
| 3773 | } |
| 3774 | } |
| 3775 | |
| 3776 | continue; |
| 3777 | } |
| 3778 | } |
| 3779 | |
| 3780 | *outptr++ = *inptr++; |
| 3781 | --nchr; |
| 3782 | } |
| 3783 | |
| 3784 | *outptr = '\0'; |
| 3785 | return strdup(out); |
Jens Axboe | 892a6ff | 2009-11-13 12:19:49 +0100 | [diff] [blame] | 3786 | } |
| 3787 | |
Jens Axboe | 74929ac | 2009-08-05 11:42:37 +0200 | [diff] [blame] | 3788 | /* |
| 3789 | * Look for reserved variable names and replace them with real values |
| 3790 | */ |
| 3791 | static char *fio_keyword_replace(char *opt) |
| 3792 | { |
| 3793 | char *s; |
| 3794 | int i; |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3795 | int docalc = 0; |
Jens Axboe | 74929ac | 2009-08-05 11:42:37 +0200 | [diff] [blame] | 3796 | |
| 3797 | for (i = 0; fio_keywords[i].word != NULL; i++) { |
| 3798 | struct fio_keyword *kw = &fio_keywords[i]; |
| 3799 | |
| 3800 | while ((s = strstr(opt, kw->word)) != NULL) { |
| 3801 | char *new = malloc(strlen(opt) + 1); |
| 3802 | char *o_org = opt; |
| 3803 | int olen = s - opt; |
| 3804 | int len; |
| 3805 | |
| 3806 | /* |
| 3807 | * Copy part of the string before the keyword and |
| 3808 | * sprintf() the replacement after it. |
| 3809 | */ |
| 3810 | memcpy(new, opt, olen); |
| 3811 | len = sprintf(new + olen, "%s", kw->replace); |
| 3812 | |
| 3813 | /* |
| 3814 | * If there's more in the original string, copy that |
| 3815 | * in too |
| 3816 | */ |
| 3817 | opt += strlen(kw->word) + olen; |
| 3818 | if (strlen(opt)) |
| 3819 | memcpy(new + olen + len, opt, opt - o_org - 1); |
| 3820 | |
| 3821 | /* |
| 3822 | * replace opt and free the old opt |
| 3823 | */ |
| 3824 | opt = new; |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3825 | free(o_org); |
Jens Axboe | 7a958bd | 2009-11-13 12:33:54 +0100 | [diff] [blame] | 3826 | |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3827 | docalc = 1; |
Jens Axboe | 74929ac | 2009-08-05 11:42:37 +0200 | [diff] [blame] | 3828 | } |
| 3829 | } |
| 3830 | |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3831 | /* |
| 3832 | * Check for potential math and invoke bc, if possible |
| 3833 | */ |
| 3834 | if (docalc) |
| 3835 | opt = bc_calc(opt); |
| 3836 | |
Jens Axboe | 7a958bd | 2009-11-13 12:33:54 +0100 | [diff] [blame] | 3837 | return opt; |
Jens Axboe | 74929ac | 2009-08-05 11:42:37 +0200 | [diff] [blame] | 3838 | } |
| 3839 | |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3840 | static char **dup_and_sub_options(char **opts, int num_opts) |
| 3841 | { |
| 3842 | int i; |
| 3843 | char **opts_copy = malloc(num_opts * sizeof(*opts)); |
| 3844 | for (i = 0; i < num_opts; i++) { |
| 3845 | opts_copy[i] = option_dup_subs(opts[i]); |
| 3846 | if (!opts_copy[i]) |
| 3847 | continue; |
| 3848 | opts_copy[i] = fio_keyword_replace(opts_copy[i]); |
| 3849 | } |
| 3850 | return opts_copy; |
| 3851 | } |
| 3852 | |
Jens Axboe | 292cc47 | 2013-11-26 20:39:35 -0700 | [diff] [blame] | 3853 | int fio_options_parse(struct thread_data *td, char **opts, int num_opts, |
| 3854 | int dump_cmdline) |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3855 | { |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3856 | int i, ret, unknown; |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3857 | char **opts_copy; |
Jens Axboe | 3b8b713 | 2008-06-10 19:46:23 +0200 | [diff] [blame] | 3858 | |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 3859 | sort_options(opts, fio_options, num_opts); |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3860 | opts_copy = dup_and_sub_options(opts, num_opts); |
Jens Axboe | 3b8b713 | 2008-06-10 19:46:23 +0200 | [diff] [blame] | 3861 | |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3862 | for (ret = 0, i = 0, unknown = 0; i < num_opts; i++) { |
| 3863 | struct fio_option *o; |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 3864 | int newret = parse_option(opts_copy[i], opts[i], fio_options, |
Jens Axboe | 292cc47 | 2013-11-26 20:39:35 -0700 | [diff] [blame] | 3865 | &o, td, dump_cmdline); |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3866 | |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3867 | if (opts_copy[i]) { |
| 3868 | if (newret && !o) { |
| 3869 | unknown++; |
| 3870 | continue; |
| 3871 | } |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3872 | free(opts_copy[i]); |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3873 | opts_copy[i] = NULL; |
| 3874 | } |
| 3875 | |
| 3876 | ret |= newret; |
| 3877 | } |
| 3878 | |
| 3879 | if (unknown) { |
| 3880 | ret |= ioengine_load(td); |
| 3881 | if (td->eo) { |
| 3882 | sort_options(opts_copy, td->io_ops->options, num_opts); |
| 3883 | opts = opts_copy; |
| 3884 | } |
| 3885 | for (i = 0; i < num_opts; i++) { |
| 3886 | struct fio_option *o = NULL; |
| 3887 | int newret = 1; |
| 3888 | if (!opts_copy[i]) |
| 3889 | continue; |
| 3890 | |
| 3891 | if (td->eo) |
| 3892 | newret = parse_option(opts_copy[i], opts[i], |
| 3893 | td->io_ops->options, &o, |
Jens Axboe | 292cc47 | 2013-11-26 20:39:35 -0700 | [diff] [blame] | 3894 | td->eo, dump_cmdline); |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3895 | |
| 3896 | ret |= newret; |
| 3897 | if (!o) |
| 3898 | log_err("Bad option <%s>\n", opts[i]); |
| 3899 | |
| 3900 | free(opts_copy[i]); |
| 3901 | opts_copy[i] = NULL; |
| 3902 | } |
Jens Axboe | 74929ac | 2009-08-05 11:42:37 +0200 | [diff] [blame] | 3903 | } |
Jens Axboe | 3b8b713 | 2008-06-10 19:46:23 +0200 | [diff] [blame] | 3904 | |
Steven Lang | d0c814e | 2011-10-28 08:37:13 +0200 | [diff] [blame] | 3905 | free(opts_copy); |
Jens Axboe | 3b8b713 | 2008-06-10 19:46:23 +0200 | [diff] [blame] | 3906 | return ret; |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3907 | } |
| 3908 | |
| 3909 | int fio_cmd_option_parse(struct thread_data *td, const char *opt, char *val) |
| 3910 | { |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 3911 | return parse_cmd_option(opt, val, fio_options, td); |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3912 | } |
| 3913 | |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3914 | int fio_cmd_ioengine_option_parse(struct thread_data *td, const char *opt, |
| 3915 | char *val) |
| 3916 | { |
Akinobu Mita | 8a96c80 | 2013-10-09 09:32:34 -0600 | [diff] [blame] | 3917 | return parse_cmd_option(opt, val, td->io_ops->options, td->eo); |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3918 | } |
| 3919 | |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3920 | void fio_fill_default_options(struct thread_data *td) |
| 3921 | { |
Jens Axboe | cb1402d | 2014-02-25 11:35:27 -0800 | [diff] [blame] | 3922 | td->o.magic = OPT_MAGIC; |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 3923 | fill_default_options(td, fio_options); |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3924 | } |
| 3925 | |
| 3926 | int fio_show_option_help(const char *opt) |
| 3927 | { |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 3928 | return show_cmd_help(fio_options, opt); |
Jens Axboe | 214e1ec | 2007-03-15 10:48:13 +0100 | [diff] [blame] | 3929 | } |
Jens Axboe | d23bb32 | 2007-03-23 15:57:56 +0100 | [diff] [blame] | 3930 | |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3931 | void options_mem_dupe(void *data, struct fio_option *options) |
| 3932 | { |
| 3933 | struct fio_option *o; |
| 3934 | char **ptr; |
| 3935 | |
| 3936 | for (o = &options[0]; o->name; o++) { |
| 3937 | if (o->type != FIO_OPT_STR_STORE) |
| 3938 | continue; |
| 3939 | |
Jens Axboe | f0fdbca | 2014-02-11 15:44:50 -0700 | [diff] [blame] | 3940 | ptr = td_var(data, o, o->off1); |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3941 | if (*ptr) |
| 3942 | *ptr = strdup(*ptr); |
| 3943 | } |
| 3944 | } |
| 3945 | |
Jens Axboe | 7e356b2 | 2011-10-14 10:55:16 +0200 | [diff] [blame] | 3946 | /* |
| 3947 | * dupe FIO_OPT_STR_STORE options |
| 3948 | */ |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3949 | void fio_options_mem_dupe(struct thread_data *td) |
Jens Axboe | d23bb32 | 2007-03-23 15:57:56 +0100 | [diff] [blame] | 3950 | { |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 3951 | options_mem_dupe(&td->o, fio_options); |
Jens Axboe | 1647f59 | 2011-11-09 20:25:21 +0100 | [diff] [blame] | 3952 | |
| 3953 | if (td->eo && td->io_ops) { |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3954 | void *oldeo = td->eo; |
Jens Axboe | 1647f59 | 2011-11-09 20:25:21 +0100 | [diff] [blame] | 3955 | |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 3956 | td->eo = malloc(td->io_ops->option_struct_size); |
| 3957 | memcpy(td->eo, oldeo, td->io_ops->option_struct_size); |
| 3958 | options_mem_dupe(td->eo, td->io_ops->options); |
Jens Axboe | d23bb32 | 2007-03-23 15:57:56 +0100 | [diff] [blame] | 3959 | } |
| 3960 | } |
| 3961 | |
Jens Axboe | d6978a3 | 2009-07-18 21:04:09 +0200 | [diff] [blame] | 3962 | unsigned int fio_get_kb_base(void *data) |
| 3963 | { |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 3964 | struct thread_options *o = data; |
Jens Axboe | d6978a3 | 2009-07-18 21:04:09 +0200 | [diff] [blame] | 3965 | unsigned int kb_base = 0; |
| 3966 | |
Jens Axboe | cb1402d | 2014-02-25 11:35:27 -0800 | [diff] [blame] | 3967 | /* |
| 3968 | * This is a hack... For private options, *data is not holding |
| 3969 | * a pointer to the thread_options, but to private data. This means |
| 3970 | * we can't safely dereference it, but magic is first so mem wise |
| 3971 | * it is valid. But this also means that if the job first sets |
| 3972 | * kb_base and expects that to be honored by private options, |
| 3973 | * it will be disappointed. We will return the global default |
| 3974 | * for this. |
| 3975 | */ |
| 3976 | if (o && o->magic == OPT_MAGIC) |
Jens Axboe | 83ea422 | 2012-03-28 14:01:46 +0200 | [diff] [blame] | 3977 | kb_base = o->kb_base; |
Jens Axboe | d6978a3 | 2009-07-18 21:04:09 +0200 | [diff] [blame] | 3978 | if (!kb_base) |
| 3979 | kb_base = 1024; |
| 3980 | |
| 3981 | return kb_base; |
| 3982 | } |
Jens Axboe | 9f988e2 | 2010-03-04 10:42:38 +0100 | [diff] [blame] | 3983 | |
Jens Axboe | 07b3232 | 2010-03-05 09:48:44 +0100 | [diff] [blame] | 3984 | int add_option(struct fio_option *o) |
Jens Axboe | 9f988e2 | 2010-03-04 10:42:38 +0100 | [diff] [blame] | 3985 | { |
Jens Axboe | 07b3232 | 2010-03-05 09:48:44 +0100 | [diff] [blame] | 3986 | struct fio_option *__o; |
| 3987 | int opt_index = 0; |
| 3988 | |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 3989 | __o = fio_options; |
Jens Axboe | 07b3232 | 2010-03-05 09:48:44 +0100 | [diff] [blame] | 3990 | while (__o->name) { |
| 3991 | opt_index++; |
| 3992 | __o++; |
| 3993 | } |
| 3994 | |
Jens Axboe | 7b504ed | 2014-02-11 14:19:38 -0700 | [diff] [blame] | 3995 | if (opt_index + 1 == FIO_MAX_OPTS) { |
| 3996 | log_err("fio: FIO_MAX_OPTS is too small\n"); |
| 3997 | return 1; |
| 3998 | } |
| 3999 | |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 4000 | memcpy(&fio_options[opt_index], o, sizeof(*o)); |
Jens Axboe | 7b504ed | 2014-02-11 14:19:38 -0700 | [diff] [blame] | 4001 | fio_options[opt_index + 1].name = NULL; |
Jens Axboe | 07b3232 | 2010-03-05 09:48:44 +0100 | [diff] [blame] | 4002 | return 0; |
Jens Axboe | 9f988e2 | 2010-03-04 10:42:38 +0100 | [diff] [blame] | 4003 | } |
Jens Axboe | e2de69d | 2010-03-04 14:05:48 +0100 | [diff] [blame] | 4004 | |
Jens Axboe | 07b3232 | 2010-03-05 09:48:44 +0100 | [diff] [blame] | 4005 | void invalidate_profile_options(const char *prof_name) |
Jens Axboe | e2de69d | 2010-03-04 14:05:48 +0100 | [diff] [blame] | 4006 | { |
Jens Axboe | 07b3232 | 2010-03-05 09:48:44 +0100 | [diff] [blame] | 4007 | struct fio_option *o; |
Jens Axboe | e2de69d | 2010-03-04 14:05:48 +0100 | [diff] [blame] | 4008 | |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 4009 | o = fio_options; |
Jens Axboe | 07b3232 | 2010-03-05 09:48:44 +0100 | [diff] [blame] | 4010 | while (o->name) { |
| 4011 | if (o->prof_name && !strcmp(o->prof_name, prof_name)) { |
| 4012 | o->type = FIO_OPT_INVALID; |
| 4013 | o->prof_name = NULL; |
| 4014 | } |
| 4015 | o++; |
Jens Axboe | e2de69d | 2010-03-04 14:05:48 +0100 | [diff] [blame] | 4016 | } |
| 4017 | } |
Jens Axboe | f5b6bb8 | 2010-03-05 10:09:59 +0100 | [diff] [blame] | 4018 | |
| 4019 | void add_opt_posval(const char *optname, const char *ival, const char *help) |
| 4020 | { |
| 4021 | struct fio_option *o; |
| 4022 | unsigned int i; |
| 4023 | |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 4024 | o = find_option(fio_options, optname); |
Jens Axboe | f5b6bb8 | 2010-03-05 10:09:59 +0100 | [diff] [blame] | 4025 | if (!o) |
| 4026 | return; |
| 4027 | |
| 4028 | for (i = 0; i < PARSE_MAX_VP; i++) { |
| 4029 | if (o->posval[i].ival) |
| 4030 | continue; |
| 4031 | |
| 4032 | o->posval[i].ival = ival; |
| 4033 | o->posval[i].help = help; |
| 4034 | break; |
| 4035 | } |
| 4036 | } |
| 4037 | |
| 4038 | void del_opt_posval(const char *optname, const char *ival) |
| 4039 | { |
| 4040 | struct fio_option *o; |
| 4041 | unsigned int i; |
| 4042 | |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 4043 | o = find_option(fio_options, optname); |
Jens Axboe | f5b6bb8 | 2010-03-05 10:09:59 +0100 | [diff] [blame] | 4044 | if (!o) |
| 4045 | return; |
| 4046 | |
| 4047 | for (i = 0; i < PARSE_MAX_VP; i++) { |
| 4048 | if (!o->posval[i].ival) |
| 4049 | continue; |
| 4050 | if (strcmp(o->posval[i].ival, ival)) |
| 4051 | continue; |
| 4052 | |
| 4053 | o->posval[i].ival = NULL; |
| 4054 | o->posval[i].help = NULL; |
| 4055 | } |
| 4056 | } |
Jens Axboe | 7e356b2 | 2011-10-14 10:55:16 +0200 | [diff] [blame] | 4057 | |
| 4058 | void fio_options_free(struct thread_data *td) |
| 4059 | { |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 4060 | options_free(fio_options, td); |
Steven Lang | de890a1 | 2011-11-09 14:03:34 +0100 | [diff] [blame] | 4061 | if (td->eo && td->io_ops && td->io_ops->options) { |
| 4062 | options_free(td->io_ops->options, td->eo); |
| 4063 | free(td->eo); |
| 4064 | td->eo = NULL; |
| 4065 | } |
Jens Axboe | 7e356b2 | 2011-10-14 10:55:16 +0200 | [diff] [blame] | 4066 | } |
Jens Axboe | c504ee5 | 2012-03-20 11:29:09 +0100 | [diff] [blame] | 4067 | |
| 4068 | struct fio_option *fio_option_find(const char *name) |
| 4069 | { |
| 4070 | return find_option(fio_options, name); |
| 4071 | } |
| 4072 | |