Skip to content

Commit 227186e

Browse files
committed
dynamic analysis
1 parent 64d7542 commit 227186e

File tree

227 files changed

+7502
-13
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

227 files changed

+7502
-13
lines changed

aurpkg/run.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ mkdir -p ${OUT}
77

88
script="./scripts/pacaur.sh"
99

10+
BENCHMARK_SHELL=${BENCHMARK_SHELL:-bash}
11+
export BENCHMARK_CATEGORY="nlp"
12+
export BENCHMARK_SCRIPT="$(realpath "$script")"
13+
export BENCHMARK_INPUT_FILE="$(realpath "$IN")"
14+
1015
# Switch to user "user" to avoid permission issues
1116

1217
echo "$script"

bio/deps.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
# install dependencies
23
required_version="1.7"
34

@@ -43,4 +44,5 @@ else
4344
echo "Failed to install the correct version of Samtools."
4445
exit 1
4546
fi
46-
fi
47+
fi
48+

bio/input.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/bin/bash
2+
13
IN=inputs
24
IN_NAME=input.txt
35

bio/run.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/bin/bash
2+
13
# create bam files with regions
24
################### 1KG SAMPLES
35
IN=inputs
@@ -8,6 +10,11 @@ if [[ "$@" == *"--small"* ]]; then
810
IN_NAME=input_small.txt
911
fi
1012

13+
export BENCHMARK_CATEGORY="nlp"
1114
BENCHMARK_SHELL=${BENCHMARK_SHELL:-bash}
1215

13-
"$BENCHMARK_SHELL" ./scripts/bio.sh "$IN" "$IN_NAME" "$OUT"
16+
script_file=./scripts/bio.sh
17+
export BENCHMARK_SCRIPT="$(realpath "$script_file")"
18+
export BENCHMARK_INPUT_FILE="$(realpath "$IN_NAME")"
19+
20+
$BENCHMARK_SHELL "$script_file" "$IN" "$IN_NAME" "$OUT"

covid-mts/run.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,15 @@ output_scoped="$outputs_dir/outputs$suffix"
1616
mkdir -p "$output_scoped"
1717

1818
BENCHMARK_SHELL=${BENCHMARK_SHELL:-bash}
19+
export BENCHMARK_CATEGORY="covid-mts"
20+
export BENCHMARK_INPUT_FILE="$(realpath "$input_file")"
1921

22+
export BENCHMARK_SCRIPT="$(realpath "$scripts_dir/1.sh")"
2023
$BENCHMARK_SHELL "$scripts_dir/1.sh" "$input_file" > "$output_scoped/1.out"
24+
export BENCHMARK_SCRIPT="$(realpath "$scripts_dir/2.sh")"
2125
$BENCHMARK_SHELL "$scripts_dir/2.sh" "$input_file" > "$output_scoped/2.out"
26+
export BENCHMARK_SCRIPT="$(realpath "$scripts_dir/3.sh")"
2227
$BENCHMARK_SHELL "$scripts_dir/3.sh" "$input_file" > "$output_scoped/3.out"
28+
export BENCHMARK_SCRIPT="$(realpath "$scripts_dir/4.sh")"
2329
$BENCHMARK_SHELL "$scripts_dir/4.sh" "$input_file" > "$output_scoped/4.out"
2430

file-enc/deps.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/bin/bash
2+
13
sudo apt-get update
24

35
pkgs='ffmpeg unrtf imagemagick libarchive-tools libncurses5-dev libncursesw5-dev zstd liblzma-dev libbz2-dev zip unzip nodejs tcpdump'

file-enc/run.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ if [[ "$1" == "--small" ]]; then
1717
suffix=".small"
1818
fi
1919

20+
export BENCHMARK_CATEGORY="file-enc"
21+
export BENCHMARK_INPUT_FILE="$(realpath "$input_pcaps")"
2022
BENCHMARK_SHELL=${BENCHMARK_SHELL:-bash}
21-
$BENCHMARK_SHELL $scripts_dir/compress_files.sh $input_pcaps $results_dir/compress_files$suffix
22-
$BENCHMARK_SHELL $scripts_dir/encrypt_files.sh $input_pcaps $results_dir/encrypt_files$suffix
23+
24+
export BENCHMARK_SCRIPT="$(realpath "$scripts_dir/compress_files.sh")"
25+
$BENCHMARK_SHELL "$scripts_dir/compress_files.sh" "$input_pcaps" "$results_dir/compress_files$suffix"
26+
export BENCHMARK_SCRIPT="$(realpath "$scripts_dir/encrypt_files.sh")"
27+
$BENCHMARK_SHELL "$scripts_dir/encrypt_files.sh" "$input_pcaps" "$results_dir/encrypt_files$suffix"

