Skip to content

Commit 8cde089

Browse files
Yisheng Xiegregkh
authored andcommitted
perf top: Fix top.call-graph config option reading
[ Upstream commit a3a4a3b ] 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]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 25b69a4 commit 8cde089

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
@@ -1080,8 +1080,10 @@ parse_callchain_opt(const struct option *opt, const char *arg, int unset)
10801080

10811081
static int perf_top_config(const char *var, const char *value, void *cb __maybe_unused)
10821082
{
1083-
if (!strcmp(var, "top.call-graph"))
1084-
var = "call-graph.record-mode"; /* fall-through */
1083+
if (!strcmp(var, "top.call-graph")) {
1084+
var = "call-graph.record-mode";
1085+
return perf_default_config(var, value, cb);
1086+
}
10851087
if (!strcmp(var, "top.children")) {
10861088
symbol_conf.cumulate_callchain = perf_config_bool(var, value);
10871089
return 0;

0 commit comments

Comments
 (0)