diff options
author | Arnaldo Carvalho de Melo <[email protected]> | 2019-07-30 11:20:55 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2019-08-12 16:26:02 -0300 |
commit | 61a461fcbd62d42c29a1ea6a9cc3838ad9f49401 (patch) | |
tree | a9f5a52892c20035e20ad3b7a04414d7bed9e889 | |
parent | 57fc032ad643ffd018d66bd4c1bd3a91de4841e8 (diff) |
perf config: Honour $PERF_CONFIG env var to specify alternate .perfconfig
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 <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Luis Cláudio Gonçalves <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Taeung Song <[email protected]>
Fixes: 078006012401 ("perf_counter tools: add in basic glue from Git")
Link: https://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r-- | tools/perf/perf.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/perf.c b/tools/perf/perf.c index 97e2628ea5dd..d4e4d53e8b44 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; |