[PATCH] watchdog, nmi: lower the severity of error messages

From: Don Zickus
Date: Wed Feb 09 2011 - 14:03:02 EST


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.

Reported-by: Paul Bolle <pebolle@xxxxxxxxxx>
Tested-by: Paul Bolle <pebolle@xxxxxxxxxx>
Signed-off-by: Don Zickus <dzickus@xxxxxxxxxx>
---
kernel/watchdog.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index d7ebdf4..bb7887b 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -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 */
--
1.7.3.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/