perf config: Show the configuration when no arguments are provided

More convenient thah having to recall what letter is about
showing/listing/dumping the configuration, i.e. no arguments means
-l/--list:

  # perf config
  llvm.dump-obj=true
  trace.default_events=/home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.o
  trace.show_zeros=yes
  trace.show_duration=no
  # perf config -l
  llvm.dump-obj=true
  trace.default_events=/home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.o
  trace.show_zeros=yes
  trace.show_duration=no
  # perf config -h

   Usage: perf config [<file-option>] [options] [section.name[=value] ...]

      -l, --list            show current config variables
          --system          use system config file
          --user            use user config file

  #

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Taeung Song <treeze.taeung@gmail.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-z2n63avz6tliqb5gmu4l1dti@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 42e4a52d
...@@ -196,6 +196,7 @@ int cmd_config(int argc, const char **argv) ...@@ -196,6 +196,7 @@ int cmd_config(int argc, const char **argv)
pr_err("Error: takes no arguments\n"); pr_err("Error: takes no arguments\n");
parse_options_usage(config_usage, config_options, "l", 1); parse_options_usage(config_usage, config_options, "l", 1);
} else { } else {
do_action_list:
if (show_config(set) < 0) { if (show_config(set) < 0) {
pr_err("Nothing configured, " pr_err("Nothing configured, "
"please check your %s \n", config_filename); "please check your %s \n", config_filename);
...@@ -204,10 +205,8 @@ int cmd_config(int argc, const char **argv) ...@@ -204,10 +205,8 @@ int cmd_config(int argc, const char **argv)
} }
break; break;
default: default:
if (!argc) { if (!argc)
usage_with_options(config_usage, config_options); goto do_action_list;
break;
}
for (i = 0; argv[i]; i++) { for (i = 0; argv[i]; i++) {
char *var, *value; char *var, *value;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment