projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add --max-jobs/-j command line option
[fio.git]
/
init.c
diff --git
a/init.c
b/init.c
index d5813c60b22d39615bffed9333556918a5bedb65..baf3130b34f171fd73605794ba7dd0d5f70cb4dd 100644
(file)
--- a/
init.c
+++ b/
init.c
@@
-27,7
+27,7
@@
static char fio_version_string[] = "fio 1.55";
#define FIO_RANDSEED (0xb1899bedUL)
static char **ini_file;
#define FIO_RANDSEED (0xb1899bedUL)
static char **ini_file;
-static int max_jobs = MAX_JOBS;
+static int max_jobs =
FIO_
MAX_JOBS;
static int dump_cmdline;
static struct thread_data def_thread;
static int dump_cmdline;
static struct thread_data def_thread;
@@
-143,6
+143,11
@@
static struct option l_opts[FIO_NR_OPTIONS] = {
.has_arg = no_argument,
.val = 'w',
},
.has_arg = no_argument,
.val = 'w',
},
+ {
+ .name = (char *) "max-jobs",
+ .has_arg = required_argument,
+ .val = 'j',
+ },
{
.name = NULL,
},
{
.name = NULL,
},
@@
-1039,6
+1044,7
@@
static void usage(const char *name)
printf("\t--alloc-size=kb\tSet smalloc pool to this size in kb"
" (def 1024)\n");
printf("\t--warnings-fatal Fio parser warnings are fatal\n");
printf("\t--alloc-size=kb\tSet smalloc pool to this size in kb"
" (def 1024)\n");
printf("\t--warnings-fatal Fio parser warnings are fatal\n");
+ printf("\t--max-jobs\tMaximum number of threads/processes to support\n");
printf("\nFio was written by Jens Axboe <jens.axboe@oracle.com>");
printf("\n Jens Axboe <jaxboe@fusionio.com>\n");
}
printf("\nFio was written by Jens Axboe <jens.axboe@oracle.com>");
printf("\n Jens Axboe <jaxboe@fusionio.com>\n");
}
@@
-1247,6
+1253,14
@@
static int parse_cmd_line(int argc, char *argv[])
case 'w':
warnings_fatal = 1;
break;
case 'w':
warnings_fatal = 1;
break;
+ case 'j':
+ max_jobs = atoi(optarg);
+ if (!max_jobs || max_jobs > REAL_MAX_JOBS) {
+ log_err("fio: invalid max jobs: %d\n", max_jobs);
+ do_exit++;
+ exit_val = 1;
+ }
+ break;
default:
do_exit++;
exit_val = 1;
default:
do_exit++;
exit_val = 1;