diff options
author | Wang Nan <wangnan0@huawei.com> | 2016-02-26 04:31:51 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-02-26 17:49:16 -0500 |
commit | b8cbb349061edda648463b086cfa869a7ab583af (patch) | |
tree | d6653e62842d1d873b4a6cde09c1d76847106a3a /tools/perf/util/help-unknown-cmd.c | |
parent | abab5e7fcec16e526968f8a5448cd81c635705ce (diff) |
perf config: Bring perf_default_config to the very beginning at main()
Before this patch each subcommand calls perf_config() by themself,
reading the default configuration together with subcommand specific
options. If a subcommand doesn't have it own options, it needs to call
'perf_config(perf_default_config, NULL)' to ensure .perfconfig is
loaded.
This patch brings perf_config(perf_default_config, NULL) to the very
start of main(), so subcommands don't need to do it.
After this patch, 'llvm.clang-path' works for 'perf trace'.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Suggested-and-Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1456479154-136027-4-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/help-unknown-cmd.c')
-rw-r--r-- | tools/perf/util/help-unknown-cmd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/perf/util/help-unknown-cmd.c b/tools/perf/util/help-unknown-cmd.c index dc1e41c9b054..43a98a4dc1e1 100644 --- a/tools/perf/util/help-unknown-cmd.c +++ b/tools/perf/util/help-unknown-cmd.c | |||
@@ -6,7 +6,8 @@ | |||
6 | static int autocorrect; | 6 | static int autocorrect; |
7 | static struct cmdnames aliases; | 7 | static struct cmdnames aliases; |
8 | 8 | ||
9 | static int perf_unknown_cmd_config(const char *var, const char *value, void *cb) | 9 | static int perf_unknown_cmd_config(const char *var, const char *value, |
10 | void *cb __maybe_unused) | ||
10 | { | 11 | { |
11 | if (!strcmp(var, "help.autocorrect")) | 12 | if (!strcmp(var, "help.autocorrect")) |
12 | autocorrect = perf_config_int(var,value); | 13 | autocorrect = perf_config_int(var,value); |
@@ -14,7 +15,7 @@ static int perf_unknown_cmd_config(const char *var, const char *value, void *cb) | |||
14 | if (!prefixcmp(var, "alias.")) | 15 | if (!prefixcmp(var, "alias.")) |
15 | add_cmdname(&aliases, var + 6, strlen(var + 6)); | 16 | add_cmdname(&aliases, var + 6, strlen(var + 6)); |
16 | 17 | ||
17 | return perf_default_config(var, value, cb); | 18 | return 0; |
18 | } | 19 | } |
19 | 20 | ||
20 | static int levenshtein_compare(const void *p1, const void *p2) | 21 | static int levenshtein_compare(const void *p1, const void *p2) |