From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34545) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSQSy-0002ms-Je for qemu-devel@nongnu.org; Wed, 27 Jul 2016 11:09:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSQSw-0008I6-JS for qemu-devel@nongnu.org; Wed, 27 Jul 2016 11:09:47 -0400 Received: from mail-pa0-x244.google.com ([2607:f8b0:400e:c03::244]:34390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSQSw-0008Hz-CI for qemu-devel@nongnu.org; Wed, 27 Jul 2016 11:09:46 -0400 Received: by mail-pa0-x244.google.com with SMTP id hh10so1920256pac.1 for ; Wed, 27 Jul 2016 08:09:46 -0700 (PDT) Sender: Namhyung Kim From: Namhyung Kim Date: Thu, 28 Jul 2016 00:08:26 +0900 Message-Id: <1469632111-23260-3-git-send-email-namhyung@kernel.org> In-Reply-To: <1469632111-23260-1-git-send-email-namhyung@kernel.org> References: <1469632111-23260-1-git-send-email-namhyung@kernel.org> Subject: [Qemu-devel] [PATCH 2/7] pstore/ram: Set pstore flags dynamically List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: kvm@vger.kernel.org, qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org Cc: LKML , Anton Vorontsov , Colin Cross , Kees Cook , Tony Luck 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 Cc: Colin Cross Cc: Kees Cook Cc: Tony Luck Signed-off-by: Namhyung Kim --- 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