infrastructure/Makefile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
STATIC_OUTPUTS = target/lines_of_code.csv target/nodes_in_scripts.csv target/scripts_to_benchmark.csv target/cyclomatic.csv target/shellmetrics.sh
1+
STATIC_OUTPUTS = target/lines_of_code.csv target/nodes_in_scripts.csv target/scripts_to_benchmark.csv target/cyclomatic.csv target/shellmetrics.sh target/dynamic_analysis.csv
22

33
static: $(STATIC_OUTPUTS)
44

5+
target/dynamic_analysis.csv: dynamic_analysis.py target/collect_dynamic_logs.touch target/collect_standard_dynamic_logs.touch
6+
python3 $< | sort > $@
7+
58
target/scripts_to_benchmark.csv: scripts_to_benchmark.py
69
python3 $< | sort > $@
710

@@ -24,6 +27,12 @@ target/shellmetrics.sh:
2427
target/cyclomatic.csv: get_cyclomatic.py target/shellmetrics.sh
2528
python3 get_cyclomatic.py > $@
2629

27-
dynamic:
30+
target/collect_dynamic_logs.touch:
31+
python3 collect_dynamic_logs.py
32+
touch $@
33+
34+
target/collect_standard_dynamic_logs.touch:
35+
python3 standard_run.py
36+
touch $@
2837

29-
.PHONY: static dynamic clean-static static-test
38+
.PHONY: static clean-static static-test

infrastructure/after.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
rchar: 1048588393
2+
wchar: 1048576104
3+
syscr: 1026
4+
syscw: 1003
5+
read_bytes: 0
6+
write_bytes: 0
7+
cancelled_write_bytes: 0

infrastructure/all_scripts.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ def get_all_scripts(
1919
]
2020
for benchmark_name, benchmark_data in benchmark_data.items()
2121
}
22+
23+
if __name__ == "__main__":
24+
for bench in get_all_scripts().keys():
25+
print(bench)

infrastructure/before.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
rchar: 5216
2+
wchar: 0
3+
syscr: 13
4+
syscw: 0
5+
read_bytes: 0
6+
write_bytes: 0
7+
cancelled_write_bytes: 0
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
REPO_TOP="$(git rev-parse --show-toplevel)"
4+
5+
benches=$(python3 "$REPO_TOP/infrastructure/all_scripts.py" | sort)
6+
7+
for bench in $benches; do
8+
bash $REPO_TOP/$bench/deps.sh
9+
done
10+
11+
for bench in $benches; do
12+
bash $REPO_TOP/$bench/input.sh
13+
done
14+
15+
for bench in $benches; do
16+
python3 $REPO_TOP/infrastructure/run_dynamic.py $bench
17+
done
18+
19+
touch "$REPO_TOP/infrastructure/target/collect_dynamic_logs.touch"

infrastructure/data/script-globs.json

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
{
2+
"aurpkg": {
3+
"scripts": ["aurpkg/scripts/*.sh"]
4+
},
5+
"bio": {
6+
"scripts": ["bio/scripts/*.sh"]
7+
},
28
"covid-mts": {
39
"scripts": ["covid-mts/scripts/*.sh"]
410
},
@@ -26,9 +32,6 @@
2632
"riker": {
2733
"scripts": ["riker/scripts/*/build.sh"]
2834
},
29-
"uniq-ips": {
30-
"scripts": ["uniq-ips/scripts/run.sh"]
31-
},
3235
"unix50": {
3336
"scripts": ["unix50/scripts/*.sh"]
3437
},
@@ -43,5 +46,29 @@
4346
},
4447
"vps-audit-negate": {
4548
"scripts": ["vps-audit-negate/scripts/*.sh"]
49+
},
50+
"infrastructure/standards/100-files": {
51+
"scripts": ["infrastructure/standards/100-files/scripts/*.sh"]
52+
},
53+
"infrastructure/standards/read-write": {
54+
"scripts": ["infrastructure/standards/read-write/scripts/*.sh"]
55+
},
56+
"infrastructure/standards/shell-memory": {
57+
"scripts": ["infrastructure/standards/shell-memory/scripts/*.sh"]
58+
},
59+
"infrastructure/standards/sleep": {
60+
"scripts": ["infrastructure/standards/sleep/scripts/*.sh"]
61+
},
62+
"infrastructure/standards/time-in-shell-subprocess": {
63+
"scripts": ["infrastructure/standards/time-in-shell-subprocess/scripts/*.sh"]
64+
},
65+
"infrastructure/standards/user-time": {
66+
"scripts": ["infrastructure/standards/user-time/scripts/*.sh"]
67+
},
68+
"infrastructure/standards/user-time-in-shell": {
69+
"scripts": ["infrastructure/standards/user-time-in-shell/scripts/*.sh"]
70+
},
71+
"infrastructure/standards/write-only": {
72+
"scripts": ["infrastructure/standards/write-only/scripts/*.sh"]
4673
}
4774
}

0 commit comments

Comments
 (0)