perf evsel: Fall back to global 'perf_env' in perf_evsel__env()
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 30 Sep 2019 14:48:32 +0000 (11:48 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 30 Sep 2019 20:29:57 +0000 (17:29 -0300)
commit9db0e3635fb35b6695275774ab909c51221b66ad
tree6598a9e707013cd46d88519d10b584c802a953f1
parentf67001a4a08eb124197ed4376941e1da9cf94b42
perf evsel: Fall back to global 'perf_env' in perf_evsel__env()

I.e. if evsel->evlist or evsel->evlist->env isn't set, return the
environment for the running machine, as that would be set if reading
from a perf.data file.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-uqq4grmhbi12rwb0lfpo6lfu@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/evsel.c
tools/perf/util/python.c