Mce-inject How to use

Source: Internet
Author: User

    1. 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.

    1. 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.

    • View tolerate

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.

    • Set tolerate

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

    • numeric meaning

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)

    1. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.