Skip to content
Snippets Groups Projects
Commit 30610b6e authored by Andre Maroneze's avatar Andre Maroneze
Browse files

[analysis-scripts] add .wp target and rules to analysis makefile

parent 9bcc34d7
No related branches found
No related tags found
No related merge requests found
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
# EVAFLAGS flags to use with the Eva plugin # EVAFLAGS flags to use with the Eva plugin
# EVABUILTINS Eva builtins to be set (via -eva-builtin) # EVABUILTINS Eva builtins to be set (via -eva-builtin)
# EVAUSESPECS Eva functions to be overridden by specs (-eva-use-spec) # EVAUSESPECS Eva functions to be overridden by specs (-eva-use-spec)
# WPFLAGS flags to use with the WP plugin
# #
# FLAMEGRAPH If set (to any value), running an analysis will produce an # FLAMEGRAPH If set (to any value), running an analysis will produce an
# SVG + HTML flamegraph at the end. # SVG + HTML flamegraph at the end.
...@@ -127,6 +128,7 @@ EVAFLAGS ?= \ ...@@ -127,6 +128,7 @@ EVAFLAGS ?= \
-calldeps -from-verbose 0 \ -calldeps -from-verbose 0 \
$(if $(EVABUILTINS), -eva-builtin=$(call fc_list,$(EVABUILTINS)),) \ $(if $(EVABUILTINS), -eva-builtin=$(call fc_list,$(EVABUILTINS)),) \
$(if $(EVAUSESPECS), -eva-use-spec $(call fc_list,$(EVAUSESPECS)),) $(if $(EVAUSESPECS), -eva-use-spec $(call fc_list,$(EVAUSESPECS)),)
WPFLAGS ?=
FCFLAGS ?= FCFLAGS ?=
FCGUIFLAGS ?= FCGUIFLAGS ?=
...@@ -157,7 +159,7 @@ SHELL := $(shell which bash) ...@@ -157,7 +159,7 @@ SHELL := $(shell which bash)
.FORCE: .FORCE:
.SUFFIXES: # Disable make builtins .SUFFIXES: # Disable make builtins
%.parse/command %.eva/command: %.parse/command %.eva/command %.wp/command:
@# @#
%.parse: SOURCES = $(filter-out %/command,$^) %.parse: SOURCES = $(filter-out %/command,$^)
...@@ -184,7 +186,7 @@ SHELL := $(shell which bash) ...@@ -184,7 +186,7 @@ SHELL := $(shell which bash)
printf 'cmd_args=%q\n' "$(subst ",\",$(wordlist 2,999,$(PARSE)))" printf 'cmd_args=%q\n' "$(subst ",\",$(wordlist 2,999,$(PARSE)))"
} >> $@/stats.txt } >> $@/stats.txt
mv $@/{running,command} mv $@/{running,command}
touch $@ # Update timestamp and prevents remake if nothing changes touch $@ # Update timestamp and prevent remake if nothing changes
%.eva: EVA = $(FRAMAC) $(FCFLAGS) -eva $(EVAFLAGS) %.eva: EVA = $(FRAMAC) $(FCFLAGS) -eva $(EVAFLAGS)
%.eva: PARSE_RESULT = $(word 1,$(subst ., ,$*)).parse %.eva: PARSE_RESULT = $(word 1,$(subst ., ,$*)).parse
...@@ -226,6 +228,34 @@ SHELL := $(shell which bash) ...@@ -226,6 +228,34 @@ SHELL := $(shell which bash)
mv $@/{running,command} mv $@/{running,command}
touch $@ # Update timestamp and prevents remake if nothing changes touch $@ # Update timestamp and prevents remake if nothing changes
%.wp: WP = $(FRAMAC) $(FCFLAGS) -wp $(WPFLAGS)
%.wp: PARSE_RESULT = $(word 1,$(subst ., ,$*)).parse
%.wp: $$(PARSE_RESULT) $$(shell $(DIR)cmd-dep.sh $$@/command $$(WP)) $(if $(BENCHMARK),.FORCE,)
@$(call display_command,$(WP))
mkdir -p $@
mv -f $@/{command,running}
{
$(call time_with_output,$@/stats.txt) \
$(WP) \
-load $(PARSE_RESULT)/framac.sav -save $@/framac.sav \
-kernel-log w:$@/warnings.log \
-wp-log w:$@/warnings.log \
-then \
-report-csv $@/alarms.csv -report-no-proven \
-report-log w:$@/warnings.log \
|| ($(RM) $@/stats.txt && false) # Prevents having error code reporting in stats.txt
} 2>&1 |
tee $@/wp.log
{
printf 'timestamp=%q\n' "$(HR_TIMESTAMP)";
printf 'warnings=%s\n' "`cat $@/warnings.log | grep ':\[\(wp\|kernel\)\]' | wc -l`";
printf 'alarms=%s\n' "`expr $$(cat $@/alarms.csv | wc -l) - 1`";
printf 'cmd_args=%q\n' "$(subst ",\",$(wordlist 2,999,$(WP)))";
printf 'benchmark_tag=%s' "$(BENCHMARK)"
} >> $@/stats.txt
mv $@/{running,command}
touch $@ # Update timestamp and prevent remake if nothing changes
%.gui: % %.gui: %
$(FRAMAC_GUI) $(FCGUIFLAGS) -load $^/framac.sav & $(FRAMAC_GUI) $(FCGUIFLAGS) -load $^/framac.sav &
......
...@@ -27,6 +27,9 @@ FCFLAGS += \ ...@@ -27,6 +27,9 @@ FCFLAGS += \
EVAFLAGS += \ EVAFLAGS += \
-eva-warn-key builtins:missing-spec=abort \ -eva-warn-key builtins:missing-spec=abort \
## WP-specific flags
WPFLAGS += \
## GUI-only flags ## GUI-only flags
FCGUIFLAGS += \ FCGUIFLAGS += \
......
...@@ -29,6 +29,9 @@ FCFLAGS += \ ...@@ -29,6 +29,9 @@ FCFLAGS += \
EVAFLAGS += \ EVAFLAGS += \
-eva-warn-key builtins:missing-spec=abort \ -eva-warn-key builtins:missing-spec=abort \
## WP-specific flags
WPFLAGS += \
## GUI-only flags ## GUI-only flags
FCGUIFLAGS += \ FCGUIFLAGS += \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment