Skip to contentSkip to conversation

perf: Compare JOBS to 0 after grep

PATCH New David Ahern 2 participants 2 messages Feb 19, 2015 – Mar 3, 2015 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf: Compare JOBS to 0 after grep

If JOBS is not by user perf tries to autodetect the number by grepping the number of CPUs from /proc/cpuinfo. 'grep -c' will always return an integer so after this command JOBS should be compared to 0, not "".

---
 tools/perf/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/Makefile +1 -1
index cb2e5868c8e8..d5020aeb5626 100644
@@ -25,7 +25,7 @@ unexport MAKEFLAGS
 #
 ifeq ($(JOBS),)
   JOBS := $(shell grep -c ^processor /proc/cpuinfo 2>/dev/null)
-  ifeq ($(JOBS),)
+  ifeq ($(JOBS),0)
     JOBS := 1
   endif
 endif
Signature · 1 line
1.9.3
#1 lore raw

[tip:perf/core] perf tools: Compare JOBS to 0 after grep

perf tools: Compare JOBS to 0 after grep
Commit-ID:  c65568c5456e5216e5467e81d1e04c1f5bdd453f
Gitweb:     http://git.kernel.org/tip/c65568c5456e5216e5467e81d1e04c1f5bdd453f
Author:     David Ahern <[email protected]>
AuthorDate: Wed, 18 Feb 2015 18:59:31 -0500
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 2 Mar 2015 11:51:00 -0300

perf tools: Compare JOBS to 0 after grep

If JOBS is not by user perf tries to autodetect the number by grepping the number of CPUs from /proc/cpuinfo. 'grep -c' will always return an integer so after this command JOBS should be compared to 0, not "".

---
 tools/perf/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/Makefile +1 -1
index cb2e586..d5020ae 100644
@@ -25,7 +25,7 @@ unexport MAKEFLAGS
 #
 ifeq ($(JOBS),)
   JOBS := $(shell grep -c ^processor /proc/cpuinfo 2>/dev/null)
-  ifeq ($(JOBS),)
+  ifeq ($(JOBS),0)
     JOBS := 1
   endif
 endif