From d27afe7ab1d199100808054127af32a4da92c26a Mon Sep 17 00:00:00 2001
From: Jason Hiser <jdhiser@gmail.com>
Date: Mon, 26 Nov 2018 16:08:26 +0000
Subject: [PATCH] Updated cfar configs to leverage thanos better

Former-commit-id: ead74262e76000d3c37f11202ce93a1d7b99a87b
---
 ...robBilr_probP1_probNog_probHeaprand_probSS_zipr.sh |  9 ++++++++-
 .../cfar_probBilr_probP1_probNog_probHeaprand_zipr.sh |  8 +++++++-
 ...P1Canaries_structNog_probHeaprand_structSS_zipr.sh | 11 ++++++++++-
 ...oc_structP1Canaries_structNog_probHeaprand_zipr.sh | 10 +++++++++-
 tools/ps_analyze.sh                                   |  9 +++++++++
 5 files changed, 43 insertions(+), 4 deletions(-)

diff --git a/tools/cfar_configs/cfar_probBilr_probP1_probNog_probHeaprand_probSS_zipr.sh b/tools/cfar_configs/cfar_probBilr_probP1_probNog_probHeaprand_probSS_zipr.sh
index 6ad93ea79..37c614f26 100755
--- a/tools/cfar_configs/cfar_probBilr_probP1_probNog_probHeaprand_probSS_zipr.sh
+++ b/tools/cfar_configs/cfar_probBilr_probP1_probNog_probHeaprand_probSS_zipr.sh
@@ -1,5 +1,12 @@
 #!/bin/bash 
 source $(dirname $0)/../ps_wrapper.source $0
 
-$PEASOUP_HOME/tools/cfar.sh "$@" --backend zipr -c diehard=on -c p1transform=on --config_name $(basename $0 .sh|sed "s/cfar_//") -c stack_stamp=on -c move_globals=on --step-option zipr:"--large_only:nog_on true" --step-option move_globals:-d --step-option move_globals:.interp --step-option move_globals:--aggressive
+$PEASOUP_HOME/tools/cfar.sh "$@" --backend zipr  \
+	-c p1transform=on  \
+	-c stack_stamp=on  \
+	-c move_globals=on  \
+	-c diehard=on  \
+	--step-option zipr:"--large_only:nog_on true"  \
+	--step-option move_globals:-d --step-option move_globals:.interp --step-option move_globals:--aggressive \
+	--config_name $(basename $0 .sh|sed "s/cfar_//") 
 
diff --git a/tools/cfar_configs/cfar_probBilr_probP1_probNog_probHeaprand_zipr.sh b/tools/cfar_configs/cfar_probBilr_probP1_probNog_probHeaprand_zipr.sh
index b03787ea4..348095ccb 100755
--- a/tools/cfar_configs/cfar_probBilr_probP1_probNog_probHeaprand_zipr.sh
+++ b/tools/cfar_configs/cfar_probBilr_probP1_probNog_probHeaprand_zipr.sh
@@ -1,5 +1,11 @@
 #!/bin/bash 
 source $(dirname $0)/../ps_wrapper.source $0
 
-$PEASOUP_HOME/tools/cfar.sh "$@" --backend zipr --step diehard=on --step p1transform=on --config_name $(basename $0 .sh|sed "s/cfar_//") --step move_globals=on --step-option zipr:"--large_only:nog_on true" --step-option move_globals:-d --step-option move_globals:.interp --step-option move_globals:--aggressive
+$PEASOUP_HOME/tools/cfar.sh "$@" --backend zipr  \
+	-c p1transform=on  \
+	-c move_globals=on  \
+	-c diehard=on  \
+	--step-option zipr:"--large_only:nog_on true"  \
+	--step-option move_globals:-d --step-option move_globals:.interp --step-option move_globals:--aggressive \
+	--config_name $(basename $0 .sh|sed "s/cfar_//") 
 
diff --git a/tools/cfar_configs/cfar_structNoc_structP1Canaries_structNog_probHeaprand_structSS_zipr.sh b/tools/cfar_configs/cfar_structNoc_structP1Canaries_structNog_probHeaprand_structSS_zipr.sh
index fc0d0ebf1..828bf10be 100755
--- a/tools/cfar_configs/cfar_structNoc_structP1Canaries_structNog_probHeaprand_structSS_zipr.sh
+++ b/tools/cfar_configs/cfar_structNoc_structP1Canaries_structNog_probHeaprand_structSS_zipr.sh
@@ -1,4 +1,13 @@
 #!/bin/bash 
 source $(dirname $0)/../ps_wrapper.source $0
 
