Skip to contentSkip to conversation

perf build-test: Honour JOBS to override detection of

PATCH Applied Arnaldo Carvalho de Melo 3 participants 3 messages Mar 30, 2020 – Apr 4, 2020 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf build-test: Honour JOBS to override detection of

Jiri,

Ack?

----

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.

Cc Adrian Hunter <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
---
 tools/perf/tests/make | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
tools/perf/tests/make +7 -3
index c850d1664c56..5d0c3a9c47a1 100644
@@ -28,9 +28,13 @@ endif
 
 PARALLEL_OPT=
 ifeq ($(SET_PARALLEL),1)
-  cores := $(shell (getconf _NPROCESSORS_ONLN || egrep -c '^processor|^CPU[0-9]' /proc/cpuinfo) 2>/dev/null)
-  ifeq ($(cores),0)
-    cores := 1
+  ifeq ($(JOBS),)
+    cores := $(shell (getconf _NPROCESSORS_ONLN || egrep -c '^processor|^CPU[0-9]' /proc/cpuinfo) 2>/dev/null)
+    ifeq ($(cores),0)
+      cores := 1
+    endif
+  else
+    cores=$(JOBS)
   endif
   PARALLEL_OPT="-j$(cores)"
 endif
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Arnaldo Carvalho de Melo

Jiri,

Ack?

yep ;-)

jirka

Quoted 50 lines

----

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.

Cc Adrian Hunter <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
---
 tools/perf/tests/make | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
tools/perf/tests/make +7 -3
index c850d1664c56..5d0c3a9c47a1 100644
@@ -28,9 +28,13 @@ endif
 
 PARALLEL_OPT=
 ifeq ($(SET_PARALLEL),1)
-  cores := $(shell (getconf _NPROCESSORS_ONLN || egrep -c '^processor|^CPU[0-9]' /proc/cpuinfo) 2>/dev/null)
-  ifeq ($(cores),0)
-    cores := 1
+  ifeq ($(JOBS),)
+    cores := $(shell (getconf _NPROCESSORS_ONLN || egrep -c '^processor|^CPU[0-9]' /proc/cpuinfo) 2>/dev/null)
+    ifeq ($(cores),0)
+      cores := 1
+    endif
+  else
+    cores=$(JOBS)
   endif
   PARALLEL_OPT="-j$(cores)"
 endif
Signature · 1 line
2.25.1
#2 lore raw

[tip: perf/urgent] perf build-test: Honour JOBS to override detection of number of cores

In reply to Arnaldo Carvalho de Melo
The following commit has been merged into the perf/urgent branch of tip:

The following commit has been merged into the perf/urgent branch of tip:

Commit-ID:     7b1642f2fc1e1f20948e806b7ce319f660633342
Gitweb:        https://git.kernel.org/tip/7b1642f2fc1e1f20948e806b7ce319f660633342
Author:        Arnaldo Carvalho de Melo <[email protected]>
AuthorDate:    Mon, 30 Mar 2020 09:32:41 -03:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Fri, 03 Apr 2020 09:37:55 -03:00

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.

---
 tools/perf/tests/make | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
tools/perf/tests/make +7 -3
index c850d16..5d0c3a9 100644
@@ -28,9 +28,13 @@ endif
 
 PARALLEL_OPT=
 ifeq ($(SET_PARALLEL),1)
-  cores := $(shell (getconf _NPROCESSORS_ONLN || egrep -c '^processor|^CPU[0-9]' /proc/cpuinfo) 2>/dev/null)
-  ifeq ($(cores),0)
-    cores := 1
+  ifeq ($(JOBS),)
+    cores := $(shell (getconf _NPROCESSORS_ONLN || egrep -c '^processor|^CPU[0-9]' /proc/cpuinfo) 2>/dev/null)
+    ifeq ($(cores),0)
+      cores := 1
+    endif
+  else
+    cores=$(JOBS)
   endif
   PARALLEL_OPT="-j$(cores)"
 endif