Received: by 10.213.65.68 with SMTP id h4csp160670imn; Mon, 19 Mar 2018 23:31:16 -0700 (PDT) X-Google-Smtp-Source: AG47ELsuyDRXqnpFkGQ64Si9KW06DgAMsaZ/bZ+SMsyIw5PxeytHCuF1f5fNSu6S3L0Pir/yMb25 X-Received: by 2002:a17:902:7b95:: with SMTP id w21-v6mr15663783pll.260.1521527476327; Mon, 19 Mar 2018 23:31:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521527476; cv=none; d=google.com; s=arc-20160816; b=VTcxG9JJXE3agC9pBgacvzxP/r+1Z3mdxHm8p5LhKKIKt8ifVwcTc3YY5bHCTAoeAo PeEMnk9FhCxGm17YdRyqvqhm2ktzxWu3f+RZgmZjSrV9gPXke4wzDcVpDt1mlBkq5hGD rInV+yh3ValZPB0FA0HgtAOatEaI1q1D1LTvLL3cNe3vBaWND7kQD0o63jj8p+Z7chUo tf14IsxoyoEwqq+rMeTG7bSIKdD6g9a8Lqm9rMa9bLj6nhMUabtBPhtzumLKtwCXTTt7 M43t4ymyJaNQXBVR7nxVsqwNM1/OcevpaG339O9k5e5SB8B/NT/zr/d4ARFdOH3JcyWX 7qDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=5zDmpWCeIYk8ukTMgmR96PmmbdISC5BfPQi1kF6bm6o=; b=NFbRAY2Ul49gGBBteudkV5eA54+epG1EevUn0uLoMNBhJaCYFA4xrifTmq42YO7zV2 IvnsduZkxg5475a/VEpHMc0k8cnfwFf5jnHrAfJutpfDtuGsztpAHTFDPHsxqBryQFhe WUe3KXVa13j4vmYtwax4ggQm8VSeEmTommlnoBBsdCMgnBIF6wD2kiuic87P2HtYQYZd gAUzo277RHpGPuWiAB4GFhcAWpoGfwb94YZ4NUvFJQC2cnak9/XINvY4dJuTeSXTzob6 HhgqxrqCiSSrN9t5Mkczsq8dy7WeyiQoAWk0IjrYC8CBIZZ/JyiwAeYAGyztVnfzxFsc 86FQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i23-v6si298419pll.251.2018.03.19.23.31.02; Mon, 19 Mar 2018 23:31:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752194AbeCTG3Y (ORCPT + 99 others); Tue, 20 Mar 2018 02:29:24 -0400 Received: from terminus.zytor.com ([198.137.202.136]:59265 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751330AbeCTG3W (ORCPT ); Tue, 20 Mar 2018 02:29:22 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w2K6T0Rj031070; Mon, 19 Mar 2018 23:29:00 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w2K6Sx0t031067; Mon, 19 Mar 2018 23:28:59 -0700 Date: Mon, 19 Mar 2018 23:28:59 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Yisheng Xie Message-ID: 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 Reply-To: mingo@kernel.org, jolsa@redhat.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, namhyung@kernel.org, alexander.shishkin@linux.intel.com, xieyisheng1@huawei.com, acme@redhat.com, peterz@infradead.org, hpa@zytor.com, wangnan0@huawei.com In-Reply-To: <1520853957-36106-1-git-send-email-xieyisheng1@huawei.com> References: <1520853957-36106-1-git-send-email-xieyisheng1@huawei.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf top: Fix top.call-graph config option reading Git-Commit-ID: a3a4a3b37c9b911af4c375b2475cea0fd2b84d38 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: a3a4a3b37c9b911af4c375b2475cea0fd2b84d38 Gitweb: https://git.kernel.org/tip/a3a4a3b37c9b911af4c375b2475cea0fd2b84d38 Author: Yisheng Xie AuthorDate: Mon, 12 Mar 2018 19:25:56 +0800 Committer: Arnaldo Carvalho de Melo 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 Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Wang Nan 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 --- 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;