2015-02-19 00:00:22

by David Ahern

[permalink] [raw]
Subject: [PATCH] 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 "".

Signed-off-by: David Ahern <[email protected]>
---
tools/perf/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index cb2e5868c8e8..d5020aeb5626 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -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
--
1.9.3