-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge script to summarize the System Calls and File Descriptors for e…
…ach benchmark (#51) * sys_summary * integrate sys summary into table generation pipline --------- Co-authored-by: Zhuoxuan Zhang <hzhang6@oberlin.edu>
- Loading branch information
1 parent
312e993
commit 4ba35f3
Showing
3 changed files
with
98 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Benchmark,Sys Calls,File Descriptors | ||
aurpkg,207,0 | ||
covid-mts,252,0 | ||
file-enc,246,13 | ||
log-analysis,225,13 | ||
makeself,1237,13 | ||
max-temp,202,0 | ||
media-conv,225,13 | ||
nlp,2054,15 | ||
oneliners,677,13 | ||
riker,254,13 | ||
unix50,1556,0 | ||
vps-audit,207,13 | ||
vps-audit-negate,207,13 |
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,75 @@ | ||
#!/bin/bash | ||
|
||
output_file="benchmark_results.csv" | ||
|
||
benchmarks=( | ||
"aurpkg" | ||
"bio" | ||
"covid-mts" | ||
"file-enc" | ||
"log-analysis" | ||
"makeself" | ||
"max-temp" | ||
"media-conv" | ||
"nlp" | ||
"oneliners" | ||
"riker" | ||
"sklearn" | ||
"unix50" | ||
"vps-audit" | ||
"vps-audit-negate" | ||
"web-index" | ||
) | ||
|
||
# Error handler | ||
error() { | ||
echo "Error: $1" >&2 | ||
exit 1 | ||
} | ||
|
||
echo "Benchmark,Sys Calls,File Descriptors" > "$output_file" | ||
|
||
for benchmark in "${benchmarks[@]}"; do | ||
echo "Running benchmark: $benchmark" | ||
|
||
strace_output="/tmp/${benchmark}_strace.txt" | ||
lsof_output="/tmp/${benchmark}_lsof.txt" | ||
|
||
if ! cd "./$benchmark"; then | ||
echo "$benchmark [fail]: Directory not found" >> "$output_file" | ||
continue | ||
fi | ||
|
||
strace -c -o "$strace_output" ./run.sh --small || { | ||
echo "$benchmark [fail]: strace failed" >> "$output_file" | ||
cd - > /dev/null | ||
continue | ||
} | ||
|
||
./run.sh --small & | ||
pid=$! | ||
|
||
sleep 1 | ||
|
||
if [[ -d /proc/$pid ]]; then | ||
lsof -p "$pid" > "$lsof_output" | ||
else | ||
echo "Warning: Process $pid ended before lsof could capture file descriptors." | ||
> "$lsof_output" | ||
fi | ||
|
||
wait "$pid" | ||
|
||
total_syscalls=$(awk '/^100.00/ {print $4}' "$strace_output") | ||
total_syscalls=${total_syscalls:-0} | ||
|
||
fd_count=$(wc -l < "$lsof_output") | ||
fd_count=${fd_count:-0} | ||
|
||
echo "$benchmark,$total_syscalls,$fd_count" >> "../$output_file" | ||
|
||
rm -f "$strace_output" "$lsof_output" | ||
cd - > /dev/null | ||
done | ||
|
||
echo "Benchmark results saved to $output_file." |