projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cast input argument for json_object_add_value_int to long long
[fio.git]
/
options.c
diff --git
a/options.c
b/options.c
index 5c372b6964c0eb078737732131cbbb63c7541f10..74347f3554e02b027d42f8012ebe96cbb9cbc716 100644
(file)
--- a/
options.c
+++ b/
options.c
@@
-269,7
+269,7
@@
static int ignore_error_type(struct thread_data *td, int etype, char *str)
} else {
error[i] = atoi(fname);
if (error[i] < 0)
} else {
error[i] = atoi(fname);
if (error[i] < 0)
- error[i] = error[i];
+ error[i] =
-
error[i];
}
if (!error[i]) {
log_err("Unknown error %s, please use number value \n",
}
if (!error[i]) {
log_err("Unknown error %s, please use number value \n",
@@
-554,6
+554,7
@@
static int str_verify_cpus_allowed_cb(void *data, const char *input)
static int str_numa_cpunodes_cb(void *data, char *input)
{
struct thread_data *td = data;
static int str_numa_cpunodes_cb(void *data, char *input)
{
struct thread_data *td = data;
+ struct bitmask *verify_bitmask;
if (parse_dryrun())
return 0;
if (parse_dryrun())
return 0;
@@
-563,13
+564,15
@@
static int str_numa_cpunodes_cb(void *data, char *input)
* numa_allocate_nodemask(), so it should be freed by
* numa_free_nodemask().
*/
* numa_allocate_nodemask(), so it should be freed by
* numa_free_nodemask().
*/
-
td->o.numa_cpunodes
mask = numa_parse_nodestring(input);
- if (
td->o.numa_cpunodes
mask == NULL) {
+
verify_bit
mask = numa_parse_nodestring(input);
+ if (
verify_bit
mask == NULL) {
log_err("fio: numa_parse_nodestring failed\n");
td_verror(td, 1, "str_numa_cpunodes_cb");
return 1;
}
log_err("fio: numa_parse_nodestring failed\n");
td_verror(td, 1, "str_numa_cpunodes_cb");
return 1;
}
+ numa_free_nodemask(verify_bitmask);
+ td->o.numa_cpunodes = strdup(input);
td->o.numa_cpumask_set = 1;
return 0;
}
td->o.numa_cpumask_set = 1;
return 0;
}
@@
-581,6
+584,7
@@
static int str_numa_mpol_cb(void *data, char *input)
{ "default", "prefer", "bind", "interleave", "local", NULL };
int i;
char *nodelist;
{ "default", "prefer", "bind", "interleave", "local", NULL };
int i;
char *nodelist;
+ struct bitmask *verify_bitmask;
if (parse_dryrun())
return 0;
if (parse_dryrun())
return 0;
@@
-660,12
+664,15
@@
static int str_numa_mpol_cb(void *data, char *input)
break;
case MPOL_INTERLEAVE:
case MPOL_BIND:
break;
case MPOL_INTERLEAVE:
case MPOL_BIND:
-
td->o.numa_memnodes
mask = numa_parse_nodestring(nodelist);
- if (
td->o.numa_memnodes
mask == NULL) {
+
verify_bit
mask = numa_parse_nodestring(nodelist);
+ if (
verify_bit
mask == NULL) {
log_err("fio: numa_parse_nodestring failed\n");
td_verror(td, 1, "str_numa_memnodes_cb");
return 1;
}
log_err("fio: numa_parse_nodestring failed\n");
td_verror(td, 1, "str_numa_memnodes_cb");
return 1;
}
+ td->o.numa_memnodes = strdup(nodelist);
+ numa_free_nodemask(verify_bitmask);
+
break;
case MPOL_LOCAL:
case MPOL_DEFAULT:
break;
case MPOL_LOCAL:
case MPOL_DEFAULT:
@@
-1526,6
+1533,15
@@
struct fio_option fio_options[FIO_MAX_OPTS] = {
.help = "fallocate() file based engine",
},
#endif
.help = "fallocate() file based engine",
},
#endif
+#ifdef CONFIG_GFAPI
+ { .ival = "gfapi",
+ .help = "Glusterfs libgfapi(sync) based engine"
+ },
+ { .ival = "gfapi_async",
+ .help = "Glusterfs libgfapi(async) based engine"
+ },
+#endif
+
{ .ival = "external",
.help = "Load external engine (append name)",
},
{ .ival = "external",
.help = "Load external engine (append name)",
},
@@
-1594,6
+1610,15
@@
struct fio_option fio_options[FIO_MAX_OPTS] = {
.category = FIO_OPT_C_IO,
.group = FIO_OPT_G_INVALID,
},
.category = FIO_OPT_C_IO,
.group = FIO_OPT_G_INVALID,
},
+ {
+ .name = "io_limit",
+ .lname = "IO Limit",
+ .type = FIO_OPT_STR_VAL,
+ .off1 = td_var_offset(io_limit),
+ .interval = 1024 * 1024,
+ .category = FIO_OPT_C_IO,
+ .group = FIO_OPT_G_INVALID,
+ },
{
.name = "fill_device",
.lname = "Fill device",
{
.name = "fill_device",
.lname = "Fill device",
@@
-2201,6
+2226,7
@@
struct fio_option fio_options[FIO_MAX_OPTS] = {
.oval = MEM_MALLOC,
.help = "Use malloc(3) for IO buffers",
},
.oval = MEM_MALLOC,
.help = "Use malloc(3) for IO buffers",
},
+#ifndef CONFIG_NO_SHM
{ .ival = "shm",
.oval = MEM_SHM,
.help = "Use shared memory segments for IO buffers",
{ .ival = "shm",
.oval = MEM_SHM,
.help = "Use shared memory segments for IO buffers",
@@
-2210,6
+2236,7
@@
struct fio_option fio_options[FIO_MAX_OPTS] = {
.oval = MEM_SHMHUGE,
.help = "Like shm, but use huge pages",
},
.oval = MEM_SHMHUGE,
.help = "Like shm, but use huge pages",
},
+#endif
#endif
{ .ival = "mmap",
.oval = MEM_MMAP,
#endif
{ .ival = "mmap",
.oval = MEM_MMAP,
@@
-3023,6
+3050,10
@@
struct fio_option fio_options[FIO_MAX_OPTS] = {
.type = FIO_OPT_STR_SET,
.off1 = td_var_offset(use_thread),
.help = "Use threads instead of processes",
.type = FIO_OPT_STR_SET,
.off1 = td_var_offset(use_thread),
.help = "Use threads instead of processes",
+#ifdef CONFIG_NO_SHM
+ .def = "1",
+ .no_warn_def = 1,
+#endif
.category = FIO_OPT_C_GENERAL,
.group = FIO_OPT_G_PROCESS,
},
.category = FIO_OPT_C_GENERAL,
.group = FIO_OPT_G_PROCESS,
},
@@
-3656,8
+3687,10
@@
static char *bc_calc(char *str)
return NULL;
ret = fread(&buf[tmp - str], 1, 128 - (tmp - str), f);
return NULL;
ret = fread(&buf[tmp - str], 1, 128 - (tmp - str), f);
- if (ret <= 0)
+ if (ret <= 0) {
+ pclose(f);
return NULL;
return NULL;
+ }
pclose(f);
buf[(tmp - str) + ret - 1] = '\0';
pclose(f);
buf[(tmp - str) + ret - 1] = '\0';