Use ramoops for logging under Linux (2021)
a year ago
- #linux
- #embedded-systems
- #kernel-logging
- Ramoops is used for logging kernel oopses, console output, and user messages in a reserved RAM area, surviving reboots but not power cycles.
- To enable ramoops, a free memory region must be identified and reserved in the device tree, with specific sizes for different log types.
- The Toradex Apalis iMX8QM was used as an example, with steps provided to modify the device tree and verify kernel configuration for pstore and ramoops.
- After enabling ramoops and rebooting, logs can be accessed by mounting pstore, revealing console output and kernel panic details.
- User messages can be stored in ramoops to survive reboots, useful for passing information between boot cycles, though lost during power cycles.
- Ramoops is particularly useful for diagnosing kernel panics, differentiating between reboots, power cycles, and crashes for remote device troubleshooting.