forked from aws/aws-lc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request aws#102 from aqjune-aws/ci-log-time2
Print running times of proofs, factor out proof runner
- Loading branch information
Showing
6 changed files
with
85 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
if [ "$#" -ne 1 ]; then | ||
echo "collect-times.sh <dir (e.g., arm)>" | ||
echo "This script inspects .correct files that are generated by 'make proofs'" | ||
echo "in the given architecture directory and collects all timing informations." | ||
exit 1 | ||
fi | ||
|
||
s2n_bignum_arch=$1 | ||
cd $s2n_bignum_arch | ||
|
||
num_correct_files=`find . -name "*.correct" | wc -l` | ||
if [ $num_correct_files -eq 0 ]; then | ||
echo "No .correct file exists. Did you run 'make proofs'?" | ||
exit 1 | ||
fi | ||
# grep must not detect anything including 'error' (case insensitive, '-i'). | ||
grep -r -i "Running time: " --include "*.correct" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
if [ "$#" -ne 3 ]; then | ||
echo "../tools/run-proof.sh <dir (arm/x86)> <asm filename without .S (e.g., bignum_copy)> <HOL Light command>" | ||
echo "This script runs HOL Light proof at '<dir>/proofs/<asm filename>.ml'". | ||
exit 1 | ||
fi | ||
|
||
# Return the exit code if any statement fails | ||
set -e | ||
|
||
cd .. | ||
|
||
s2n_bignum_arch=$1 | ||
asm_filename=$2 | ||
hol_light_cmd=$3 | ||
|
||
(echo 'Topdirs.dir_directory "+unix";;'; \ | ||
echo 'Topdirs.dir_load Format.std_formatter "unix.cma";;'; \ | ||
echo 'let start_time = Unix.time();;'; \ | ||
echo "loadt \"${s2n_bignum_arch}/proofs/base.ml\";;"; \ | ||
echo "loadt \"${s2n_bignum_arch}/proofs/${asm_filename}.ml\";;"; \ | ||
echo 'let end_time = Unix.time();;'; \ | ||
echo 'Printf.printf "Running time: %f sec, Start unixtime: %f, End unixtime: %f\n" (end_time -. start_time) start_time end_time;;') | eval "$hol_light_cmd" 2>&1 |
Oops, something went wrong.