MTK ram console

ramconsole在系统重启时保留关键信息,如lastkmsg及重要系统数据,这些信息存储在ram_console_buffer中,对调试极为重要。重启后,相关信息打包至SYS_REBOOT_REASON文件,便于深入分析重启原因。

什么是ram console?

    请参考:

系统重启时关键信息

    ram console除了保持last kmsg外,还有重要的系统信息,这些非常有助于我们调试。这些信息保存在ram console的头部ram_console_buffer里。

struct ram_console_buffer
{
    uint32_t sig;
    /* for size comptible */
    uint32_t off_pl;
    uint32_t off_lpl; /* last preloader: struct reboot_reason_pl*/
    uint32_t sz_pl;
    uint32_t off_lk;
    uint32_t off_llk; /* last lk: struct reboot_reason_lk */
    uint32_t sz_lk;
    uint32_t padding[3];
    uint32_t sz_buffer;
    uint32_t off_linux; /* struct last_reboot_reason */
    uint32_t off_console;

    /* console buffer*/
    uint32_t log_start;
    uint32_t log_size;
    uint32_t sz_console;
};

这个结构体里的off_linux指向了struct last_reboot_reason,里面保存了重要的信息:

struct last_reboot_reason
{
    uint32_t fiq_step;
    uint32_t exp_type; /* 0xaeedeadX: X=1 (HWT), X=2 (KE), X=3 (nested panic) */
    uint32_t reboot_mode;

    uint32_t last_irq_enter[NR_CPUS];
    uint64_t jiffies_last_irq_enter[NR_CPUS];

    uint32_t last_irq_exit[NR_CPUS];
    uint64_t jiffies_last_irq_exit[NR_CPUS];

    uint64_t jiffies_last_sched[NR_CPUS];
    char last_sched_comm[NR_CPUS][TASK_COMM_LEN];

    uint8_t hotplug_data1[NR_CPUS], uint8_t hotplug_data2;
    uint64_t hotplug_data3;

    uint32_t mcdi_wfi, mcdi_r15, deepidle_data, sodi_data, spm_suspend_data;
    uint64_t cpu_dormant[NR_CPUS];
    uint32_t clk_data[8], suspend_debug_flag;

    uint8_t cpu_dvfs_vproc_big, cpu_dvfs_vproc_little, cpu_dvfs_oppidx, cpu_dvfs_status;

    uint8_t gpu_dvfs_vgpu, gpu_dvfs_oppidx, gpu_dvfs_status;

    uint64_t ptp_cpu_big_volt, ptp_cpu_little_volt, ptp_gpu_volt, ptp_temp;
    uint8_t ptp_status;

    uint8_t thermal_temp1, thermal_temp2, thermal_temp3, thermal_temp4, thermal_temp5;
    uint8_t thermal_status;

    void *kparams;
};

以上重要的信息在重启后将被打包到db里的SYS_REBOOT_REASON文件里。对这只文件的各个栏位解读请查看:

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值