Skip to content

Commit 0fcaef9

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 <xieyisheng1@huawei.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Wang Nan <wangnan0@huawei.com> Fixes: b8cbb34 ("perf config: Bring perf_default_config to the very beginning at main()") Link: http://lkml.kernel.org/r/1520853957-36106-1-git-send-email-xieyisheng1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 532d994 commit 0fcaef9

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

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

0 commit comments

Comments
 (0)