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