How about this:
1) log the information about the initial set/reset of the watchdog
(first pass only), 
2) then only log errors in the non-debug case.
This lets the admin know that the watchdog had been starter (was
running), and the SEL and syslog can be reviewed post-mortem to find the
cause.  

Definitely do not log the watchdog reset every time.  

Andy

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bryan
Sutula
Sent: Monday, November 19, 2007 11:32 AM
To: [email protected]
Subject: [Openhpi-devel] Watchdog err() vs. dbg() calls

As part of issue #1804512, "Debug output occurring during normal
operation", there are four places where the watchdog plugin emits errors
during normal operation.  I propose changing these to dbg() as per the
enclosed patch.

However, I can see a case for leaving them as errors.  Since the
watchdog will reset the target system, it might be good to have tracks
in syslog so that an administrator can make sense of why the reboot
happened.  Otherwise, it simply looks like it crashed.

Yet, if we leave them as errors, I'm concerned that we'll fill syslog
with "reset the watchdog" messages, as the timer is "petted".  This
isn't good either.

Thoughts?

-- 
Bryan Sutula <[EMAIL PROTECTED]>

---------------------------------------------------------------------

Index: plugins/watchdog/watchdog.c
===================================================================
--- plugins/watchdog/watchdog.c (revision 6596)
+++ plugins/watchdog/watchdog.c (working copy)
@@ -488,7 +488,7 @@
 
                        /* pat the dog to restart the timer from the
initial
                        * countdown value */
-                       err("reset the watchdog");
+                       dbg("reset the watchdog");
                        if (-1 == write(wdtitems->fd, "1", 1)) {
                                err("could not reset watchdog");
                                ret = SA_ERR_HPI_ERROR;
@@ -498,7 +498,7 @@
        } else {
                if (SAHPI_TRUE == w.Running) {
                        /* stop the watchdog device */
-                       err("Stop watchdog");
+                       dbg("Stop watchdog");
                        if (-1 == write(wdtitems->fd, "V", 1)) {
                                err("Unable to write to watchdog");
                                ret = SA_ERR_HPI_ERROR;
@@ -564,7 +564,7 @@
        if (wdtitems->data.Running == SAHPI_FALSE) {
                int timeout;
 
-               err("start up the watchdog");
+               dbg("start up the watchdog");
                /* calling reset on stopped watchdog will */
                /* cause the watchdog to start            */
                wdtitems->fd = open(wdtitems->path, O_RDWR);
@@ -594,7 +594,7 @@
 
        /* pat the dog to restart the timer from the initial
         * countdown value */
-       err("reset the watchdog");
+       dbg("reset the watchdog");
        if (-1 == write(wdtitems->fd, "1", 1)) {
                err("unable to reset the watchdog");
                return SA_ERR_HPI_ERROR;



------------------------------------------------------------------------
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Openhpi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openhpi-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Openhpi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openhpi-devel

Reply via email to