When try to add call-graph for top into .perfconfig file, like:

      [top]
            call-graph = fp

find it cannot work for perf_top_config() do not parse this option.

Fix it by call perf_default_config() when config top.call-graph.

Fixes: b8cbb349061e (perf config: Bring perf_default_config to the very 
beginning at main())
Signed-off-by: Yisheng Xie <[email protected]>
---
 tools/perf/builtin-top.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 35ac016..fd6e238 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1224,8 +1224,10 @@ static int __cmd_top(struct perf_top *top)
 
 static int perf_top_config(const char *var, const char *value, void *cb 
__maybe_unused)
 {
-       if (!strcmp(var, "top.call-graph"))
-               var = "call-graph.record-mode"; /* fall-through */
+       if (!strcmp(var, "top.call-graph")) {
+               var = "call-graph.record-mode";
+               return perf_default_config(var, value, cb);
+       }
        if (!strcmp(var, "top.children")) {
                symbol_conf.cumulate_callchain = perf_config_bool(var, value);
                return 0;
-- 
1.7.12.4

Reply via email to