Adding scripts, commands, and logging scaffolding

This commit is contained in:
Carlos Gutierrez
2025-10-05 02:54:38 +00:00
parent 834699dc0f
commit 01365feff2
16 changed files with 23322 additions and 10 deletions

29
scripts/bundle_logs.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
set -eu
. "$(dirname "$0")/env.sh"
TE="$LOG_DATA/TERMINAL_EXCERPTS.txt"
SE="$LOG_DATA/STATS_EXCERPTS.txt"
: > "$TE"; : > "$SE"
for f in "$LOG_DATA"/*.stdout.log; do
[ -f "$f" ] || continue
echo "===== $(basename "$f") =====" >> "$TE"
(head -n 20 "$f"; echo "..."; tail -n 20 "$f") >> "$TE"
echo >> "$TE"
done
for d in "$OUT_DATA"/*; do
[ -d "$d" ] || continue
S="$d/stats.txt"
[ -f "$S" ] || continue
echo "===== $(basename "$d") =====" >> "$SE"
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/' "$S" >> "$SE"
echo >> "$SE"
done
# mirror to repo
cp "$TE" "$LOG_IOT/TERMINAL_EXCERPTS.txt"
cp "$SE" "$LOG_IOT/STATS_EXCERPTS.txt"
echo "[bundle] wrote $TE and $SE (mirrored into iot/logs)"