[COMMON] fs: pstore: introduce new method for hooking platform log with DSS
authorHosung Kim <hosung0.kim@samsung.com>
Mon, 10 Apr 2017 10:26:21 +0000 (19:26 +0900)
committerDonghyeok Choe <d7271.choe@samsung.com>
Wed, 16 May 2018 06:38:14 +0000 (15:38 +0900)
Since android M version, platform log is not dropped to kernel
space. This commit is needed to support other methods
log_main / log_radio are removed, divided space is combined
into one log called log_platform

This commit adds new method for hooking platform with using pstore.
Recently, pmsg added persistant file system to support userspace log.
Exynos-Snapshot hooks userspace log between them.

This commit adds pstore / pstore-ram / pmsg features support in
exynos-snapshot. It is available to logging kernel, ftrace data
and platform(userspace) log.
To support runtime logging(pstore-ram), platform device driver is
needed it has memory information we need

Change-Id: I45a6f61339660df755676da08cd52656b1fcc8b7
Signed-off-by: Hosung Kim <hosung0.kim@samsung.com>
fs/pstore/platform.c
fs/pstore/ram_core.c

index 2b21d180157c16a823f2f21d41e31d820bf77232..d86199761748fc365d9ffad17aaa7459dbf68a36 100644 (file)
@@ -659,6 +659,9 @@ static int pstore_write_user_compat(struct pstore_record *record,
                goto out;
        }
 
+
+       dbg_snapshot_hook_pmsg((char *)buf, record->size);
+
        ret = record->psi->write(record);
 
        kfree(record->buf);
index f54a577bc0f8ed895d570ffd6369b2e266c9879f..c378a838a62cc180853392aed401dff17f3191ab 100644 (file)
@@ -174,10 +174,10 @@ static void persistent_ram_ecc_old(struct persistent_ram_zone *prz)
                        size = buffer->data + prz->buffer_size - block;
                numerr = persistent_ram_decode_rs8(prz, block, size, par);
                if (numerr > 0) {
-                       pr_devel("error in block %p, %d\n", block, numerr);
+                       pr_info("error in block %p, %d\n", block, numerr);
                        prz->corrected_bytes += numerr;
                } else if (numerr < 0) {
-                       pr_devel("uncorrectable error in block %p\n", block);
+                       pr_info("uncorrectable error in block %p\n", block);
                        prz->bad_blocks++;
                }
                block += prz->ecc_info.block_size;
@@ -405,11 +405,19 @@ static void *persistent_ram_vmap(phys_addr_t start, size_t size,
        page_start = start - offset_in_page(start);
        page_count = DIV_ROUND_UP(size + offset_in_page(start), PAGE_SIZE);
 
+#ifndef CONFIG_DEBUG_SNAPSHOT
        if (memtype)
                prot = pgprot_noncached(PAGE_KERNEL);
        else
                prot = pgprot_writecombine(PAGE_KERNEL);
-
+#else
+       /*
+        * If using exynos-snapshot, we can get the debug information
+        * from tracing data of exynos-snapshot. So we don't need noncacheable
+        * region that could cause performace problems.
+        */
+       prot = PAGE_KERNEL;
+#endif
        pages = kmalloc_array(page_count, sizeof(struct page *), GFP_KERNEL);
        if (!pages) {
                pr_err("%s: Failed to allocate array for %u pages\n",
@@ -486,13 +494,13 @@ static int persistent_ram_post_init(struct persistent_ram_zone *prz, u32 sig,
                        pr_info("found existing invalid buffer, size %zu, start %zu\n",
                                buffer_size(prz), buffer_start(prz));
                else {
-                       pr_debug("found existing buffer, size %zu, start %zu\n",
+                       pr_info("found existing buffer, size %zu, start %zu\n",
                                 buffer_size(prz), buffer_start(prz));
                        persistent_ram_save_old(prz);
                        return 0;
                }
        } else {
-               pr_debug("no valid data in buffer (sig = 0x%08x)\n",
+               pr_info("no valid data in buffer (sig = 0x%08x)\n",
                         prz->buffer->sig);
        }