From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8096AC4740C for ; Sun, 22 Sep 2019 19:36:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4ECAB20644 for ; Sun, 22 Sep 2019 19:36:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569181009; bh=M1vlaAi5suffo46HsoG0DnNlWRvEJ7Gma9/swqx3m3w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=gwUNKVeAGnot0kUCJC29anp9yN32SyDeEXQLOBzyp3q/oKIZEcGXSqgkKm/WNVEzn O5NAqlGfCG0hgHlfOl3EFl9CABuZ2WUL4u72ZkouvfwC+pDitwX5vcBKEgLACYugg4 JRMxF+OpAP9Pqn0t//Ohe7sz4nmej+A1l44rSLR4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406767AbfIVTgh (ORCPT ); Sun, 22 Sep 2019 15:36:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:42134 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388049AbfIVSqJ (ORCPT ); Sun, 22 Sep 2019 14:46:09 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1FAB620665; Sun, 22 Sep 2019 18:46:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569177969; bh=M1vlaAi5suffo46HsoG0DnNlWRvEJ7Gma9/swqx3m3w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ELky++DC7AHgthj1kzavTozFnsgWTPh+R5Kpbh6nxDiOigKu2C4qc3usqrQB1wLjt HuSB0VmQYDXe6lbC0VDnc7x0aweA5J1uF9Mtpyu+PUJZHOhbYLj6X3EkK+6brU6Fj6 tX90Ze04+Sk9Xl8LmvhOKupMLpUOaMaoEhOhdhPs= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Arnaldo Carvalho de Melo , Adrian Hunter , Jiri Olsa , =?UTF-8?q?Luis=20Cl=C3=A1udio=20Gon=C3=A7alves?= , Namhyung Kim , Taeung Song , Sasha Levin Subject: [PATCH AUTOSEL 5.3 068/203] perf config: Honour $PERF_CONFIG env var to specify alternate .perfconfig Date: Sun, 22 Sep 2019 14:41:34 -0400 Message-Id: <20190922184350.30563-68-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190922184350.30563-1-sashal@kernel.org> References: <20190922184350.30563-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnaldo Carvalho de Melo [ Upstream commit 61a461fcbd62d42c29a1ea6a9cc3838ad9f49401 ] We had this comment in Documentation/perf_counter/config.c, i.e. since when we got this from the git sources, but never really did that getenv("PERF_CONFIG"), do it now as I need to disable whatever ~/.perfconfig root has so that tests parsing tool output are done for the expected default output or that we specify an alternate config file that when read will make the tools produce expected output. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Taeung Song Fixes: 078006012401 ("perf_counter tools: add in basic glue from Git") Link: https://lkml.kernel.org/n/tip-jo209zac9rut0dz1rqvbdlgm@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/perf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 97e2628ea5dd1..d4e4d53e8b44b 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c @@ -441,6 +441,9 @@ int main(int argc, const char **argv) srandom(time(NULL)); + /* Setting $PERF_CONFIG makes perf read _only_ the given config file. */ + config_exclusive_filename = getenv("PERF_CONFIG"); + err = perf_config(perf_default_config, NULL); if (err) return err; -- 2.20.1