ethercat-linux/vendor/ethercrab/repo-stats.sh
Tony Cao 21b2d3bf99 J1900 <-> TwinCAT 1 kHz verification over EL6695 bridge
Re-implementation of rustbootd's ecat_el6695_* examples as a single binary
with fixes found in review and on hardware:

- DC-follow PLL hardened against period-2 hunting: slew-limited anchor
  (+/-50us/cycle), bistable-trap snap re-anchor, re-prime on stale deadline
- drift-free absolute-grid ticker mode; probe mode for timestamp forensics
- bounded-memory online stats (histograms), graceful SIGINT/SIGTERM shutdown
  with full report, error-streak abort
- timestamp plausibility filter comparing against the previous raw sample
  (avoids the deadlock after a startup outlier)
- XFC scope waveform options: --el2202 (with --el2202-dual), --el2262,
  --el1252 latch timestamp readback with per-channel edge statistics
- register access unified in regs.rs: named bit constants everywhere,
  read-modify-write for enable/activation bytes
- vendored patched ethercrab 0.7.1 (sdo_write_complete, send_raw_coe)

Verified on J1900 (PREEMPT_RT 6.6.135): 600k cycles/600s exact 1 kHz,
tx/rx zero errors, phase_err p50=164us std=5us; EL2202<->EL1252 loopback
edge interval mean 2000.24us std=24.65us.
2026-07-22 08:55:41 +08:00

39 lines
1.1 KiB
Bash

#!/usr/bin/env bash
echo -e "commit,date,loc_total,loc_code,loc_comments,text,bss,dec,bin" > target/sizes.csv
trap 'echo -e "\nCancelled. Restoring repo."; git checkout --quiet --force main; exit' INT
for commit in $(git rev-list main)
do
date=$(git show -s --format=%ci $commit)
echo "Commit ${commit} at ${date}"
git checkout $commit --quiet
if [[ -f "examples/embassy-stm32/Cargo.toml" ]]; then
pushd examples/embassy-stm32 > /dev/null
out=$(cargo size --release --quiet | tail -n1)
text=$(echo $out | awk '{print $1}')
bss=$(echo $out | awk '{print $3}')
dec=$(echo $out | awk '{print $4}')
cargo objcopy --release --quiet -- -O binary target/size.bin
out=$(wc -c target/size.bin)
bin=$(echo $out | awk '{print $1}')
popd > /dev/null
fi
code_stats=$(tokei --type Rust | tail -n2 | head -n1 | awk '{print $3","$4","$5}')
echo -n "--> "
echo -e "$commit,$date,$code_stats,$text,$bss,$dec,$bin" | tee -a target/sizes.csv
done
echo "Done"
git checkout main --quiet