RAMOOPS not working


#1

Hi,

We need to use RAMOOPS mechanism to debug the kernel panic issues.
In the hikey960 default kernel config file, below flags are already enabled.
CONFIG_PSTORE=y
CONFIG_PSTORE_RAM=y
CONFIG_PSTORE_CONSOLE=y
CONFIG_PANIC_TIMEOUT=1
CONFIG_PANIC_ON_OOPS=y

But on inducing kernel panic, the logs are not getting collected under /sys/fs/pstore.
–> echo c > /proc/sysrq-trigger
Can you please let us know, why the logs are not getting collected on reboot.
Is there any RAMOOPS_ARGS need to be passed, if so please give the command args.

Thanks


#2

Could you check if below dt binding in hi3660-hikey960.dts can work well for ramoops?

            ramoops_ram:pstore-mem{
                     compatible = "ramoops";
                     reg = <0x0 0x20A00000 0x0 0x100000>;
                     record-size     = <0x00020000>;
                     console-size    = <0x00020000>;
                     ftrace-size     = <0x00020000>;
             };

#3

Ok will try and let you know.


#4

After kernel booting up, also need below two commands:

# mount -t debugfs debugfs /sys/kernel/debug/
# echo 1 > /sys/kernel/debug/pstore/record_ftrace


#5

Getting below error:

mount -t debugfs debugfs /sys/kernel/debug/
mount: ‘debugfs’->’/sys/kernel/debug/’: Device or resource busy


#6

Getting below error:

mount -t debugfs debugfs /sys/kernel/debug/
mount: ‘debugfs’->’/sys/kernel/debug/’: Device or resource busy

Please skip this command, the virtual fs has been mounted yet.


#7

Okay, I skipped that command.
And tried to induce kernel panic with below command, after that device will not boot, it stops at bootloader, again I need to do fastboot reboot, and no logs are collected under /sys/fs/pstore.
echo c > /proc/sysrq-trigger


#8

Hi,
On kernel panic it stops at bootloader (fastboot) instead of reboot, can you please tell how to force reboot? Any boot args needs to be set?

Thanks


#9

Thanks ramoops worked…

But it stops at bootloader (fastboot) instead of reboot, can you please tell how to force reboot?
Any boot args needs to be set?


#10

Sorry for replying late. I checked with landing team, there have no good method to disable “fastboot” mode in boot images. This is not friendly for ramoops and kdump; will check how to resolve this.


#11

I verified the ramoops can work well with ARM+UEFI boot images. If it’s fine for you to change using ARM+UEFI, you could firstly try it: https://builds.96boards.org/snapshots/reference-platform/components/uefi-staging/latest/hikey960/debug/

Or you could follow up steps in doc to build images by self: https://github.com/96boards-hikey/tools-images-hikey960/blob/master/build-from-source/README-ATF-UEFI-build-from-source.md

FWIW, I verified ramoops on Android 4.4 kernel, you could see the https://android.googlesource.com/kernel/hikey-linaro/+/9c9314558e7f5c607184d4a4093e3fd72386cacf has been merged for ramoops dt binding. And you need one extra patch: https://android-review.googlesource.com/#/c/443912/, if without this extra patch, after enabling ftrace dump in ramoops, it’s easily to introduce hang issue.


#12

Thanks for all your support.
Right now the ramoops is working for me with passing boot args, so I will try ARM+UEFI sometime later.
If you have found the fix to disable fastboot mode, please share.


#13

I am curious how you do this?


#14

Hi,
You can put the boot args in Board file and generate boot.img, which worked for me.