]> git.ipfire.org Git - thirdparty/gcc.git/commit
Limit perf data buffer during profiling
authorAndi Kleen <ak@linux.intel.com>
Fri, 12 May 2017 10:09:50 +0000 (10:09 +0000)
committerAndi Kleen <ak@gcc.gnu.org>
Fri, 12 May 2017 10:09:50 +0000 (10:09 +0000)
commit2ead1ab91123d2af20dac4dfa551355dacfef00d
treeaccb4352f0ad827a9fd48ac1961a0d84dd890504
parent1e47f02b6390db82d2e7dcc7eec3bb888c78318a
Limit perf data buffer during profiling

With high -j parallelism the autofdo tests can randomly fail.
autofdo uses Linux perf to record profiling data.
Linux perf uses a locked perf buffer. By default it has
around 516k buffer per uid (/proc/sys/kernel/perf_event_mlock_kb).

An individual perf record tries to grab the full 516k,
which makes parallel perf record fail.

This patch limits the perf buffer for individual perf record to 8k.
With the default settings this allows a parallelism of the test
cases of 16, which is hopefully good enough

(if not would need to add some kind of semaphore, or ask
the user to increase the limit as root)

I also removed an unneeded -o perf.data option

Thanks to Marcin to finally spotting the problem.

Passes bootstrap and test on x86_64-linux. Ok for trunk?

gcc/testsuite/:

2017-05-12  Andi Kleen  <ak@linux.intel.com>

PR testsuite/77684
* lib/target-supports.exp (profopt-perf-wrapper):
Add -m8 option to increase parallelism.

From-SVN: r247962
gcc/testsuite/ChangeLog
gcc/testsuite/lib/target-supports.exp