All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] perf top: Fix top.call-graph works abnormal
@ 2018-03-12 11:25 Yisheng Xie
  2018-03-12 11:25 ` [PATCH 2/2] perf record: Avoid duplicate call of perf_default_config() Yisheng Xie
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Yisheng Xie @ 2018-03-12 11:25 UTC (permalink / raw)
  To: acme
  Cc: jolsa, namhyung, alexander.shishkin, mingo, peterz, linux-kernel,
	Yisheng Xie

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 <xieyisheng1@huawei.com>
---
 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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-03-20  6:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-12 11:25 [PATCH 1/2] perf top: Fix top.call-graph works abnormal Yisheng Xie
2018-03-12 11:25 ` [PATCH 2/2] perf record: Avoid duplicate call of perf_default_config() Yisheng Xie
2018-03-12 14:06   ` Arnaldo Carvalho de Melo
2018-03-20  6:28   ` [tip:perf/core] " tip-bot for Yisheng Xie
2018-03-12 14:11 ` [PATCH 1/2] perf top: Fix top.call-graph works abnormal Arnaldo Carvalho de Melo
2018-03-20  6:28 ` [tip:perf/core] perf top: Fix top.call-graph config option reading tip-bot for Yisheng Xie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.