From: Masami Hiramatsu Date: Fri, 27 Feb 2015 04:50:31 +0000 (+0900) Subject: perf buildid-cache: Show usage with incorrect params X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=0497d0a8201a38f0c95edc8a1fc0325f2f879ddb;p=openwrt%2Fstaging%2Fblogic.git perf buildid-cache: Show usage with incorrect params Show usage if no action is specified or unexpected parameter is given. In other words, be more user friendly. Signed-off-by: Masami Hiramatsu Cc: Adrian Hunter Cc: Borislav Petkov Cc: Hemant Kumar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20150227045030.1999.44006.stgit@localhost.localdomain Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/builtin-buildid-cache.c b/tools/perf/builtin-buildid-cache.c index 04466c4ff9d7..d47a0cdc71c9 100644 --- a/tools/perf/builtin-buildid-cache.c +++ b/tools/perf/builtin-buildid-cache.c @@ -343,6 +343,11 @@ int cmd_buildid_cache(int argc, const char **argv, argc = parse_options(argc, argv, buildid_cache_options, buildid_cache_usage, 0); + if (argc || (!add_name_list_str && !kcore_filename && + !remove_name_list_str && !purge_name_list_str && + !missing_filename && !update_name_list_str)) + usage_with_options(buildid_cache_usage, buildid_cache_options); + if (missing_filename) { file.path = missing_filename; file.force = force;