6 RESULTS_FILE=results.log
21 function echo_as_percent () {
23 rest_full=$(( $1 % 100 ))
24 dec=$(($rest_full / 10 ))
25 rest_dec=$(($rest_full % 10 ))
26 echo "$full.$dec$rest_dec%"
27 echo "$full.$dec$rest_dec%" >> $RESULTS_FILE
34 while [ $((i--)) -gt 0 ]
36 echo -e "$blue==============test no $i=============$default"
38 perf record -a -g & > /dev/null 2> /dev/null
40 security-tests-all.sh > /dev/null 2> /dev/null
46 perf report -U -s symbol -gflat,1,caller 2>> $ERR_FILE | grep smk
47 OUTPUT=$(perf report -U -s symbol -gflat,1,caller 2>> $ERR_FILE | grep smk | sed "s:%.*$::g;s:^[ \t]::g;s:[^0-9]::g;s:^0::g;s:^0::g;s:$:+:g;$ s:+::" | tr -d "\n")
50 echo_as_percent $(($OUTPUT))
53 SUM=$(($SUM + $OUTPUT))
56 echo -e "$blue==============done============="
59 echo "average:" >> $RESULTS_FILE
60 echo_as_percent $OUTPUT