[PATCH 1/2] kmsg_dump: adding to reboot, halt, poweroff and emergency_restart path

Previous thread: [PATCH 2/2] kmsg_dump: adding to reboot, halt, poweroff and emergency_restart path by Seiji Aguchi on Wednesday, November 17, 2010 - 8:03 am. (3 messages)

Next thread: [PATCH 1/7] staging/stradis: mark as "depends on BKL" by Arnd Bergmann on Wednesday, November 17, 2010 - 8:26 am. (2 messages)
From: Seiji Aguchi
Date: Wednesday, November 17, 2010 - 7:58 am

[Empty message]
From: Seiji Aguchi
Date: Wednesday, November 17, 2010 - 8:00 am

This patch alters mtdoops and ramoops to perform their actions only for KMSG_DUMP_PANIC,
KMSG_DUMP_OOPS and KMSG_DUMP_KEXEC because they would like to log crashes only.

 Signed-off-by: Seiji Aguchi <seiji.aguchi@hds.com>

---
 drivers/char/ramoops.c |    5 +++++
 drivers/mtd/mtdoops.c  |    5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/char/ramoops.c b/drivers/char/ramoops.c index 73dcb0e..8998b29 100644
--- a/drivers/char/ramoops.c
+++ b/drivers/char/ramoops.c
@@ -69,6 +69,11 @@ static void ramoops_do_dump(struct kmsg_dumper *dumper,
 	char *buf;
 	struct timeval timestamp;
 
+	if (reason != KMSG_DUMP_OOPS &&
+	    reason != KMSG_DUMP_PANIC &&
+	    reason != KMSG_DUMP_KEXEC)
+		return;
+
 	/* Only dump oopses if dump_oops is set */
 	if (reason == KMSG_DUMP_OOPS && !dump_oops)
 		return;
diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c index 1ee72f3..c948150 100644
--- a/drivers/mtd/mtdoops.c
+++ b/drivers/mtd/mtdoops.c
@@ -307,6 +307,11 @@ static void mtdoops_do_dump(struct kmsg_dumper *dumper,
 	unsigned long l1_cpy, l2_cpy;
 	char *dst;
 
+	if (reason != KMSG_DUMP_OOPS &&
+	    reason != KMSG_DUMP_PANIC &&
+	    reason != KMSG_DUMP_KEXEC)
+		return;
+
 	/* Only dump oopses if dump_oops is set */
 	if (reason == KMSG_DUMP_OOPS && !dump_oops)
 		return;
--
1.7.2.2

From: Artem Bityutskiy
Date: Thursday, November 18, 2010 - 1:16 am

Looks OK,

Reviewed-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

--

From: KOSAKI Motohiro
Date: Tuesday, November 23, 2010 - 1:54 am

Looks good.
	Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>



--

From: Andrew Morton
Date: Wednesday, November 17, 2010 - 1:45 pm

On Wed, 17 Nov 2010 09:58:18 -0500

Damn, that's a good changelog.  We can actually understand why you
wrote the patch, and see what its value is!

One thing: please don't send multiple patches with the same title. 
See Documentation/SubmittingPatches section 15.  I renamed these two
patches to

kmsg_dump: constrain mtdoops and ramoops to perform their actions only for KMSG_DUMP_PANIC

and

kmsg_dump: add kmsg_dump() calls to the reboot, halt, poweroff and emergency_restart paths

--

Previous thread: [PATCH 2/2] kmsg_dump: adding to reboot, halt, poweroff and emergency_restart path by Seiji Aguchi on Wednesday, November 17, 2010 - 8:03 am. (3 messages)

Next thread: [PATCH 1/7] staging/stradis: mark as "depends on BKL" by Arnd Bergmann on Wednesday, November 17, 2010 - 8:26 am. (2 messages)