-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-postprocessing.sh
More file actions
executable file
·73 lines (58 loc) · 1.76 KB
/
Copy pathrun-postprocessing.sh
File metadata and controls
executable file
·73 lines (58 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
set -eu
set -o pipefail
DIR="$(dirname $(readlink -f $0))"
readonly ROOT_DIR="$(readlink -f "$DIR/..")"
source $ROOT_DIR/config.sh
readonly FISH_FUZZ_ROOT=$ROOT_DIR/FishFuzz-upstream
readonly CPUS=40
if [[ $# -ne 1 ]]; then
echo "Please use $0 <path-to-eval-results-dir>"
exit 1
fi
if ! command -v parallel > /dev/null || ! parallel --version | grep -q "GNU parallel"; then
echo "Please install GNU parallel"
exit 1
fi
readonly EVAL_RESULT_DIR="$1"
if [[ ! -d "$EVAL_RESULT_DIR" ]]; then
echo "$EVAL_RESULT_DIR does not exists"
exit 1
fi
if ! ls "$EVAL_RESULT_DIR"/*/scripts > /dev/null ; then
echo "$EVAL_RESULT_DIR seems to be not a directory created via the run-eval.sh script"
exit 1
fi
# Update the scripts with local version
for target in "$EVAL_RESULT_DIR"/*/scripts; do
echo "=> Updating scripts at $target"
rsync -a "$FISH_FUZZ_ROOT/paper/artifact/two-stage/scripts/" $target
done
# Copy per target results for each individual repetition into one folder.
for run_dir in "$EVAL_RESULT_DIR"/*; do
if echo $run_dir | grep -q "collected-runs"; then
continue
fi
run_name="$(basename $run_dir)"
run_id="$(echo $run_name | cut -d '-' -f 4 )"
if [[ -z "$run_id" ]]; then
continue
fi
dst_dir="$EVAL_RESULT_DIR/collected-runs-$run_id"
rsync -a "$run_dir/"* "$dst_dir"
done
function compute_coverage() {
set -eu
readonly run_dir="$1"
if [[ -z "$run_dir" ]]; then
return
fi
./postprocess.sh "$run_dir"
}
export -f compute_coverage
args=""
# Build that arguments for parallel
for collected_run_dir in "$EVAL_RESULT_DIR"/collected-runs-* ; do
args="$collected_run_dir\0$args"
done
echo -ne $args | parallel -j $CPUS --bar -kd'\0' -- compute_coverage {} ';' || true