diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2012-02-03 18:51:04 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2012-02-03 18:51:04 +0100 |
commit | 0408a26c145fe2188bdb86314b1f559044cba356 (patch) | |
tree | 2b58e141f3adb8a2de26ad8bf2a8699a74f5027f | |
parent | a1163a63376d86af317c3fd83aad2333e1fa5c54 (diff) | |
download | pcitool-0408a26c145fe2188bdb86314b1f559044cba356.tar.gz pcitool-0408a26c145fe2188bdb86314b1f559044cba356.tar.bz2 pcitool-0408a26c145fe2188bdb86314b1f559044cba356.tar.xz pcitool-0408a26c145fe2188bdb86314b1f559044cba356.zip |
Add script to debug incomplete frames
-rwxr-xr-x | tests/incomplete.sh | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/incomplete.sh b/tests/incomplete.sh new file mode 100755 index 0000000..5c80198 --- /dev/null +++ b/tests/incomplete.sh @@ -0,0 +1,37 @@ +#! /bin/bash + +function pci { + PCILIB_PATH="/root/pcitool" + LD_LIBRARY_PATH="$PCILIB_PATH" $PCILIB_PATH/pci $* +} + +rm -f images.raw +touch images.raw + +echo "Starting the grabber" +pci --stop-dma +pci --start-dma dma1 +pci -g -o images.raw --run-time 1000000000 & +pid=$! + +usleep 1000000 + +for i in `seq 1 100000`; do + old_size=`ls -la images.raw | cut -d " " -f 5` + echo "Trigger $i" + pci --trigger + usleep 100000 + new_size=`ls -la images.raw | cut -d " " -f 5` + if [ $old_size -eq $new_size ]; then + sleep 2 + new_size=`ls -la images.raw | cut -d " " -f 5` + if [ $old_size -eq $new_size ]; then + echo "Incomplete frame..." + killall -SIGINT pci + break + fi + fi +done + +echo "Waiting grabber to finish" +wait $pid |