X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=init.c;h=515f3141d9ce08b7440ecce7b5ea7e5bfd89f87a;hp=9f1041c7a4e7b9add4b8b1b6889473b4705b7085;hb=f491a907983c1022ec3c4d3a76d969c286fe441b;hpb=c3546b531f48a2ff413c9508aed465e0145c8dfc diff --git a/init.c b/init.c index 9f1041c7..515f3141 100644 --- a/init.c +++ b/init.c @@ -1710,13 +1710,41 @@ static int fill_def_thread(void) return 0; } +static void show_debug_categories(void) +{ + struct debug_level *dl = &debug_levels[0]; + int curlen, first = 1; + + curlen = 0; + while (dl->name) { + int has_next = (dl + 1)->name != NULL; + + if (first || curlen + strlen(dl->name) >= 80) { + if (!first) { + printf("\n"); + curlen = 0; + } + curlen += printf("\t\t\t%s", dl->name); + curlen += 3 * (8 - 1); + if (has_next) + curlen += printf(","); + } else { + curlen += printf("%s", dl->name); + if (has_next) + curlen += printf(","); + } + dl++; + first = 0; + } + printf("\n"); +} + static void usage(const char *name) { printf("%s\n", fio_version_string); printf("%s [options] [job options] \n", name); - printf(" --debug=options\tEnable debug logging. May be one/more of:\n" - "\t\t\tprocess,file,io,mem,blktrace,verify,random,parse,\n" - "\t\t\tdiskutil,job,mutex,profile,time,net,rate,compress\n"); + printf(" --debug=options\tEnable debug logging. May be one/more of:\n"); + show_debug_categories(); printf(" --parse-only\t\tParse options only, don't start any IO\n"); printf(" --output\t\tWrite output to file\n"); printf(" --runtime\t\tRuntime in seconds\n");