Add Billy's requested EDAC counting scripts
Jason D. Clinton [Mon, 2 Nov 2009 20:28:26 +0000 (14:28 -0600)]
manifest
usr/local/bin/edaccount [new file with mode: 0755]
usr/local/bin/simpleedac [new file with mode: 0755]

index 4d3e13f..b5d078b 100644 (file)
--- a/manifest
+++ b/manifest
@@ -39,6 +39,8 @@
 644:./usr/local/breakin/hpl/HPL-top.txt
 644:./usr/local/breakin/hpl/HPL-bottom.txt
 644:./usr/local/breakin/hpl/HPL-middle.txt
+755:./usr/local/bin/edaccount
+755:./usr/local/bin/simpleedac
 666:./home/ssh/.keep
 666:./errors/.keep
 666:./cloner/mnt/.keep
diff --git a/usr/local/bin/edaccount b/usr/local/bin/edaccount
new file mode 100755 (executable)
index 0000000..cc74152
--- /dev/null
@@ -0,0 +1,40 @@
+#!/bin/sh
+#edacount
+
+#tell number of mc and chans found
+echo Detected $( ls -d /sys/devices/system/edac/mc/mc* | sed 's/.*mc//' | sort | uniq | wc -l ) Mem controllers with $( ls -d /sys/devices/system/edac/mc/mc*/csrow*/ch*_ce_count | sed -e 's/.*ch//' -e 's/_.*//' | sort | uniq | wc -l ) channels.
+
+#for each memory controller
+ls -d /sys/devices/system/edac/mc/mc* | sed 's/.*mc//' | sort | uniq | while read mc
+do
+
+       #tally up the ue's found
+       cat /sys/devices/system/edac/mc/mc${mc}/csrow*/ce_count | \
+       {
+               while read csrowcount
+               do
+                       export count=$(( ${count} + ${csrowcount} ))
+               done
+
+               echo mc${mc} uncorrectable: ${count}
+       }
+
+       #for each channel thereon
+       ls -d /sys/devices/system/edac/mc/mc*/csrow*/ch*_ce_count | sed -e 's/.*ch//' -e 's/_.*//' | sort | uniq | while read chan
+       do
+
+               #tally up the ce's found
+               cat /sys/devices/system/edac/mc/mc${mc}/csrow*/ch${chan}_ce_count | \
+               {
+                       while read csrowcount
+                       do
+                               export count=$(( ${count} + ${csrowcount} ))
+                       done
+
+                       echo mc${mc}/ch${chan} corrected: ${count}
+               }
+       done
+
+
+
+done
diff --git a/usr/local/bin/simpleedac b/usr/local/bin/simpleedac
new file mode 100755 (executable)
index 0000000..6c34423
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh
+#simpledac
+
+#for each memory controller
+ls -d /sys/devices/system/edac/mc/mc* | sed 's/.*mc//' | sort | uniq | while read mc
+do
+       #tally up the ue's found
+       cat /sys/devices/system/edac/mc/mc${mc}/csrow*/ce_count | \
+       {
+               while read csrowcount
+               do
+                       export count=$(( ${count} + ${csrowcount} ))
+               done
+
+               echo -n "mc${mc}:${count}  "
+       }
+
+       #for each channel thereon
+       ls -d /sys/devices/system/edac/mc/mc*/csrow*/ch*_ce_count | sed -e 's/.*ch//' -e 's/_.*//' | sort | uniq | while read chan
+       do
+
+               #tally up the ce's found
+               cat /sys/devices/system/edac/mc/mc${mc}/csrow*/ch${chan}_ce_count | \
+               {
+                       while read csrowcount
+                       do
+                               export count=$(( ${count} + ${csrowcount} ))
+                       done
+
+                       echo -n "mc${mc}/ch${chan}:${count}  "
+               }
+       done
+
+
+done
+
+echo