Coverity: limit number of make jobs
It is usually a bad idea use '-j' without and parameter because it
some cases (large amount of jobs) it may swamp the processor,
decreasing the performance considerably.
A side effect of this change: the time spent by the sytem in user
space (mostly compilation and coverity analysis) is reduced by 10%
when running tf-cov-make script through run_coverity_on_tf.py.
Change-Id: I55db0706708a4a140eef06a95a4fb0a32c0bb0bc
Signed-off-by: Leonardo Sandoval <leonardo.sandoval@linaro.org>
diff --git a/script/tf-coverity/tf-cov-make b/script/tf-coverity/tf-cov-make
index 6bcb93d..cda8227 100755
--- a/script/tf-coverity/tf-cov-make
+++ b/script/tf-coverity/tf-cov-make
@@ -66,12 +66,14 @@
# Defines common flags between platforms
common_flags() {
local release="${1:-}"
+ local num_cpus="$(/usr/bin/getconf _NPROCESSORS_ONLN)"
+ local parallel_make="-j $num_cpus"
# default to debug mode, unless a parameter is passed to the function
debug="DEBUG=1"
[ -n "$release" ] && debug=""
- echo " -j $debug -s "
+ echo " $parallel_make $debug -s "
}
#