Saving panic logs in nonvolatile memory based on Pstore and Ramoops implementations

Source: Internet
Author: User
Tags dmesg

Saving panic logs in nonvolatile memory based on Pstore and ramoops implementations



The steps are as follows


0. Determine the address range

Demand knows in advance the starting address and length of nonvolatile memory used to hold the panic log. For example, the author used the part of the memory of the starting address is 0x11ff000000, the length is 16M.


2. Modifying the kernel


ramoops driver Support:

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/8A/2A/wKioL1gpthDCVFJKAABpX8oyDlw237.png "title=" Pstore _menu_config.png "alt=" wkiol1gpthdcvfjkaabpx8oydlw237.png "/> Build driver load process, if you find that the independent non-volatile storage load driver fails, check whether you need to modify the kernel driver, especially The request_mem_region() function in fs/pstore/ram_core.c , and then determine whether persistent_ram_vmap() is selected or Persistent_ram_iomap () to map the physical address to the kernel linear address space.



3. specify the relevant startup parameters on the command line


For the kernel of the ramoops module buildin , add the above startup parameters directly to the kernel command line:

ramoops.mem_address=0x11ff000000ramoops.mem_size=0x1000000 Pstore.backend=ramoops


For the kernel of the ramoops module buildout , the following parameters are required on the kernel command line:

Pstore.backend=ramoops

Also, after the kernel is booted, you need to refer to the following command to load the ramoops driver:

Modproberamoops.ko ramoops.mem_address=0x11ff000000ramoops.mem_size=0x1000000


Note that Ramoops.ko relies on the module Reed_solomon.koand needs to be installed in advance,Reed_solomon.ko can refer to the following command generation:

Cdlib/reed_solomon && make-c/lib/modules/' uname-r '/buildmodules

&&modprobe Reed_solomon

Then load the ramoops driver, and through the DMESG you can see it succeed:

[301.921706] console [pstore-1] enabled

[301.921841] pstore:registered ramoops as persistent store backend

[301.921862] ramoops:attached [email protected], ecc:0/0



4. Run the test


reboot Machine, you can see oopsmessage details when you get back up :

[Email protected]pstore]# pwd

/sys/fs/pstore

[[Email protected]pstore]# LS-ALRT

Total0

drwxr-xr-x.5 root root 0 Nov 7 01:04..

Drwxr-xr-x.2 root root 0 Nov 7 01:04.

-r--r--r--. 1 root root 4084 Nov 7 01:17 dmesg-ramoops-0

-r--r--r--. 1 root root 4084 Nov 7 01:17 console-ramoops



5. Reference Documentation:

[Email protected]lsd-linux-kernel]# ls documentation/ramoops.txt

Documentation/ramoops.txt

[Email protected]lsd-linux-kernel]# ls Documentation/abi/testing/pstore

Documentation/abi/testing/pstore


This article is from the "Store Chef" blog, so be sure to keep this source http://xiamachao.blog.51cto.com/10580956/1872790

Saving panic logs in nonvolatile memory based on Pstore and Ramoops implementations

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.