aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Gong <gong.chen@linux.intel.com>2012-09-12 03:51:57 -0400
committerChen Gong <gong.chen@linux.intel.com>2012-09-12 03:56:49 -0400
commitde41ef52c05a965e69c696a947cabb6012bb10e0 (patch)
tree0f8fb77d340785ade68a26334651a42d277b2072
parentdfb61fa2d57f4704610884f9407d2beb5510fd89 (diff)
downloadmce-test-de41ef52c05a965e69c696a947cabb6012bb10e0.tar.gz
Auto remove EDAC module for PFA test
Some EDAC modules will stop mcelog to collect the error log from kernel mcelog buffer, which cause the mcelog PFA function invalid. To avoid the influence from EDAC module, remove the specific EDAC module before the test and restore it after the test. Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
-rwxr-xr-xcases/function/pfa/run_pfa.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/cases/function/pfa/run_pfa.sh b/cases/function/pfa/run_pfa.sh
index 01f417b..6ac0fec 100755
--- a/cases/function/pfa/run_pfa.sh
+++ b/cases/function/pfa/run_pfa.sh
@@ -5,6 +5,7 @@
INJ_TYPE=0x00000008
APEI_IF=""
PFA_BIN=""
+EDAC_TYPE=""
invalid()
{
@@ -56,6 +57,18 @@ main()
[ $? -ne 0 ] &&
invalid "Necessary Error Injection for PFA is not supported on this platform"
+ # remove possible EDAC module, otherwise, the error information will be ate
+ # by EDAC module and mcelog will not get it.
+ # By now, only i7core_edac and sb_edac hook into the mcelog kernel buffer
+ cat /proc/modules | grep -q i7core_edac
+ if [ $? -eq 0 ]; then
+ EDAC_TYPE="i7core_edac"
+ else
+ cat /proc/modules | grep -q sb_edac
+ [ $? -eq 0 ] && EDAC_TYPE="sb_edac"
+ fi
+ rmmod $EDAC_TYPE >/dev/null 2>&1
+
killall $PFA_BIN > /dev/null 2>&1
$PFA_BIN | tee log &
#wait to flush stdout into log
@@ -78,6 +91,7 @@ main()
cleanup()
{
rm -f trigger log
+ modprobe $EDAC_TYPE >/dev/null 2>&1
}
trap "cleanup" 0