diff options
author | Arnaldo Carvalho de Melo <[email protected]> | 2020-03-02 11:23:03 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2020-03-02 11:23:03 -0300 |
commit | ebcb9464a2ae3a547e97de476575c82ece0e93e2 (patch) | |
tree | dc434255f86483e86cb6675d7a37759bccf7b4b7 /tools/perf/scripts/python/Perf-Trace-Util/lib | |
parent | cff20b3151ccab690715cb6cf0f5da5cccb32adf (diff) |
perf env: Do not return pointers to local variables
It is possible to return a pointer to a local variable when looking up
the architecture name for the running system and no normalization is
done on that value, i.e. we may end up returning the uts.machine local
variable.
While this doesn't happen on most arches, as normalization takes place,
lets fix this by making that a static variable and optimize it a bit by
not always running uname(), only the first time.
Noticed in fedora rawhide running with:
[perfbuilder@a5ff49d6e6e4 ~]$ gcc --version
gcc (GCC) 10.0.1 20200216 (Red Hat 10.0.1-0.8)
Reported-by: Jiri Olsa <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Namhyung Kim <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/Perf-Trace-Util/lib')
0 files changed, 0 insertions, 0 deletions