Skip to content

Commit 7b1642f

Browse files
committed
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: Jiri Olsa <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Namhyung Kim <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 160d4af commit 7b1642f

File tree

1 file changed

+7
-3
lines changed
  • tools/perf/tests

1 file changed

+7
-3
lines changed

tools/perf/tests/make

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ endif
2828

2929
PARALLEL_OPT=
3030
ifeq ($(SET_PARALLEL),1)
31-
cores := $(shell (getconf _NPROCESSORS_ONLN || egrep -c '^processor|^CPU[0-9]' /proc/cpuinfo) 2>/dev/null)
32-
ifeq ($(cores),0)
33-
cores := 1
31+
ifeq ($(JOBS),)
32+
cores := $(shell (getconf _NPROCESSORS_ONLN || egrep -c '^processor|^CPU[0-9]' /proc/cpuinfo) 2>/dev/null)
33+
ifeq ($(cores),0)
34+
cores := 1
35+
endif
36+
else
37+
cores=$(JOBS)
3438
endif
3539
PARALLEL_OPT="-j$(cores)"
3640
endif

0 commit comments

Comments
 (0)