什么是ram console?
请参考:
- MediaTek On-Line> Quick Start> Deep in MTK Turnkey Solution Logging Tools
系统重启时关键信息
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文件里。对这只文件的各个栏位解读请查看:
- MediaTek On-Line> Quick Start> 深入分析看门狗框架> 分析方法> HW reboot> HW reboot调试信息