Adding scripts, commands, and logging scaffolding"

This commit is contained in:
Carlos Gutierrez
2025-10-04 21:54:21 +00:00
parent 2cc1bb447a
commit f1debadbb3
17 changed files with 292 additions and 0 deletions

23
scripts/60_bundle_logs.sh Normal file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
set -eu
source "$(dirname "$0")/00_env.sh"
# terminal excerpts
: > "$LOGROOT/TERMINAL_EXCERPTS.txt"
for f in "$LOGROOT"/*.stdout.log; do
echo "===== $(basename "$f") =====" >> "$LOGROOT/TERMINAL_EXCERPTS.txt"
(head -n 20 "$f"; echo "..."; tail -n 20 "$f") >> "$LOGROOT/TERMINAL_EXCERPTS.txt"
echo >> "$LOGROOT/TERMINAL_EXCERPTS.txt"
done
echo "[bundle] wrote $LOGROOT/TERMINAL_EXCERPTS.txt"
# stats excerpts
: > "$LOGROOT/STATS_EXCERPTS.txt"
for d in "$OUTROOT"/*; do
[[ -d "$d" ]] || continue
echo "===== $(basename "$d") =====" >> "$LOGROOT/STATS_EXCERPTS.txt"
awk '/^sim_seconds|^system\.cpu\.ipc|^system\.cpu0\.ipc|^system\.cpu\.numCycles|^system\.cpu0\.numCycles|^system\.cpu\.commit\.committedInsts|^system\.cpu0\.commit\.committedInsts|^system\.l2\.overall_miss_rate::total/' "$d/stats.txt" >> "$LOGROOT/STATS_EXCERPTS.txt"
echo >> "$LOGROOT/STATS_EXCERPTS.txt"
done
echo "[bundle] wrote $LOGROOT/STATS_EXCERPTS.txt"