#!/usr/bin/env bash # Counts stall-related events in the Shenandoah GC logs left in target/gclogs by bench-one.sh, and prints the # verbatim log lines for two of them. Output is committed as output/04-gc-events.txt. cd "$(dirname "$0")/../target/gclogs" echo "run cancelling_gc pause_full pause_degenerated failed_to_allocate" for f in shenandoah-satb-[1-5].log shenandoah-generational-[1-5].log; do printf "%-27s %13d %11d %18d %19d\n" "${f%.log}" \ "$(grep -c 'Cancelling GC' "$f")" "$(grep -c 'Pause Full [0-9]' "$f")" \ "$(grep -c 'Pause Degenerated.*ms$' "$f")" "$(grep -ci 'Failed to allocate' "$f")" done echo echo "== shenandoah-generational-4.log: what a 'Cancelling GC' line is (old marking preempted for a young cycle)" grep -m1 -B1 'Cancelling GC' shenandoah-generational-4.log | sed -E 's/^\[[^]]*\]//' echo echo "== shenandoah-generational-1.log: the Pause Full" grep -m1 'Pause Full [0-9]' shenandoah-generational-1.log | sed -E 's/^\[[^]]*\]//'