mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Yisheng Xie <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: peterz@infradead.org, hpa@zytor.com, wangnan0@huawei.com,
	xieyisheng1@huawei.com, acme@redhat.com, tglx@linutronix.de,
	linux-kernel@vger.kernel.org, mingo@kernel.org, jolsa@redhat.com,
	alexander.shishkin@linux.intel.com, namhyung@kernel.org
Subject: [tip:perf/core] perf top: Fix top.call-graph config option reading
Date: Mon, 19 Mar 2018 23:28:59 -0700	[thread overview]
Message-ID: <tip-a3a4a3b37c9b911af4c375b2475cea0fd2b84d38@git.kernel.org> (raw)
In-Reply-To: <1520853957-36106-1-git-send-email-xieyisheng1@huawei.com>

Commit-ID:  a3a4a3b37c9b911af4c375b2475cea0fd2b84d38
Gitweb:     https://git.kernel.org/tip/a3a4a3b37c9b911af4c375b2475cea0fd2b84d38
Author:     Yisheng Xie <xieyisheng1@huawei.com>
AuthorDate: Mon, 12 Mar 2018 19:25:56 +0800
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 16 Mar 2018 13:56:04 -0300

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 <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: b8cbb349061e ("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>
---
 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 0a26b56afcc5..113c298ed38b 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1223,8 +1223,10 @@ parse_callchain_opt(const struct option *opt, const char *arg, int unset)
 
 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;

      parent reply	other threads:[~2018-03-20  6:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-bot for Yisheng Xie [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-a3a4a3b37c9b911af4c375b2475cea0fd2b84d38@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@redhat.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=wangnan0@huawei.com \
    --cc=xieyisheng1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome