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