Re: [PATCH 1/2] perf tools: Add 'perf-config' command

From: Jiri Olsa
Date: Fri Apr 10 2015 - 04:53:47 EST


On Thu, Apr 09, 2015 at 11:26:30PM +0900, Taeung Song wrote:
> The perf configuration file contain many variables which can make
> the perf command's action more effective and more skilful.
> But looking through state of configuration is difficult and
> there's no knowing what kind of other variables except variables in perfconfig.example exist.
> So This patch adds 'perf-config' command with '--all' option and a document for it.

hi,
any chance the 'perf config -a' would display current config PLUS
all possible keys with their default values? Like total overview
of the config options.. I mean all the options you described in
the doc.

While 'perf config' would display only those options you have
defined in the config file..

It could be part as next patch of course as it might need
more coding.

one nit below

thanks,
jirka

>
> Signed-off-by: Taeung Song <treeze.taeung@xxxxxxxxx>
> ---
> tools/perf/Build | 1 +
> tools/perf/Documentation/perf-config.txt | 433 ++++++++++++++++++++++++++++
> tools/perf/Documentation/perfconfig.example | 65 ++++-
> tools/perf/builtin-config.c | 68 +++++

SNIP

> + return 0;
> +}
> +
> +int cmd_config(int argc, const char **argv, const char *prefix __maybe_unused)
> +{
> + int ret = 0;
> +
> + argc = parse_options(argc, argv, config_options, config_usage,
> + PARSE_OPT_STOP_AT_NON_OPTION);
> + if (argc > 0) {
> + if (strcmp(argv[0], "-") == 0) {
> + pr_warning(" Error: '-' is not supported.\n");
> + usage_with_options(config_usage, config_options);
> + }
> + }

for some reason you display error only for '-', and not for unknow argument

[jolsa@krava perf]$ ./perf config -
Error: '-' is not supported.

usage: perf config [options]

Action
-a, --all print all configurations

[jolsa@krava perf]$ ./perf config krava
[jolsa@krava perf]$
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/