From: Arnaldo Carvalho de Melo Date: Tue, 30 Jul 2019 14:20:55 +0000 (-0300) Subject: perf config: Honour $PERF_CONFIG env var to specify alternate .perfconfig X-Git-Tag: v4.19.77~145 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=96b61fe7a5f755d7f268f2ab2eee3d017d115e5b;p=platform%2Fkernel%2Flinux-rpi.git 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 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 --- diff --git a/tools/perf/perf.c b/tools/perf/perf.c index a11cb00..80f8ae8 100644 --- a/tools/perf/perf.c +++ b/tools/perf/perf.c @@ -439,6 +439,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;