首页 > 其他分享 >ramoops

ramoops

时间:2023-02-01 11:15:06浏览次数:66  
标签:buffer ram persistent prz ramoops size

ramoops

ramoops dts mem buffer IO map

ramoops_probe
ramoops_init_prz
persistent_ram_new
persistent_ram_buffer_map

 fs/pstore/ram_core.c

static int persistent_ram_buffer_map(phys_addr_t start, phys_addr_t size,
        struct persistent_ram_zone *prz, int memtype)
{
    prz->paddr = start;
    prz->size = size;

    if (pfn_valid(start >> PAGE_SHIFT))
        prz->vaddr = persistent_ram_vmap(start, size, memtype);
    else
        prz->vaddr = persistent_ram_iomap(start, size, memtype,
                          prz->label);

    if (!prz->vaddr) {
        pr_err("%s: Failed to map 0x%llx pages at 0x%llx\n", __func__,
            (unsigned long long)size, (unsigned long long)start);
        return -ENOMEM;
    }

    prz->buffer = prz->vaddr;
    prz->buffer_size = size - sizeof(struct persistent_ram_buffer);

    return 0;
}

 写console log到console IO mem buffer

__memcpy_toio+0x18/0x6c
persistent_ram_update+0x44/0x12c
persistent_ram_write+0x1a8/0x1b8
ramoops_pstore_write+0x198/0x1e8
pstore_console_write+0x90/0xdc
console_unlock+0x3b0/0x5c0
vprintk_emit+0x184/0x238
vprintk_default+0x48/0x70
vprintk_func+0x1bc/0x1f8
printk+0x54/0x7c
wakeup_source_activate+0xa4/0x1e0

 

标签:buffer,ram,persistent,prz,ramoops,size
From: https://www.cnblogs.com/aspirs/p/17081921.html

相关文章