perf build-test: Honour JOBS to override detection of number of cores

When one does:

  $ make -C tools/perf build-test

The makefile in tools/perf/tests/ will, just like the main one, detect
how many cores are in the system and use it with -j.

Sometimes we may need to override that, for instance, when using
icecream or distcc to use multiple machines in the build process, then
we need to, as with the main makefile, use:

  $ make JOBS=N -C tools/perf build-test

Fix the tests makefile to honour that.
Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/lkml/20200330130301.GA31702@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 160d4af9
...@@ -28,9 +28,13 @@ endif ...@@ -28,9 +28,13 @@ endif
PARALLEL_OPT= PARALLEL_OPT=
ifeq ($(SET_PARALLEL),1) ifeq ($(SET_PARALLEL),1)
cores := $(shell (getconf _NPROCESSORS_ONLN || egrep -c '^processor|^CPU[0-9]' /proc/cpuinfo) 2>/dev/null) ifeq ($(JOBS),)
ifeq ($(cores),0) cores := $(shell (getconf _NPROCESSORS_ONLN || egrep -c '^processor|^CPU[0-9]' /proc/cpuinfo) 2>/dev/null)
cores := 1 ifeq ($(cores),0)
cores := 1
endif
else
cores=$(JOBS)
endif endif
PARALLEL_OPT="-j$(cores)" PARALLEL_OPT="-j$(cores)"
endif endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment