perf: Fix parallel build
PATCH 1/1 perf: Fix parallel build
Parallel builds of perf were failing for me on a 32p box, with:
* new build flags or prefix
util/pmu.l:7:23: error: pmu-bison.h: No such file or directory
...
make: *** [util/pmu-flex.o] Error 1
make: *** Waiting for unfinished jobs....
This can pretty quickly be seen by adding a sleep in front of the bison call in tools/perf/Makefile and running make -j4 on a smaller box:
sleep 10; $(QUIET_BISON)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.c
Adding the following dependency fixes it for me:
---
tools/perf/Makefile +1 -1
@@ -219,7 +219,7 @@ $(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-events-bison.c: util/parse-events.y $(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $(OUTPUT)util/parse-events-bison.c -$(OUTPUT)util/pmu-flex.c: util/pmu.l +$(OUTPUT)util/pmu-flex.c: util/pmu.l util/pmu-bison.c $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t util/pmu.l > $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c: util/pmu.y
Namhyung Kim
maintainerHi Eric,
Quoted 26 lines · Eric Sandeen
Parallel builds of perf were failing for me on a 32p box, with:
* new build flags or prefix
util/pmu.l:7:23: error:pmu-bison.h: No such file or directory...
make: *** [
util/pmu-flex.o] Error 1
make: *** Waiting for unfinished jobs....This can pretty quickly be seen by adding a sleep in front of the bison call in
tools/perf/Makefileand running make -j4 on a smaller box:sleep 10; $(QUIET_BISON)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.cAdding the following dependency fixes it for me:
Signed-off-by Eric Sandeen <[email protected]>---
tools/perf/Makefile +0
-0
tools/perf/Makefile $(OUTPUT)util/parse-events-flex.c: util/parse-events.l · line 225
Quoted 8 lines
tools/perf/Makefile +1
-1@@ -219,7 +219,7 @@ $(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-events-bison.c: util/parse-events.y $(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $(OUTPUT)util/parse-events-bison.c -$(OUTPUT)util/pmu-flex.c: util/pmu.l +$(OUTPUT)util/pmu-flex.c: util/pmu.l util/pmu-bison.c $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t util/pmu.l > $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c: util/pmu.y
I guess the $(OUTPUT)util/parse-events-flex.c: line has the same problem. Could you check and submit a patch for that too?
Thanks,
Namhyung
Quoted 36 lines · Namhyung Kim
Hi Eric,
Quoted 33 lines · Eric Sandeen
Parallel builds of perf were failing for me on a 32p box, with:
* new build flags or prefix
util/pmu.l:7:23: error:pmu-bison.h: No such file or directory...
make: *** [
util/pmu-flex.o] Error 1
make: *** Waiting for unfinished jobs....This can pretty quickly be seen by adding a sleep in front of the bison call in
tools/perf/Makefileand running make -j4 on a smaller box:sleep 10; $(QUIET_BISON)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.cAdding the following dependency fixes it for me:
Signed-off-by Eric Sandeen <[email protected]>---
tools/perf/Makefile +1
-1@@ -219,7 +219,7 @@ $(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-events-bison.c: util/parse-events.y $(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $(OUTPUT)util/parse-events-bison.c -$(OUTPUT)util/pmu-flex.c: util/pmu.l +$(OUTPUT)util/pmu-flex.c: util/pmu.l util/pmu-bison.c $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t util/pmu.l > $(OUTPUT)util/pmu-flex.c
Quoted 8 lines
tools/perf/Makefile $(OUTPUT)util/parse-events-flex.c: util/parse-events.l · line 225
Quoted 1 line
tools/perf/Makefile +0
-0$(OUTPUT)util/pmu-bison.c: util/pmu.yI guess the $(OUTPUT)util/parse-events-flex.c: line has the same problem. Could you check and submit a patch for that too?
Thanks,
Namhyung
Whoops you are right, will resent V2 shortly, thanks.
-Eric
PATCH v2 1/1 perf: Fix parallel build
In reply to Eric SandeenParallel builds of perf were failing for me on a 32p box, with:
* new build flags or prefix
util/pmu.l:7:23: error: pmu-bison.h: No such file or directory
...
make: *** [util/pmu-flex.o] Error 1
make: *** Waiting for unfinished jobs....
This can pretty quickly be seen by adding a sleep in front of the bison calls in tools/perf/Makefile and running make -j4 on a smaller box i.e.:
sleep 10; $(QUIET_BISON)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.c
Adding the following dependencies fixes it for me.
---
V2: Fix other bison dependency caught by Namhyung Kim <[email protected]>, thanks.
tools/perf/Makefile +2 -2
@@ -221,13 +221,13 @@ export PERL_PATH FLEX = flex BISON= bison -$(OUTPUT)util/parse-events-flex.c: util/parse-events.l +$(OUTPUT)util/parse-events-flex.c: util/parse-events.l util/parse-events-bison.c $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) -t util/parse-events.l > $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c: util/parse-events.y $(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $(OUTPUT)util/parse-events-bison.c -$(OUTPUT)util/pmu-flex.c: util/pmu.l +$(OUTPUT)util/pmu-flex.c: util/pmu.l util/pmu-bison.c $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t util/pmu.l > $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c: util/pmu.y
Namhyung Kim
maintainerHi again,
Quoted 2 lines · Eric Sandeen
-$(OUTPUT)util/parse-events-flex.c: util/parse-events.l +$(OUTPUT)util/parse-events-flex.c: util/parse-events.l
util/parse-events-bison.c
I realized that the generated *-bison.c files should have $(OUTPUT) prefix since they can be under another directory than *.[ly] files.
tools/perf/Makefile export PERL_PATH · line 230
Quoted 7 lines
tools/perf/Makefile +1
-1$(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) -t util/parse-events.l > $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c: util/parse-events.y $(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $(OUTPUT)util/parse-events-bison.c -$(OUTPUT)util/pmu-flex.c: util/pmu.l +$(OUTPUT)util/pmu-flex.c: util/pmu.l util/pmu-bison.c
Ditto.
Thanks,
Namhyung
Quoted 3 lines
$(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t util/pmu.l > $(OUTPUT)util/pmu-flex.c
$(OUTPUT)util/pmu-bison.c: util/pmu.y
Quoted 12 lines · Namhyung Kim
Hi again,
Quoted 2 lines · Eric Sandeen
-$(OUTPUT)util/parse-events-flex.c: util/parse-events.l +$(OUTPUT)util/parse-events-flex.c: util/parse-events.l
util/parse-events-bison.cI realized that the generated *-bison.c files should have $(OUTPUT) prefix since they can be under another directory than *.[ly] files.
Quoted 2 lines
$(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) -t util/parse-events.l > $(OUTPUT)util/parse-events-flex.c
Quoted 7 lines
Quoted 5 lines
$(OUTPUT)util/parse-events-bison.c: util/parse-events.y
$(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $(OUTPUT)util/parse-events-bison.c-$(OUTPUT)util/pmu-flex.c: util/pmu.l +$(OUTPUT)util/pmu-flex.c: util/pmu.l
util/pmu-bison.cDitto.
Sorry. Too long since I worked on Makefiles :(
V3 soon ;)
-Eric
Quoted 7 lines
Thanks,
NamhyungQuoted 3 lines
$(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t util/pmu.l > $(OUTPUT)util/pmu-flex.c
$(OUTPUT)util/pmu-bison.c: util/pmu.y
PATCH v3 1/1 perf: Fix parallel build
In reply to Namhyung KimParallel builds of perf were failing for me on a 32p box, with:
* new build flags or prefix
util/pmu.l:7:23: error: pmu-bison.h: No such file or directory
...
make: *** [util/pmu-flex.o] Error 1
make: *** Waiting for unfinished jobs....
This can pretty quickly be seen by adding a sleep in front of the bison calls in tools/perf/Makefile and running make -j4 on a smaller box i.e.:
sleep 10; $(QUIET_BISON)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.c
Adding the following dependencies fixes it for me.
---
V2: Fix other bison dependency caught by Namhyung Kim <[email protected]>, thanks.
V3: Add $(OUTPUT) to generated deps, thanks again.
tools/perf/Makefile +2 -2
@@ -221,13 +221,13 @@ export PERL_PATH FLEX = flex BISON= bison -$(OUTPUT)util/parse-events-flex.c: util/parse-events.l +$(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-events-bison.c $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) -t util/parse-events.l > $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c: util/parse-events.y $(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $(OUTPUT)util/parse-events-bison.c -$(OUTPUT)util/pmu-flex.c: util/pmu.l +$(OUTPUT)util/pmu-flex.c: util/pmu.l $(OUTPUT)util/pmu-bison.c $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t util/pmu.l > $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c: util/pmu.y
Quoted 14 lines · Eric Sandeen
Parallel builds of perf were failing for me on a 32p box, with:
* new build flags or prefix
util/pmu.l:7:23: error:pmu-bison.h: No such file or directory...
make: *** [
util/pmu-flex.o] Error 1
make: *** Waiting for unfinished jobs....This can pretty quickly be seen by adding a sleep in front of the bison calls in
tools/perf/Makefileand running make -j4 on a smaller box i.e.:
Quoted 5 lines
sleep 10; $(QUIET_BISON)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.cAdding the following dependencies fixes it for me.
Signed-off-by Eric Sandeen <[email protected]>
Thanks for fixing this!
Namhyung
[tip:perf/core] perf tools: Fix parallel build
In reply to Eric SandeenCommit-ID: e6048fb8602648eabee96476b2703807d5e89409 Gitweb: http://git.kernel.org/tip/e6048fb8602648eabee96476b2703807d5e89409 Author: Eric Sandeen <[email protected]> AuthorDate: Thu, 20 Sep 2012 21:31:44 -0500 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Fri, 21 Sep 2012 12:13:21 -0300
perf tools: Fix parallel build
Parallel builds of perf were failing for me on a 32p box, with:
* new build flags or prefix
util/pmu.l:7:23: error: pmu-bison.h: No such file or directory
...
make: *** [util/pmu-flex.o] Error 1
make: *** Waiting for unfinished jobs....
This can pretty quickly be seen by adding a sleep in front of the bison calls in tools/perf/Makefile and running make -j4 on a smaller box i.e.:
sleep 10; $(QUIET_BISON)$(BISON) -v util/pmu.y -d -o $(OUTPUT)util/pmu-bison.c
Adding the following dependencies fixes it for me.
--- tools/perf/Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/Makefile +2 -2
@@ -233,13 +233,13 @@ export PERL_PATH FLEX = flex BISON= bison -$(OUTPUT)util/parse-events-flex.c: util/parse-events.l +$(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-events-bison.c $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) -t util/parse-events.l > $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c: util/parse-events.y $(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $(OUTPUT)util/parse-events-bison.c -$(OUTPUT)util/pmu-flex.c: util/pmu.l +$(OUTPUT)util/pmu-flex.c: util/pmu.l $(OUTPUT)util/pmu-bison.c $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t util/pmu.l > $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c: util/pmu.y