public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] watchdog: Improve failure message and documentation
@ 2011-01-02 22:00 Ben Hutchings
  2011-01-02 23:02 ` [PATCH v2] watchdog: Improve initialisation error " Ben Hutchings
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Hutchings @ 2011-01-02 22:00 UTC (permalink / raw)
  To: Ingo Molnar, Don Zickus, Frederic Weisbecker; +Cc: linux-kernel, 599368, 608138

[-- Attachment #1: Type: text/plain, Size: 1446 bytes --]

The error message 'NMI watchdog failed to create perf event...'
currently prints the error value as a pointer, rather than extracting
the error code with PTR_ERR().  Fix that.

Add a note about the 'nowatchdog' kernel parameter to associate it
with this message.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 Documentation/kernel-parameters.txt |    2 +-
 kernel/watchdog.c                   |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 7d0cead..6fc0cf4 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1764,7 +1764,7 @@ and is between 256 and 4096 characters. It is defined in the file
 
 	nousb		[USB] Disable the USB subsystem
 
-	nowatchdog	[KNL] Disable the lockup detector.
+	nowatchdog	[KNL] Disable the lockup detector (NMI watchdog).
 
 	nowb		[ARM]
 
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index d74e866..5b44d2c 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -366,7 +366,8 @@ static int watchdog_nmi_enable(int cpu)
 		goto out_save;
 	}
 
-	printk(KERN_ERR "NMI watchdog failed to create perf event on cpu%i: %p\n", cpu, event);
+	printk(KERN_ERR "NMI watchdog failed to create perf event on cpu%i: %ld\n",
+	       cpu, PTR_ERR(event));
 	return PTR_ERR(event);
 
 	/* success path */
-- 
1.7.2.3



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

* [PATCH v2] watchdog: Improve initialisation error message and documentation
  2011-01-02 22:00 [PATCH] watchdog: Improve failure message and documentation Ben Hutchings
@ 2011-01-02 23:02 ` Ben Hutchings
  2011-01-03 13:56   ` Don Zickus
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Hutchings @ 2011-01-02 23:02 UTC (permalink / raw)
  To: Ingo Molnar, Don Zickus, Frederic Weisbecker
  Cc: linux-kernel, 599368, 608138, Cesare Leonardi

The error message 'NMI watchdog failed to create perf event...'  does
not make it clear that this is a fatal error for the watchdog.  It
also currently prints the error value as a pointer, rather than
extracting the error code with PTR_ERR().  Fix that.

Add a note to the description of the 'nowatchdog' kernel parameter to
associate it with this message.

Reported-by: Cesare Leonardi <celeonar@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
Further improved the error message based on Cesare's comments.

Ben.

 Documentation/kernel-parameters.txt |    2 +-
 kernel/watchdog.c                   |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 7d0cead..6fc0cf4 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1764,7 +1764,7 @@ and is between 256 and 4096 characters. It is defined in the file
 
 	nousb		[USB] Disable the USB subsystem
 
-	nowatchdog	[KNL] Disable the lockup detector.
+	nowatchdog	[KNL] Disable the lockup detector (NMI watchdog).
 
 	nowb		[ARM]
 
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index d74e866..d7ebdf4 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -366,7 +366,8 @@ static int watchdog_nmi_enable(int cpu)
 		goto out_save;
 	}
 
-	printk(KERN_ERR "NMI watchdog failed to create perf event on cpu%i: %p\n", cpu, event);
+	printk(KERN_ERR "NMI watchdog disabled for cpu%i: unable to create perf event: %ld\n",
+	       cpu, PTR_ERR(event));
 	return PTR_ERR(event);
 
 	/* success path */
-- 
1.7.2.3



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

* Re: [PATCH v2] watchdog: Improve initialisation error message and documentation
  2011-01-02 23:02 ` [PATCH v2] watchdog: Improve initialisation error " Ben Hutchings
@ 2011-01-03 13:56   ` Don Zickus
  0 siblings, 0 replies; 3+ messages in thread
From: Don Zickus @ 2011-01-03 13:56 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Ingo Molnar, Frederic Weisbecker, linux-kernel, 599368, 608138,
	Cesare Leonardi

On Sun, Jan 02, 2011 at 11:02:42PM +0000, Ben Hutchings wrote:
> The error message 'NMI watchdog failed to create perf event...'  does
> not make it clear that this is a fatal error for the watchdog.  It
> also currently prints the error value as a pointer, rather than
> extracting the error code with PTR_ERR().  Fix that.
> 
> Add a note to the description of the 'nowatchdog' kernel parameter to
> associate it with this message.
> 
> Reported-by: Cesare Leonardi <celeonar@gmail.com>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

Looks good, thanks.  I'll add it to my queue.

Cheers,
Don

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

end of thread, other threads:[~2011-01-03 13:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-02 22:00 [PATCH] watchdog: Improve failure message and documentation Ben Hutchings
2011-01-02 23:02 ` [PATCH v2] watchdog: Improve initialisation error " Ben Hutchings
2011-01-03 13:56   ` Don Zickus

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