qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 2/7] pstore/ram: Set pstore flags dynamically


From: Namhyung Kim
Subject: [Qemu-devel] [PATCH 2/7] pstore/ram: Set pstore flags dynamically
Date: Thu, 28 Jul 2016 00:08:26 +0900

The ramoops can be configured to enable each pstore type by setting
their size.  In that case, it'd be better not to register disabled types
in the first place.

Cc: Anton Vorontsov <address@hidden>
Cc: Colin Cross <address@hidden>
Cc: Kees Cook <address@hidden>
Cc: Tony Luck <address@hidden>
Signed-off-by: Namhyung Kim <address@hidden>
---
 fs/pstore/ram.c        | 8 +++++++-
 include/linux/pstore.h | 2 --
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index ba19a74e95bc..6c93268f7ced 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -624,7 +624,13 @@ static int ramoops_probe(struct platform_device *pdev)
                goto fail_clear;
        }
 
-       cxt->pstore.flags = PSTORE_FLAGS_ALL;
+       cxt->pstore.flags = PSTORE_FLAGS_DMESG;
+       if (cxt->console_size)
+               cxt->pstore.flags |= PSTORE_FLAGS_CONSOLE;
+       if (cxt->ftrace_size)
+               cxt->pstore.flags |= PSTORE_FLAGS_FTRACE;
+       if (cxt->pmsg_size)
+               cxt->pstore.flags |= PSTORE_FLAGS_PMSG;
 
        err = pstore_register(&cxt->pstore);
        if (err) {
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index 069b96faf478..9790904de6d2 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -79,8 +79,6 @@ struct pstore_info {
 #define PSTORE_FLAGS_FTRACE    (1 << 2)
 #define PSTORE_FLAGS_PMSG      (1 << 3)
 
-#define PSTORE_FLAGS_ALL       ((1 << 4) - 1)
-
 extern int pstore_register(struct pstore_info *);
 extern void pstore_unregister(struct pstore_info *);
 extern bool pstore_cannot_block_path(enum kmsg_dump_reason reason);
-- 
2.8.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]