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