Skip to content

debugging with ramoops and on‐screen log

99degree edited this page Feb 17, 2025 · 1 revision

Why ramoops

Since phone reboot might lost all log, adb is not ready, none-the-less, but ramoops might be the last choice to retain last failure info. So make use of it is last non-intrusive method to get log.

Method to get log from ramoops

Here are two working example to get log from ramoops as well as from on-screen.

dt-node

There is a dt-sub-node called pstore in reserved-memory node generally. Make sure it is enabled.

pstore_mem: ramoops@9d800000 {

compatible = "ramoops";

reg = <0x0 0x9d800000 0x0 0x400000>;

record-size = <0x80000>;

pmsg-size = <0x200000>;

console-size = <0x100000>;

};

boot cmdline

Since pstore-console wont automatically log the dmesg so boot cmdline parameter need to apply.

console=ramoops

kernel config

And below kernel config option to turn on

CONFIG_PSTORE=y

CONFIG_PSTORE_DEFAULT_KMSG_BYTES=10240

CONFIG_PSTORE_COMPRESS=y

CONFIG_PSTORE_CONSOLE=y

CONFIG_PSTORE_PMSG=y

CONFIG_PSTORE_RAM=y

On-screen(panel) logging

Another console logging is from kernel CONFIG_DRM_CLIENT_LOG that shows up logs on panels where gpu is not bring-up yet.

dt-bindings

framebuffer@9c000000 {

compatible = "simple-framebuffer";

reg = <0x0 0x9c000000 0x0 (1080 * 2400 * 4)>;

width = <1080>;

height = <2400>;

stride = <(1080 * 4)>;

format = "a8r8g8b8";

clocks = <&gcc GCC_DISP_HF_AXI_CLK>;

};

Boot cmdline for on-screen log

And better with cmdline param

console=drm_log

Kernel config

So make sure below config options are enabled while compile kernel:

CONFIG_DRM_CLIENT_LOG=y

CONFIG_DRM_SIMPLEDRM=y

Clone this wiki locally