Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755738Ab2JRLDU (ORCPT ); Thu, 18 Oct 2012 07:03:20 -0400 Received: from mga03.intel.com ([143.182.124.21]:42979 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932362Ab2JRLDR (ORCPT ); Thu, 18 Oct 2012 07:03:17 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,606,1344236400"; d="scan'208";a="157620789" From: dragos.tatulea@intel.com To: ccross@android.com, keescook@chromium.org, tony.luck@intel.com, cbouatmailru@gmail.com, linux-kernel@vger.kernel.org Cc: adrian.hunter@intel.com, octavian.purdila@intel.com Subject: [PATCH v3 1/9] pstore: add flags Date: Thu, 18 Oct 2012 14:05:59 +0300 Message-Id: <1350558367-31801-2-git-send-email-dragos.tatulea@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1350558367-31801-1-git-send-email-dragos.tatulea@intel.com> References: <1350558367-31801-1-git-send-email-dragos.tatulea@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1863 Lines: 71 From: Adrian Hunter Let the back end tweak pstore behaviour. Flags added are: PSTORE_NO_HEADINGS Omit pstore heading lines from dumped data PSTORE_MAX_KMSG_BYTES Default kmsg_bytes to ULONG_MAX Signed-off-by: Adrian Hunter --- fs/pstore/platform.c | 9 ++++++++- include/linux/pstore.h | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index a40da07..c4ea778 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -128,7 +128,11 @@ static void pstore_dump(struct kmsg_dumper *dumper, size_t len; dst = psinfo->buf; - hsize = sprintf(dst, "%s#%d Part%d\n", why, oopscount, part); + if (psinfo->flags & PSTORE_NO_HEADINGS) + hsize = 0; + else + hsize = sprintf(dst, "%s#%d Part%d\n", why, oopscount, + part); size = psinfo->bufsize - hsize; dst += hsize; @@ -237,6 +241,9 @@ int pstore_register(struct pstore_info *psi) return -EINVAL; } + if (psinfo->flags & PSTORE_MAX_KMSG_BYTES) + kmsg_bytes = ULONG_MAX; + if (pstore_is_mounted()) pstore_get_records(0); diff --git a/include/linux/pstore.h b/include/linux/pstore.h index ee3034a..55ab23f 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h @@ -40,9 +40,13 @@ enum pstore_type_id { struct module; +#define PSTORE_NO_HEADINGS BIT(0) +#define PSTORE_MAX_KMSG_BYTES BIT(1) + struct pstore_info { struct module *owner; char *name; + unsigned int flags; spinlock_t buf_lock; /* serialize access to 'buf' */ char *buf; size_t bufsize; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/