summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2019-07-30 11:20:55 -0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-05 13:13:38 +0200
commita056ef7090e265f0e5ad0e40cab02313cb34d698 (patch)
treefd2a2c052f6e74055e10b312578fc751548e4c54 /tools
parentb134b502d3b62ecb235281866a355ff8b6e67e3a (diff)
downloadlinux-stable-a056ef7090e265f0e5ad0e40cab02313cb34d698.tar.gz
linux-stable-a056ef7090e265f0e5ad0e40cab02313cb34d698.tar.bz2
linux-stable-a056ef7090e265f0e5ad0e40cab02313cb34d698.zip
perf config: Honour $PERF_CONFIG env var to specify alternate .perfconfig
[ 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 <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Taeung Song <treeze.taeung@gmail.com> 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 <acme@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/perf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 72df4b6fa36f..4c45cdf38ada 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -440,6 +440,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;