diff options
author | Qiuxu Zhuo <qiuxu.zhuo@intel.com> | 2020-11-17 00:41:00 +0800 |
---|---|---|
committer | Andi Kleen <ak@linux.intel.com> | 2021-01-08 08:50:02 -0800 |
commit | fe4c9023c0faf5b19ff331e95f0b3961eeb82b79 (patch) | |
tree | 8984385baf5b0f353375cd09d5b29b4bc84a97e0 | |
parent | 36223636a167dcc35dfc3a949e8fb9ee5d44f22e (diff) | |
download | mcelog-fe4c9023c0faf5b19ff331e95f0b3961eeb82b79.tar.gz |
mcelog: Use 'num-errors' to specify the number of mce records to be injected.
In the file tests/page/inject, the default number of mce records to
be injected is 6. Some test cases may need more then 6 mce records
to be injected for testing, e.g., 'page-error-counter-replacement'.
So use 'num-errors' in the configuration file to specify the number
of mce records to be injected. And inject mce records and run mcelog
in parallel, so that the mce records can be consumed by mcelog in
time to avoid mce records overflow.
Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
-rwxr-xr-x | tests/page/inject | 17 | ||||
-rwxr-xr-x | tests/test | 4 |
2 files changed, 20 insertions, 1 deletions
diff --git a/tests/page/inject b/tests/page/inject index 05d4260..cbfdf51 100755 --- a/tests/page/inject +++ b/tests/page/inject @@ -8,3 +8,20 @@ P=$RANDOM ../../input/GENPAGE | mce-inject ../../input/GENPAGE | mce-inject ../../input/GENPAGE | mce-inject + +conf=$1 + +NUM_ERRORS="$(awk '/^num-errors = / { print $3 }' $conf)" + +if [ "$NUM_ERRORS" == "" ]; then + exit +fi + +NUM_ERRORS=`expr $NUM_ERRORS - 6` + +# Make sure mcelog is ready to consume the mce records (avoid mce records overflow). +sleep 2 + +for ((i = 1; i <= $NUM_ERRORS; i++)); do + ../../input/GENPAGE | mce-inject +done @@ -44,7 +44,9 @@ rm -f results for conf in `ls *.conf` do log=`echo $conf | sed "s/conf/log/g"` - ./inject $conf + # Inject mce records and run mcelog in parallel. + # So that the mce records can be consumed by mcelog in time (avoid mce record overflow). + ./inject $conf & $D ../../mcelog --foreground --daemon --debug-numerrors --config $conf --logfile $log >> result # let triggers finish |