Mce-inject function
Mce-inject is used to test whether the Mcelog can obtain the correct hardware error information and decode correctly, Mce-inject may inject the specified error message to the kernel, so it is easy to understand the function of Mcelog is normal.
It is important to note that when the user uses the Mce-inject tool to inject an unrecoverable error (such as: fatal) into the kernel, a panic restart occurs, of course, which can be avoided by changing the tolerate file under the Sys file system.
tolerate File Configuration
Location:/sys/devices/system/machinecheck/machinecheck*/
Note: where the * number in machinecheck* is determined by the number of CPUs, if it is a dual-core, there are machinecheck0 and machinecheck1 two directories, the corresponding directory has a tolerate file, The tolerance value is stored in the tolerate.
Functionality: Provides the user with an optional tolerance of the corresponding hardware error (tolerate), such as: when the value of tolerate is 1 o'clock, a fatal error occurs, it freezes, restarts, and the error message is not logged When the value of tolerate is 3 o'clock (note that the value is only used for testing), the machine will tolerate the error in the event of a fatal error, does not occur with a panic restart, and will log related error messages.
Enter the appropriate directory as root to view it. Such as:
#cd/sys/devices/system/machinecheck/machinecheck0
#cat tolerate
View the tolerate value of the CPU0.
To enter the corresponding directory as root to modify, there are many ways to set tolerate, such as:
#cd/sys/devices/system/machinecheck/machinecheck0
#echo 3 >tolerate
The value of the tolerate can be 0, 1, 2, 3.
0:always panic on uncorrected errors, log corrected errors
1:panic or Sigbus on uncorrected errors, log corrected errors
2:sigbus or log uncorrected errors (if possible), log corrected errors
3:never panic or Sigbus, log all errors (for testing only)
Mce-inject Use
Mce-inject is also very simple to use, but before use, the value of tolerate is modified to 3 to prevent the crash restart event, and then, in the terminal as root:
Mce-inject filename ...
FileName stores the specific type of error to inject
For example, the contents of a mce-filename file correct are:
CPU 1 BANK 2 STATUS corrected RIP 0x12341234 |
When executing, simply type in the terminal:
#mce-inject./correct
Can be successfully injected with detailed output to view the/var/log/mcelog file.
Of course, you can write the relevant injection scripts yourself.
This article is from the "Members Doukua" blog, make sure to keep this source http://dangzhiqiang.blog.51cto.com/7961271/1782896
Mce-inject How to use