path: root/tools/perf/builtin-kmem.c
diff options
authorWang Nan <>2016-02-26 09:31:51 +0000
committerArnaldo Carvalho de Melo <>2016-02-26 19:49:16 -0300
commitb8cbb349061edda648463b086cfa869a7ab583af (patch)
treed6653e62842d1d873b4a6cde09c1d76847106a3a /tools/perf/builtin-kmem.c
parentabab5e7fcec16e526968f8a5448cd81c635705ce (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 <> Suggested-and-Tested-by: Arnaldo Carvalho de Melo <> Cc: Alexei Starovoitov <> Cc: Jiri Olsa <> Cc: Li Zefan <> Cc: Masami Hiramatsu <> Cc: Namhyung Kim <> Cc: Link: Signed-off-by: Arnaldo Carvalho de Melo <>
Diffstat (limited to 'tools/perf/builtin-kmem.c')
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
index 118010553d0c..4d3340cce9a0 100644
--- a/tools/perf/builtin-kmem.c
+++ b/tools/perf/builtin-kmem.c
@@ -1834,7 +1834,7 @@ static int __cmd_record(int argc, const char **argv)
return cmd_record(i, rec_argv, NULL);
-static int kmem_config(const char *var, const char *value, void *cb)
+static int kmem_config(const char *var, const char *value, void *cb __maybe_unused)
if (!strcmp(var, "kmem.default")) {
if (!strcmp(value, "slab"))
@@ -1847,7 +1847,7 @@ static int kmem_config(const char *var, const char *value, void *cb)
return 0;
- return perf_default_config(var, value, cb);
+ return 0;
int cmd_kmem(int argc, const char **argv, const char *prefix __maybe_unused)