diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 933d70345f873887458ef6d75ac0d19ca03d37cc..e323eab10694fc0c23b485aa49aad4766815f697 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -528,8 +528,7 @@ clean: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean config-clean $(Q)find . -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete $(Q)$(RM) .config-detected $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32 - $(call QUIET_CLEAN, core-gen) $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)PERF-FEATURES $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* - $(call QUIET_CLEAN, feature-detect) $(RM) $(OUTPUT)config/feature-checks/.make-*.output + $(call QUIET_CLEAN, core-gen) $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-DUMP $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean $(python-clean) diff --git a/tools/perf/builtin-data.c b/tools/perf/builtin-data.c index 155cf75b8199c67914974af1a62f388278053879..709152a7b408ea18c6f8502098b9ce5b0dc2459c 100644 --- a/tools/perf/builtin-data.c +++ b/tools/perf/builtin-data.c @@ -22,7 +22,9 @@ static const struct option data_options[] = { OPT_END() }; -static const char * const data_usage[] = { +static const char * const data_subcommands[] = { "convert", NULL }; + +static const char *data_usage[] = { "perf data [] []", NULL }; @@ -98,7 +100,7 @@ int cmd_data(int argc, const char **argv, const char *prefix) if (argc < 2) goto usage; - argc = parse_options(argc, argv, data_options, data_usage, + argc = parse_options_subcommand(argc, argv, data_options, data_subcommands, data_usage, PARSE_OPT_STOP_AT_NON_OPTION); if (argc < 1) goto usage; diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c index 25d20628212ed4691ad8ca3cc3c432e5dbffcd13..36486eade1ef4f2d30736c99d7471b86d7dd0ada 100644 --- a/tools/perf/builtin-help.c +++ b/tools/perf/builtin-help.c @@ -437,7 +437,18 @@ int cmd_help(int argc, const char **argv, const char *prefix __maybe_unused) HELP_FORMAT_INFO), OPT_END(), }; - const char * const builtin_help_usage[] = { + const char * const builtin_help_subcommands[] = { + "buildid-cache", "buildid-list", "diff", "evlist", "help", "list", + "record", "report", "bench", "stat", "timechart", "top", "annotate", + "script", "sched", "kmem", "lock", "kvm", "test", "inject", "mem", "data", +#ifdef HAVE_LIBELF_SUPPORT + "probe", +#endif +#ifdef HAVE_LIBAUDIT_SUPPORT + "trace", +#endif + NULL }; + const char *builtin_help_usage[] = { "perf help [--all] [--man|--web|--info] [command]", NULL }; @@ -448,8 +459,8 @@ int cmd_help(int argc, const char **argv, const char *prefix __maybe_unused) perf_config(perf_help_config, &help_format); - argc = parse_options(argc, argv, builtin_help_options, - builtin_help_usage, 0); + argc = parse_options_subcommand(argc, argv, builtin_help_options, + builtin_help_subcommands, builtin_help_usage, 0); if (show_all) { printf("\n usage: %s\n\n", perf_usage_string); diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 52f74e1367e9c041020ce54f34beba07a56b3453..0ae482689e3c48b6e38964d819ddcb2fa49c8c56 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -676,7 +676,7 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused) OPT_STRING('w', "column-widths", &symbol_conf.col_width_list_str, "width[,width...]", "don't try to adjust column width, use these fixed values"), - OPT_STRING('t', "field-separator", &symbol_conf.field_sep, "separator", + OPT_STRING_NOEMPTY('t', "field-separator", &symbol_conf.field_sep, "separator", "separator for columns, no spaces will be added between " "columns '.' is reserved."), OPT_BOOLEAN('U', "hide-unresolved", &report.hide_unresolved, diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index c7e6750923efdc8f344810c06eaa7040305217ea..f2a348b57b8f43333555ef76b975c7a4c9392121 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -1572,7 +1572,8 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused) "Show the mmap events"), OPT_END() }; - const char * const script_usage[] = { + const char * const script_subcommands[] = { "record", "report", NULL }; + const char *script_usage[] = { "perf script []", "perf script [] record