From: Sergiu Iordache <sergiu@chromium.org>
To: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Samo Pogacnik <samo_pogacnik@t-2.net>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
Randy Dunlap <randy.dunlap@oracle.com>,
Sergiu Iordache <sergiu@chromium.org>,
Marco Stornelli <marco.stornelli@gmail.com>,
Seiji Aguchi <seiji.aguchi@hds.com>,
"Ahmed S. Darwish" <darwish.07@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH] char drivers: Ram oops kernel configuration parameters
Date: Thu, 23 Jun 2011 11:36:00 -0700 [thread overview]
Message-ID: <1308854160-16022-1-git-send-email-sergiu@chromium.org> (raw)
Ramoops currently has module parameters for setting the configuration
variables (ram start, ram size and dump oopses). This makes it difficult to
configure when the module is compiled as a builtin.
This patch adds the following 3 configuration options which set the same
variables as the module parameters:
1. RAMOOPS_RAM_START
2. RAMOOPS_RAM_SIZE
3. RAMOOPS_RAM_DUMP_OOPS
Module parameters take precedence over configuration parameters.
Signed-off-by: Sergiu Iordache <sergiu@chromium.org>
---
drivers/char/Kconfig | 36 ++++++++++++++++++++++++++++++++++++
drivers/char/ramoops.c | 6 +++---
2 files changed, 39 insertions(+), 3 deletions(-)
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 49502bc..0284f9f 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -608,6 +608,42 @@ config RAMOOPS
This enables panic and oops messages to be logged to a circular
buffer in RAM where it can be read back at some later point.
+config RAMOOPS_RAM_START
+ hex "Ramoops physical start address"
+ depends on RAMOOPS
+ default "0"
+ ---help---
+ Start address of the memory area that is used by Ramoops.
+
+ For this feature to be useful, the selected memory area must be
+ preserved across reboot, so not used by the boot loader, for example.
+
+ Module parameter takes precedence over this.
+
+config RAMOOPS_RAM_SIZE
+ hex "Ramoops used RAM size"
+ depends on RAMOOPS
+ default "0"
+ ---help---
+ Size of the memory area that is used by Ramoops.
+
+ For this feature to be useful, the selected memory area must be
+ preserved across reboot, so not used by the boot loader, for example.
+
+ Module parameter takes precedence over this.
+
+config RAMOOPS_DUMP_OOPS
+ int "Dump oopses or only panics"
+ depends on RAMOOPS
+ default "1"
+ help
+ Flag to determine what gets dumped to RAM.
+
+ If set to 1 then both oopses and panics are dumped to RAM.
+ If set to 0 only kernel panics get dumped to RAM.
+
+ Module parameter takes precedence over this.
+
config MSM_SMD_PKT
bool "Enable device interface for some SMD packet ports"
default n
diff --git a/drivers/char/ramoops.c b/drivers/char/ramoops.c
index 1a9f5f6..31b2c30 100644
--- a/drivers/char/ramoops.c
+++ b/drivers/char/ramoops.c
@@ -32,17 +32,17 @@
#define RECORD_SIZE 4096UL
-static ulong mem_address;
+static ulong mem_address = CONFIG_RAMOOPS_RAM_START;
module_param(mem_address, ulong, 0400);
MODULE_PARM_DESC(mem_address,
"start of reserved RAM used to store oops/panic logs");
-static ulong mem_size;
+static ulong mem_size = CONFIG_RAMOOPS_RAM_SIZE;
module_param(mem_size, ulong, 0400);
MODULE_PARM_DESC(mem_size,
"size of reserved RAM used to store oops/panic logs");
-static int dump_oops = 1;
+static int dump_oops = CONFIG_RAMOOPS_DUMP_OOPS;
module_param(dump_oops, int, 0600);
MODULE_PARM_DESC(dump_oops,
"set to 1 to dump oopses, 0 to only dump panics (default 1)");
--
1.7.2.3
next reply other threads:[~2011-06-23 18:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-23 18:36 Sergiu Iordache [this message]
2011-06-23 18:39 ` Marco Stornelli
2011-06-23 19:59 ` Valdis.Kletnieks
2011-06-23 20:43 ` Sergiu Iordache
2011-06-23 21:33 ` Greg KH
2011-06-23 22:07 ` Mandeep Singh Baines
2011-06-24 10:49 ` Marco Stornelli
2011-06-24 17:06 ` Mandeep Singh Baines
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1308854160-16022-1-git-send-email-sergiu@chromium.org \
--to=sergiu@chromium.org \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=darwish.07@gmail.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=marco.stornelli@gmail.com \
--cc=randy.dunlap@oracle.com \
--cc=samo_pogacnik@t-2.net \
--cc=seiji.aguchi@hds.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®