示例#1
0
static int aee_rr_reboot_reason_proc_show(struct seq_file *m, void *v)
{
    int i;
    static char reg_buf[1024];

    seq_printf(m, "WDT status: %d\n fiq step: %u\n",
               aee_rr_last_rec.wdt_status, aee_rr_last_rec.fiq_step);
    for (i = 0; i < NR_CPUS; i++) {
        seq_printf(m, "CPU %d\n"
                   "  irq: enter(%d, %llu) quit(%d, %llu)\n"
                   "  sched: %llu, \"%s\"\n"
                   "  hotplug: %d, %d\n", i,
                   aee_rr_last_rec.last_irq_enter[i],
                   aee_rr_last_rec.jiffies_last_irq_enter[i],
                   aee_rr_last_rec.last_irq_exit[i],
                   aee_rr_last_rec.jiffies_last_irq_exit[i],
                   aee_rr_last_rec.jiffies_last_sched[i],
                   aee_rr_last_rec.last_sched_comm[i], aee_rr_last_rec.hotplug_data1[i],
                   aee_rr_last_rec.hotplug_data2[i]);
    }
    if (mt_reg_dump(reg_buf) == 0)
        seq_printf(m, "%s\n", reg_buf);

    return 0;
}
void aee_rr_show_last_pc(struct seq_file *m)
{
	char *reg_buf = kmalloc(4096, GFP_KERNEL);
	if (reg_buf && mt_reg_dump(reg_buf) == 0) {
		seq_printf(m, "%s\n", reg_buf);
		kfree(reg_buf);
	}
}
static ssize_t last_pc_dump_show(struct device_driver *driver, char *buf)
{
	int ret = mt_reg_dump(buf);
	if (ret == -1)
		pr_err("Dump error in %s, %d\n", __func__, __LINE__);

	return strlen(buf);
}