diff --git a/tools/p1xform.sh b/tools/p1xform.sh index cfdfa3463e96f7e1bd33437f44e041de2d79c1d9..f64ec7d683c9739ecbcac63ed0904a686b76ae48 100755 --- a/tools/p1xform.sh +++ b/tools/p1xform.sh @@ -1,6 +1,7 @@ #!/bin/sh # +# This is the main driver script for the P1 transform # Run this script from top-level directory created by the peasoup script # @@ -21,9 +22,6 @@ echo "==========================================" $PEASOUP_HOME/tools/p1xform.genspri.sh $P1_DIR a.ncexe a.ncexe.annot > $P1_DIR/genspri.out 2> $P1_DIR/genspri.err -# NOT NEEDED ANYMORE???? -#$PEASOUP_HOME/tools/generate_io_baseline.sh $CURRENT_DIR a.ncexe concolic.files_a.stratafied_0001 > gen_baseline.out 2> gen_baseline.err - # # remove any candidate functions not covered # this will go away once GrACE gives us the instruction coverage information @@ -36,15 +34,19 @@ FILTERED_OUT=$P1_DIR/p1.fn_coverage.filtered_out KEEPS=$P1_DIR/p1.keep FINAL_XFORM_FNS=$P1_DIR/p1.final EXECUTED_ADDRESS_FILE=$CONCOLIC/executed_address_list.txt +LIBC_FILTER=$PEASOUP_HOME/tools/p1xform.filter.libc.txt -#grep "^0x" $CONCOLIC/trace_manager.run_*.log | cut -f2 -d":" | sort | uniq > tmp.$$ -#$SECURITY_TRANSFORMS_HOME/tools/cover/cover a.ncexe a.ncexe.annot tmp.$$ $COVERAGE_FNS +# +# Prune out functions that do not have sufficient coverage +# Any function whose coverage metric starts with 0.0, e.g. 0.09, 0.0123, is pruned out +# We effectively prune out any functions whose coverage is not at least 10% +# $SECURITY_TRANSFORMS_HOME/tools/cover/cover a.ncexe a.ncexe.annot $EXECUTED_ADDRESS_FILE $COVERAGE_FNS grep -v "0\.0" $COVERAGE_FNS | cut -f1 -d" " > $CANDIDATE_FNS grep "0\.0" $COVERAGE_FNS | cut -f1 -d" " > $FILTERED_OUT #rm tmp.$$ -cp $CANDIDATE_FNS $KEEPS +$PEASOUP_HOME/tools/p1xform.filter.sh $CANDIDATE_FNS $LIBC_FILTER > $KEEPS echo "=====================================================" echo "Run BED" diff --git a/tools/ps_analyze.sh b/tools/ps_analyze.sh index 9bd9ae24458be2337f8e3da709e75858dbb046c3..3f95694b75cdc73704dbbb0e99006313df72c7ac 100755 --- a/tools/ps_analyze.sh +++ b/tools/ps_analyze.sh @@ -82,16 +82,30 @@ echo Done. # Uncomment this part to test the P1 xform # +#----------------------------------------- +# Start P1 transform +#----------------------------------------- # -# P1 transform -# - #echo Starting the P1 transform #date #$PEASOUP_HOME/tools/p1xform.sh $newdir > p1xform.out 2> p1xform.err +# +#echo $current_dir/$newdir/p1.xform/p1.final +# +#if [ -f $current_dir/p1.xform/p1.final ]; then +# echo List of functions transformed: +# cat $current_dir/p1.xform/p1.final +#else +# echo P1 was unable to transform the subject program +#fi +# #date #echo Done with the P1 transform +#----------------------------------------- +# End P1 transform +#----------------------------------------- + # go back to original directory cd - > /dev/null 2>&1