diff mbox

[v2] IPMI: Only log events that needs attention

Message ID 1439185603-27191-1-git-send-email-hegdevasant@linux.vnet.ibm.com
State Accepted
Headers show

Commit Message

Vasant Hegde Aug. 10, 2015, 5:46 a.m. UTC
Presently we are logging all the events to service processor (FSP/BMC).
But on BMC machines we should only log events that requires attention.

As per PEL spec, we should log events with severity >= 0x22 and "service
action flag" is "on". But in our case, all logs OPAL originagted logs
are makred as report externally.

So lets log all events that are originated from OAPL (presently all logs
as payload is not logging any PEL event) and  severity >= 0x22.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Alistair Popple <alistair@popple.id.au>
Cc: Jeremy Kerr <jk@ozlabs.org>
---
 hw/ipmi/ipmi-sel.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Ananth N Mavinakayanahalli Aug. 10, 2015, 7:05 a.m. UTC | #1
On Mon, Aug 10, 2015 at 11:16:43AM +0530, Vasant Hegde wrote:
> Presently we are logging all the events to service processor (FSP/BMC).
> But on BMC machines we should only log events that requires attention.
> 
> As per PEL spec, we should log events with severity >= 0x22 and "service
> action flag" is "on". But in our case, all logs OPAL originagted logs
> are makred as report externally.
> 
> So lets log all events that are originated from OAPL (presently all logs
> as payload is not logging any PEL event) and  severity >= 0x22.
> 
> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
> Cc: Alistair Popple <alistair@popple.id.au>
> Cc: Jeremy Kerr <jk@ozlabs.org>
> ---
>  hw/ipmi/ipmi-sel.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/hw/ipmi/ipmi-sel.c b/hw/ipmi/ipmi-sel.c
> index f03f19e..fde1fee 100644
> --- a/hw/ipmi/ipmi-sel.c
> +++ b/hw/ipmi/ipmi-sel.c
> @@ -268,6 +268,13 @@ int ipmi_elog_commit(struct errorlog *elog_buf)
>  {
>  	struct ipmi_msg *msg;
> 
> +	/* Only log events that needs attention */
> +	if (elog_buf->event_severity < OPAL_PREDICTIVE_ERR_FAULT_RECTIFY_REBOOT ||
> +	    elog_buf->elog_origin != ORG_SAPPHIRE) {
> +		prlog(PR_INFO, "SEL: dropping non severe PEL event\n");

Should the tag be IPMI instead of SEL?

You may want to be a bit more verbose in the error specifying at least
the SRC or some such from the PEL that will tell us what event got dropped.

Ananth
Stewart Smith Aug. 14, 2015, 5:55 a.m. UTC | #2
Vasant Hegde <hegdevasant@linux.vnet.ibm.com> writes:
> Presently we are logging all the events to service processor (FSP/BMC).
> But on BMC machines we should only log events that requires attention.
>
> As per PEL spec, we should log events with severity >= 0x22 and "service
> action flag" is "on". But in our case, all logs OPAL originagted logs
> are makred as report externally.
>
> So lets log all events that are originated from OAPL (presently all logs
> as payload is not logging any PEL event) and  severity >= 0x22.
>
> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
> Cc: Alistair Popple <alistair@popple.id.au>
> Cc: Jeremy Kerr <jk@ozlabs.org>

Merged, changed to IPMI rather than SEL and then made the file use
pr_fmt infrastructure.
diff mbox

Patch

diff --git a/hw/ipmi/ipmi-sel.c b/hw/ipmi/ipmi-sel.c
index f03f19e..fde1fee 100644
--- a/hw/ipmi/ipmi-sel.c
+++ b/hw/ipmi/ipmi-sel.c
@@ -268,6 +268,13 @@  int ipmi_elog_commit(struct errorlog *elog_buf)
 {
 	struct ipmi_msg *msg;
 
+	/* Only log events that needs attention */
+	if (elog_buf->event_severity < OPAL_PREDICTIVE_ERR_FAULT_RECTIFY_REBOOT ||
+	    elog_buf->elog_origin != ORG_SAPPHIRE) {
+		prlog(PR_INFO, "SEL: dropping non severe PEL event\n");
+		return 0;
+	}
+
 	/* We pass a large request size in to mkmsg so that we have a
 	 * large enough allocation to reuse the message to pass the
 	 * PEL data via a series of partial add commands.  */