From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757743AbcAKJip (ORCPT ); Mon, 11 Jan 2016 04:38:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45381 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750813AbcAKJio (ORCPT ); Mon, 11 Jan 2016 04:38:44 -0500 Date: Mon, 11 Jan 2016 10:38:40 +0100 From: Jiri Olsa To: Wang Nan Cc: acme@kernel.org, jolsa@kernel.org, namhyung@kernel.or, lizefan@huawei.com, pi3orama@163.com, linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Namhyung Kim Subject: Re: [PATCH 4/6] perf tools: Set parallel making options build-test Message-ID: <20160111093840.GE15415@krava.brq.redhat.com> References: <1452263041-225488-1-git-send-email-wangnan0@huawei.com> <1452263041-225488-5-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1452263041-225488-5-git-send-email-wangnan0@huawei.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 08, 2016 at 02:23:59PM +0000, Wang Nan wrote: > 'make build-test' is painful because of time consuming. In a full test, > all test cases are built twice with tools/perf/Makefile and > tools/perf/Makefile.perf. 'Makefile' automatically computes parallel > options for make, but 'Makefile.perf' not, so all test cases is built > with one job. It is very slow. > > This patch adds '-j' options to Makefile.perf testing. It computes > parallel building options like what tools/perf/Makefile does, and pass > '-j' option to Makefile.perf test. > > Signed-off-by: Wang Nan > Cc: Arnaldo Carvalho de Melo > Cc: Jiri Olsa > Cc: Namhyung Kim > --- > tools/perf/tests/make | 23 ++++++++++++++++------- > 1 file changed, 16 insertions(+), 7 deletions(-) > > diff --git a/tools/perf/tests/make b/tools/perf/tests/make > index 130be7c..bd9c61a 100644 > --- a/tools/perf/tests/make > +++ b/tools/perf/tests/make > @@ -3,7 +3,7 @@ ifeq ($(MAKECMDGOALS),) > # no target specified, trigger the whole suite > all: > @echo "Testing Makefile"; $(MAKE) -sf tests/make MK=Makefile > - @echo "Testing Makefile.perf"; $(MAKE) -sf tests/make MK=Makefile.perf > + @echo "Testing Makefile.perf"; $(MAKE) -sf tests/make MK=Makefile.perf SET_PARALLEL=1 > else > # run only specific test over 'Makefile' > %: > @@ -12,6 +12,15 @@ endif > else > PERF := . > > +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 > + endif > + PARALLEL_OPT="-j$(cores)" > +endif we could share this with Makefile, but there's probably no point to librarize single line ATM Acked-by: Jiri Olsa thanks, jirka