The following changes since commit 5b9a7f2232151d4bb80295be743a6f435f054662: Windows: add missing files needed for msi build (2011-01-28 08:41:42 +0100) are available in the git repository at: git://git.kernel.dk/fio.git master Jens Axboe (1): Add support for giving multiple --section options README | 6 ++++-- init.c | 25 ++++++++++++++++++------- 2 files changed, 22 insertions(+), 9 deletions(-) --- Diff of recent changes: diff --git a/README b/README index 89a88e9..ca7f73c 100644 --- a/README +++ b/README @@ -137,10 +137,12 @@ $ fio --help Print this page --cmdhelp=cmd Print command help, "all" for all of them --showcmd Turn a job file into command line options - --readonly Turn on safety read-only checks, preventing writes + --readonly Turn on safety read-only checks, preventing + writes --eta=when When ETA estimate should be printed May be "always", "never" or "auto" - --section=name Only run specified section in job file + --section=name Only run specified section in job file. Multiple + sections can be specified. --alloc-size=kb Set smalloc pool to this size in kb (def 1024) --warnings-fatal Fio parser warnings are fatal diff --git a/init.c b/init.c index e0f58cd..1cd0cae 100644 --- a/init.c +++ b/init.c @@ -39,7 +39,8 @@ int eta_print; unsigned long long mlock_size = 0; FILE *f_out = NULL; FILE *f_err = NULL; -char *job_section = NULL; +char **job_sections = NULL; +int nr_job_sections = 0; char *exec_profile = NULL; int warnings_fatal = 0; @@ -724,12 +725,18 @@ void add_job_opts(const char **o) static int skip_this_section(const char *name) { - if (!job_section) + int i; + + if (!nr_job_sections) return 0; if (!strncmp(name, "global", 6)) return 0; - return strcmp(job_section, name); + for (i = 0; i < nr_job_sections; i++) + if (!strcmp(job_sections[i], name)) + return 0; + + return 1; } static int is_empty_or_comment(char *line) @@ -1167,7 +1174,9 @@ static int parse_cmd_line(int argc, char *argv[]) if (set_debug(optarg)) do_exit++; break; - case 'x': + case 'x': { + size_t new_size; + if (!strcmp(optarg, "global")) { log_err("fio: can't use global as only " "section\n"); @@ -1175,10 +1184,12 @@ static int parse_cmd_line(int argc, char *argv[]) exit_val = 1; break; } - if (job_section) - free(job_section); - job_section = strdup(optarg); + new_size = (nr_job_sections + 1) * sizeof(char *); + job_sections = realloc(job_sections, new_size); + job_sections[nr_job_sections] = strdup(optarg); + nr_job_sections++; break; + } case 'p': exec_profile = strdup(optarg); break; -- To unsubscribe from this list: send the line "unsubscribe fio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html