-$PEASOUP_HOME/tools/cfar.sh "$@" --backend zipr -c diehard=on --step-option zipr:"--zipr:seed $$" --structured_heap --structured_noc --step-option zipr:"--large_only:on true" --structured_p1_canaries  -c p1transform=on --config_name $(basename $0 .sh|sed "s/cfar_//") -c stack_stamp=on --structured_stack_stamp -c move_globals=on --structured_nog --step-option zipr:"--large_only:nog_on true" --step-option move_globals:-d --step-option move_globals:.interp --step-option move_globals:--aggressive
+$PEASOUP_HOME/tools/cfar.sh "$@" --backend zipr \
+	-c p1transform=on \
+	-c stack_stamp=on \
+	-c move_globals=on \
+	-c diehard=on \
+	--structured_heap --structured_noc --structured_nog --structured_stack_stamp --structured_p1_canaries  \
+	--step-option zipr:"--zipr:seed $$" --step-option zipr:"--large_only:on true" \
+	--step-option zipr:"--large_only:nog_on true" \
+	--step-option move_globals:-d --step-option move_globals:.interp --step-option move_globals:--aggressive \
+	--config_name $(basename $0 .sh|sed "s/cfar_//") 
diff --git a/tools/cfar_configs/cfar_structNoc_structP1Canaries_structNog_probHeaprand_zipr.sh b/tools/cfar_configs/cfar_structNoc_structP1Canaries_structNog_probHeaprand_zipr.sh
index ab8d95ccd..8c63cc8d6 100755
--- a/tools/cfar_configs/cfar_structNoc_structP1Canaries_structNog_probHeaprand_zipr.sh
+++ b/tools/cfar_configs/cfar_structNoc_structP1Canaries_structNog_probHeaprand_zipr.sh
@@ -1,4 +1,12 @@
 #!/bin/bash 
 source $(dirname $0)/../ps_wrapper.source $0
 
-$PEASOUP_HOME/tools/cfar.sh "$@" --backend zipr --step diehard=on --step-option zipr:"--zipr:seed $$" --structured_heap --structured_noc --step-option zipr:"--large_only:on true" --structured_p1_canaries  --step p1transform=on --config_name $(basename $0 .sh|sed "s/cfar_//") --step move_globals=on --structured_nog --step-option zipr:"--large_only:nog_on true" --step-option move_globals:-d --step-option move_globals:.interp --step-option move_globals:--aggressive
+$PEASOUP_HOME/tools/cfar.sh "$@" --backend zipr \
+	-c p1transform=on  \
+	-c move_globals=on  \
+	-c diehard=on  \
+	--step-option zipr:"--zipr:seed $$" --structured_heap --structured_noc --step-option zipr:"--large_only:on true"  \
+	--structured_p1_canaries  --structured_nog  \
+	--step-option zipr:"--large_only:nog_on true"  \
+	--step-option move_globals:-d --step-option move_globals:.interp --step-option move_globals:--aggressive \
+	--config_name $(basename $0 .sh|sed "s/cfar_//") 
diff --git a/tools/ps_analyze.sh b/tools/ps_analyze.sh
index 35add2c38..ba0ad09b2 100755
--- a/tools/ps_analyze.sh
+++ b/tools/ps_analyze.sh
@@ -769,11 +769,13 @@ do_plugins()
 
 		# first check if step can be invoked as a thanos plugin
                 if [ -x $plugin_path/lib$stepname.so ]; then
+
 			# if this step is a stop before/after step, cleanup anything outstanding so we can do the one step special.
 			if [[ $stepname == $stop_before_step ]] || [[ $stepname == $stop_after_step ]] ||
 			   [[ $stepname == $dump_before_step ]] || [[ $stepname == $dump_after_step ]]; then
 				run_current_thanos_steps
 			fi
+
 			# add step to the block of contiguous thanos plugins
 			stop_if_error $stepname			
 			if [[ $? -gt $error_threshold ]]; then
@@ -782,11 +784,18 @@ do_plugins()
 				thanos_plugins="$thanos_plugins \"$stepname -optional --step-args $cloneid $value\""	
 			fi
 			thanos_steps="$thanos_steps $stepname"
+
 			# if this step is a stop before/after step, do it special, so we exit early.
 			if [[ $stepname == $stop_before_step ]] || [[ $stepname == $stop_after_step ]]; then
+				# just run the step now.
 				perform_step $stepname none "$plugin_path/thanos.exe --no-redirect "$thanos_plugins""
+				thanos_steps=""
+				thanos_plugins=""
 			elif   [[ $stepname == $dump_before_step ]] || [[ $stepname == $dump_after_step ]]; then
+				# just run the step now.
 				perform_step $stepname none "$plugin_path/thanos.exe "$thanos_plugins""
+				thanos_steps=""
+				thanos_plugins=""
 			fi
 			continue
 		elif [[ $thanos_steps ]]; then 
-- 
GitLab