Merge branch 'jk/cocci-batch'
Optionally "make coccicheck" can feed multiple source files to spatch, gaining performance while spending more memory. * jk/cocci-batch: coccicheck: make batch size of 0 mean "unlimited" coccicheck: optionally batch spatch invocations
This commit is contained in:
commit
6795fc8afd
19
Makefile
19
Makefile
@ -1171,8 +1171,11 @@ PTHREAD_CFLAGS =
|
|||||||
SPARSE_FLAGS ?=
|
SPARSE_FLAGS ?=
|
||||||
SP_EXTRA_FLAGS =
|
SP_EXTRA_FLAGS =
|
||||||
|
|
||||||
# For the 'coccicheck' target
|
# For the 'coccicheck' target; setting SPATCH_BATCH_SIZE higher will
|
||||||
|
# usually result in less CPU usage at the cost of higher peak memory.
|
||||||
|
# Setting it to 0 will feed all files in a single spatch invocation.
|
||||||
SPATCH_FLAGS = --all-includes --patch .
|
SPATCH_FLAGS = --all-includes --patch .
|
||||||
|
SPATCH_BATCH_SIZE = 1
|
||||||
|
|
||||||
include config.mak.uname
|
include config.mak.uname
|
||||||
-include config.mak.autogen
|
-include config.mak.autogen
|
||||||
@ -2807,12 +2810,14 @@ endif
|
|||||||
|
|
||||||
%.cocci.patch: %.cocci $(COCCI_SOURCES)
|
%.cocci.patch: %.cocci $(COCCI_SOURCES)
|
||||||
@echo ' ' SPATCH $<; \
|
@echo ' ' SPATCH $<; \
|
||||||
ret=0; \
|
if test $(SPATCH_BATCH_SIZE) = 0; then \
|
||||||
for f in $(COCCI_SOURCES); do \
|
limit=; \
|
||||||
$(SPATCH) --sp-file $< $$f $(SPATCH_FLAGS) || \
|
else \
|
||||||
{ ret=$$?; break; }; \
|
limit='-n $(SPATCH_BATCH_SIZE)'; \
|
||||||
done >$@+ 2>$@.log; \
|
fi; \
|
||||||
if test $$ret != 0; \
|
if ! echo $(COCCI_SOURCES) | xargs $$limit \
|
||||||
|
$(SPATCH) --sp-file $< $(SPATCH_FLAGS) \
|
||||||
|
>$@+ 2>$@.log; \
|
||||||
then \
|
then \
|
||||||
cat $@.log; \
|
cat $@.log; \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
|
Loading…
Reference in New Issue
Block a user