public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC/PATCH 1/2] swsusp: preserve boot-time printk output after resume
@ 2007-04-27 12:25 Pekka J Enberg
  2007-04-27 12:36 ` Pavel Machek
  2007-04-27 12:39 ` Johannes Berg
  0 siblings, 2 replies; 13+ messages in thread
From: Pekka J Enberg @ 2007-04-27 12:25 UTC (permalink / raw)
  To: linux-pm; +Cc: nigel, pavel

Hi,

Nigel, can I please get a sign-off for these if you're okay with them. 
Rafael, Pavel, please ACK or NAK. Thanks.

			Pekka

From: Nigel Cunningham <nigel@nigel.suspend2.net>

Adds a new config option CONFIG_PRINTK_NOSAVE which makes the kernel
preserve printk() output from boot after resume.  This is useful for
debugging hibernation.

Cc: Pavel Machek <pavel@ucw.cz>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
---
 include/linux/suspend.h |    6 ++++++
 kernel/power/Kconfig    |   11 +++++++++++
 kernel/printk.c         |    7 ++++---
 3 files changed, 21 insertions(+), 3 deletions(-)

Index: 2.6/include/linux/suspend.h
===================================================================
--- 2.6.orig/include/linux/suspend.h	2007-04-27 14:42:13.000000000 +0300
+++ 2.6/include/linux/suspend.h	2007-04-27 14:43:13.000000000 +0300
@@ -55,4 +55,10 @@ unsigned long get_safe_page(gfp_t gfp_ma
  */
 #define PAGES_FOR_IO	1024
 
+#ifdef CONFIG_PRINTK_NOSAVE
+#define POSS_NOSAVE __nosavedata
+#else
+#define POSS_NOSAVE
+#endif
+
 #endif /* _LINUX_SWSUSP_H */
Index: 2.6/kernel/power/Kconfig
===================================================================
--- 2.6.orig/kernel/power/Kconfig	2007-04-27 14:42:13.000000000 +0300
+++ 2.6/kernel/power/Kconfig	2007-04-27 14:43:13.000000000 +0300
@@ -48,6 +48,17 @@ config DISABLE_CONSOLE_SUSPEND
 	suspend/resume routines, but may itself lead to problems, for example
 	if netconsole is used.
 
+config PRINTK_NOSAVE
+	bool "Preserve printk data from boot kernel when resuming."
+	default n
+	---help---
+	This option gives printk data and the associated variables the
+	attribute __nosave, which means that they will not be saves as
+	part of the image. The net effect is that after resuming, your
+	dmesg will show the messages from prior to the atomic restore,
+	instead of the messages from the resumed kernel. This may be
+	useful for debugging hibernation.
+
 config PM_TRACE
 	bool "Suspend/resume event tracing"
 	depends on PM && PM_DEBUG && X86_32 && EXPERIMENTAL
Index: 2.6/kernel/printk.c
===================================================================
--- 2.6.orig/kernel/printk.c	2007-04-27 14:42:13.000000000 +0300
+++ 2.6/kernel/printk.c	2007-04-27 14:43:13.000000000 +0300
@@ -32,6 +32,7 @@  *	01Mar01 Andrew Morton <andrewm@uow.ed
 #include <linux/bootmem.h>
 #include <linux/syscalls.h>
 #include <linux/jiffies.h>
+#include <linux/suspend.h>
 
 #include <asm/uaccess.h>
 
@@ -92,9 +93,9 @@ static DEFINE_SPINLOCK(logbuf_lock);
  * The indices into log_buf are not constrained to log_buf_len - they
  * must be masked before subscripting
  */
-static unsigned long log_start;	/* Index into log_buf: next char to be read by syslog() */
-static unsigned long con_start;	/* Index into log_buf: next char to be sent to consoles */
-static unsigned long log_end;	/* Index into log_buf: most-recently-written-char + 1 */
+static unsigned long POSS_NOSAVE log_start;	/* Index into log_buf: next char to be read by syslog() */
+static unsigned long POSS_NOSAVE con_start;	/* Index into log_buf: next char to be sent to consoles */
+static unsigned long POSS_NOSAVE log_end;	/* Index into log_buf: most-recently-written-char + 1 */
 
 /*
  *	Array of consoles built from command line options (console=)

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-04-27 22:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-27 12:25 [RFC/PATCH 1/2] swsusp: preserve boot-time printk output after resume Pekka J Enberg
2007-04-27 12:36 ` Pavel Machek
2007-04-27 12:52   ` Pekka J Enberg
2007-04-27 12:57     ` Pavel Machek
2007-04-27 14:03       ` Alan Stern
2007-04-27 14:10         ` Pekka Enberg
2007-04-27 14:36           ` Alan Stern
2007-04-27 14:32         ` Johannes Berg
2007-04-27 14:44           ` Pavel Machek
2007-04-27 21:21       ` Nigel Cunningham
2007-04-27 22:05         ` Pavel Machek
2007-04-27 22:09           ` Nigel Cunningham
2007-04-27 12:39 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox