Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynamic analysis #40

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions aurpkg/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ mkdir -p ${OUT}

script="./scripts/pacaur.sh"

BENCHMARK_SHELL=${BENCHMARK_SHELL:-bash}
export BENCHMARK_CATEGORY="nlp"
export BENCHMARK_SCRIPT="$(realpath "$script")"
export BENCHMARK_INPUT_FILE="$(realpath "$IN")"

# Switch to user "user" to avoid permission issues

echo "$script"
Expand Down
4 changes: 3 additions & 1 deletion bio/deps.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
# install dependencies
required_version="1.7"

Expand Down Expand Up @@ -43,4 +44,5 @@ else
echo "Failed to install the correct version of Samtools."
exit 1
fi
fi
fi

2 changes: 2 additions & 0 deletions bio/input.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

IN=inputs
IN_NAME=input.txt

Expand Down
9 changes: 8 additions & 1 deletion bio/run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

# create bam files with regions
################### 1KG SAMPLES
IN=inputs
Expand All @@ -8,6 +10,11 @@ if [[ "$@" == *"--small"* ]]; then
IN_NAME=input_small.txt
fi

export BENCHMARK_CATEGORY="nlp"
BENCHMARK_SHELL=${BENCHMARK_SHELL:-bash}

"$BENCHMARK_SHELL" ./scripts/bio.sh "$IN" "$IN_NAME" "$OUT"
script_file=./scripts/bio.sh
export BENCHMARK_SCRIPT="$(realpath "$script_file")"
export BENCHMARK_INPUT_FILE="$(realpath "$IN_NAME")"

$BENCHMARK_SHELL "$script_file" "$IN" "$IN_NAME" "$OUT"
6 changes: 6 additions & 0 deletions covid-mts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ output_scoped="$outputs_dir/outputs$suffix"
mkdir -p "$output_scoped"

BENCHMARK_SHELL=${BENCHMARK_SHELL:-bash}
export BENCHMARK_CATEGORY="covid-mts"
export BENCHMARK_INPUT_FILE="$(realpath "$input_file")"

export BENCHMARK_SCRIPT="$(realpath "$scripts_dir/1.sh")"
$BENCHMARK_SHELL "$scripts_dir/1.sh" "$input_file" > "$output_scoped/1.out"
export BENCHMARK_SCRIPT="$(realpath "$scripts_dir/2.sh")"
$BENCHMARK_SHELL "$scripts_dir/2.sh" "$input_file" > "$output_scoped/2.out"
export BENCHMARK_SCRIPT="$(realpath "$scripts_dir/3.sh")"
$BENCHMARK_SHELL "$scripts_dir/3.sh" "$input_file" > "$output_scoped/3.out"
export BENCHMARK_SCRIPT="$(realpath "$scripts_dir/4.sh")"
$BENCHMARK_SHELL "$scripts_dir/4.sh" "$input_file" > "$output_scoped/4.out"

2 changes: 2 additions & 0 deletions file-enc/deps.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

sudo apt-get update

pkgs='ffmpeg unrtf imagemagick libarchive-tools libncurses5-dev libncursesw5-dev zstd liblzma-dev libbz2-dev zip unzip nodejs tcpdump'
Expand Down
9 changes: 7 additions & 2 deletions file-enc/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ if [[ "$1" == "--small" ]]; then
suffix=".small"
fi

export BENCHMARK_CATEGORY="file-enc"
export BENCHMARK_INPUT_FILE="$(realpath "$input_pcaps")"
BENCHMARK_SHELL=${BENCHMARK_SHELL:-bash}
$BENCHMARK_SHELL $scripts_dir/compress_files.sh $input_pcaps $results_dir/compress_files$suffix
$BENCHMARK_SHELL $scripts_dir/encrypt_files.sh $input_pcaps $results_dir/encrypt_files$suffix

export BENCHMARK_SCRIPT="$(realpath "$scripts_dir/compress_files.sh")"
$BENCHMARK_SHELL "$scripts_dir/compress_files.sh" "$input_pcaps" "$results_dir/compress_files$suffix"
export BENCHMARK_SCRIPT="$(realpath "$scripts_dir/encrypt_files.sh")"
$BENCHMARK_SHELL "$scripts_dir/encrypt_files.sh" "$input_pcaps" "$results_dir/encrypt_files$suffix"
15 changes: 12 additions & 3 deletions infrastructure/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
STATIC_OUTPUTS = target/lines_of_code.csv target/nodes_in_scripts.csv target/scripts_to_benchmark.csv target/cyclomatic.csv target/shellmetrics.sh
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

static: $(STATIC_OUTPUTS)

target/dynamic_analysis.csv: dynamic_analysis.py target/collect_dynamic_logs.touch target/collect_standard_dynamic_logs.touch
python3 $< | sort > $@

target/scripts_to_benchmark.csv: scripts_to_benchmark.py
python3 $< | sort > $@

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

dynamic:
target/collect_dynamic_logs.touch:
python3 collect_dynamic_logs.py
touch $@

target/collect_standard_dynamic_logs.touch:
python3 standard_run.py
touch $@

.PHONY: static dynamic clean-static static-test
.PHONY: static clean-static static-test
7 changes: 7 additions & 0 deletions infrastructure/after.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
rchar: 1048588393
wchar: 1048576104
syscr: 1026
syscw: 1003
read_bytes: 0
write_bytes: 0
cancelled_write_bytes: 0
4 changes: 4 additions & 0 deletions infrastructure/all_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ def get_all_scripts(
]
for benchmark_name, benchmark_data in benchmark_data.items()
}

if __name__ == "__main__":
for bench in get_all_scripts().keys():
print(bench)
7 changes: 7 additions & 0 deletions infrastructure/before.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
rchar: 5216
wchar: 0
syscr: 13
syscw: 0
read_bytes: 0
write_bytes: 0
cancelled_write_bytes: 0
19 changes: 19 additions & 0 deletions infrastructure/collect_dynamic_logs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

REPO_TOP="$(git rev-parse --show-toplevel)"

benches=$(python3 "$REPO_TOP/infrastructure/all_scripts.py" | sort)

for bench in $benches; do
bash $REPO_TOP/$bench/deps.sh
done

for bench in $benches; do
bash $REPO_TOP/$bench/input.sh
done

for bench in $benches; do
python3 $REPO_TOP/infrastructure/run_dynamic.py $bench
done

touch "$REPO_TOP/infrastructure/target/collect_dynamic_logs.touch"
33 changes: 30 additions & 3 deletions infrastructure/data/script-globs.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"aurpkg": {
"scripts": ["aurpkg/scripts/*.sh"]
},
"bio": {
"scripts": ["bio/scripts/*.sh"]
},
"covid-mts": {
"scripts": ["covid-mts/scripts/*.sh"]
},
Expand Down Expand Up @@ -26,9 +32,6 @@
"riker": {
"scripts": ["riker/scripts/*/build.sh"]
},
"uniq-ips": {
"scripts": ["uniq-ips/scripts/run.sh"]
},
"unix50": {
"scripts": ["unix50/scripts/*.sh"]
},
Expand All @@ -43,5 +46,29 @@
},
"vps-audit-negate": {
"scripts": ["vps-audit-negate/scripts/*.sh"]
},
"infrastructure/standards/100-files": {
"scripts": ["infrastructure/standards/100-files/scripts/*.sh"]
},
"infrastructure/standards/read-write": {
"scripts": ["infrastructure/standards/read-write/scripts/*.sh"]
},
"infrastructure/standards/shell-memory": {
"scripts": ["infrastructure/standards/shell-memory/scripts/*.sh"]
},
"infrastructure/standards/sleep": {
"scripts": ["infrastructure/standards/sleep/scripts/*.sh"]
},
"infrastructure/standards/time-in-shell-subprocess": {
"scripts": ["infrastructure/standards/time-in-shell-subprocess/scripts/*.sh"]
},
"infrastructure/standards/user-time": {
"scripts": ["infrastructure/standards/user-time/scripts/*.sh"]
},
"infrastructure/standards/user-time-in-shell": {
"scripts": ["infrastructure/standards/user-time-in-shell/scripts/*.sh"]
},
"infrastructure/standards/write-only": {
"scripts": ["infrastructure/standards/write-only/scripts/*.sh"]
}
}
Loading
Loading