Skip to contentSkip to conversation

watchdog, nmi: lower the severity of error messages

PATCH In review Don Zickus 1 participant 2 messages Feb 9, 2011 – Feb 10, 2011

lore
Share & tools
lore

Don Zickus

author
#0 lore raw

PATCH 1/1 watchdog, nmi: lower the severity of error messages

During boot if the hardlockup detector fails to initialize, it complains very loudly. Some failures should be expected under certain situations, ie no lapics, or resource in-use. Tone those error messages down a bit. Keep the rest at a high level.

---
 kernel/watchdog.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
kernel/watchdog.c +11 -2
index d7ebdf4..bb7887b 100644
@@ -366,8 +366,17 @@ static int watchdog_nmi_enable(int cpu)
 		goto out_save;
 	}
 
-	printk(KERN_ERR "NMI watchdog disabled for cpu%i: unable to create perf event: %ld\n",
-	       cpu, PTR_ERR(event));
+
+	/* vary the KERN level based on the returned errno */
+	if (PTR_ERR(event) == -EOPNOTSUPP)
+		printk(KERN_INFO "NMI watchdog disabled (cpu%i): not supported"
+				 " (no LAPIC?)\n", cpu);
+	else if (PTR_ERR(event) == -ENOENT)
+		printk(KERN_WARNING "NMI watchdog disabled (cpu%i): hardware"
+				    " events not enabled\n", cpu);
+	else
+		printk(KERN_ERR "NMI watchdog disabled (cpu%i): unable to create"
+				" perf event: %ld\n", cpu, PTR_ERR(event));
 	return PTR_ERR(event);
 
 	/* success path */
Signature · 1 line
1.7.3.5
#1 lore raw

[tip:perf/urgent] watchdog, nmi: Lower the severity of error messages

Commit-ID:  5651f7f47dbb1cf2b95a60582546db4ff508e2b4
Gitweb:     http://git.kernel.org/tip/5651f7f47dbb1cf2b95a60582546db4ff508e2b4
Author:     Don Zickus <[email protected]>
AuthorDate: Wed, 9 Feb 2011 14:02:33 -0500
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 10 Feb 2011 13:21:59 +0100

watchdog, nmi: Lower the severity of error messages

During boot if the hardlockup detector fails to initialize, it complains very loudly. Some failures should be expected under certain situations, ie no lapics, or resource in-use. Tone those error messages down a bit. Keep the rest at a high level.

LKML-Reference: <[email protected]>

---
 kernel/watchdog.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
kernel/watchdog.c +8 -2
index f37f974..18bb157 100644
@@ -363,8 +363,14 @@ static int watchdog_nmi_enable(int cpu)
 		goto out_save;
 	}
 
-	printk(KERN_ERR "NMI watchdog disabled for cpu%i: unable to create perf event: %ld\n",
-	       cpu, PTR_ERR(event));
+
+	/* vary the KERN level based on the returned errno */
+	if (PTR_ERR(event) == -EOPNOTSUPP)
+		printk(KERN_INFO "NMI watchdog disabled (cpu%i): not supported (no LAPIC?)\n", cpu);
+	else if (PTR_ERR(event) == -ENOENT)
+		printk(KERN_WARNING "NMI watchdog disabled (cpu%i): hardware events not enabled\n", cpu);
+	else
+		printk(KERN_ERR "NMI watchdog disabled (cpu%i): unable to create perf event: %ld\n", cpu, PTR_ERR(event));
 	return PTR_ERR(event);
 
 	/* success path */