All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yisheng Xie <xieyisheng1@huawei.com>
To: <acme@kernel.org>
Cc: <jolsa@redhat.com>, <namhyung@kernel.org>,
	<alexander.shishkin@linux.intel.com>, <mingo@redhat.com>,
	<peterz@infradead.org>, <linux-kernel@vger.kernel.org>,
	Yisheng Xie <xieyisheng1@huawei.com>
Subject: [PATCH 2/2] perf record: Avoid duplicate call of perf_default_config()
Date: Mon, 12 Mar 2018 19:25:57 +0800	[thread overview]
Message-ID: <1520853957-36106-2-git-send-email-xieyisheng1@huawei.com> (raw)
In-Reply-To: <1520853957-36106-1-git-send-email-xieyisheng1@huawei.com>

We have brought perf_default_config to the very beginning at main(), so
it no need to call perf_default_config() once more for most of config in
perf-record but only for record.call-graph.

Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
---
 tools/perf/builtin-record.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index a217623..811cfc1 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -1260,10 +1260,12 @@ static int perf_record_config(const char *var, const char *value, void *cb)
 			return -1;
 		return 0;
 	}
-	if (!strcmp(var, "record.call-graph"))
-		var = "call-graph.record-mode"; /* fall-through */
+	if (!strcmp(var, "record.call-graph")) {
+		var = "call-graph.record-mode";
+		return perf_default_config(var, value, cb);
+	}
 
-	return perf_default_config(var, value, cb);
+	return 0;
 }
 
 struct clockid_map {
-- 
1.7.12.4

  reply	other threads:[~2018-03-12 11:35 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 ` Yisheng Xie [this message]
2018-03-12 14:06   ` [PATCH 2/2] perf record: Avoid duplicate call of perf_default_config() 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

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=1520853957-36106-2-git-send-email-xieyisheng1@huawei.com \
    --to=xieyisheng1@huawei.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /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 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.