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