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