Skip to content

Commit a3a4a3b

Browse files
Yisheng Xieacmel
authored andcommitted
perf top: Fix top.call-graph config option reading
When trying to add the "call-graph" variable for top into the .perfconfig file, like: [top] call-graph = fp I that perf_top_config() do not parse this variable. Fix it by calling perf_default_config() when the top.call-graph variable is set. Signed-off-by: Yisheng Xie <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Wang Nan <[email protected]> Fixes: b8cbb34 ("perf config: Bring perf_default_config to the very beginning at main()") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent cff1720 commit a3a4a3b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/perf/builtin-top.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,8 +1223,10 @@ parse_callchain_opt(const struct option *opt, const char *arg, int unset)
12231223

12241224
static int perf_top_config(const char *var, const char *value, void *cb __maybe_unused)
12251225
{
1226-
if (!strcmp(var, "top.call-graph"))
1227-
var = "call-graph.record-mode"; /* fall-through */
1226+
if (!strcmp(var, "top.call-graph")) {
1227+
var = "call-graph.record-mode";
1228+
return perf_default_config(var, value, cb);
1229+
}
12281230
if (!strcmp(var, "top.children")) {
12291231
symbol_conf.cumulate_callchain = perf_config_bool(var, value);
12301232
return 0;

0 commit comments

Comments
 (0)