Skip to contentSkip to conversation

watchdog: Improve failure message and documentation

PATCH Superseded Ben Hutchings 2 participants 3 messages Jan 2, 2011 – Jan 3, 2011 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog: Improve failure message and documentation

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.

---
 Documentation/kernel-parameters.txt |    2 +-
 kernel/watchdog.c                   |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
Documentation/kernel-parameters.txt +1 -1
index 7d0cead..6fc0cf4 100644
@@ -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]
 
kernel/watchdog.c +2 -1
index d74e866..5b44d2c 100644
@@ -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 */
Signature · 1 line
1.7.2.3
#1 lore raw

PATCH v2 1/1 watchdog: Improve initialisation error message and documentation

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.

---
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(-)
Documentation/kernel-parameters.txt +1 -1
index 7d0cead..6fc0cf4 100644
@@ -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]
 
kernel/watchdog.c +2 -1
index d74e866..d7ebdf4 100644
@@ -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 */
Signature · 1 line
1.7.2.3
#2 lore raw

Re: [PATCH v2] watchdog: Improve initialisation error message and documentation

Quoted 10 lines · Ben Hutchings

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.

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

Cheers,
Don