diff mbox

[v10,1/3] aerdrv: Trace Event for AER

Message ID CANVTcTYJS3eAUA4bHVCrKgz=7rQpJZHCiBcw3JM=j0FbCsgQJw@mail.gmail.com
State Not Applicable
Headers show

Commit Message

Rui Wang Dec. 6, 2013, 9:06 a.m. UTC
On 12/5/13, Borislav Petkov <bp@alien8.de> wrote:

> Yes, the AER tracepoint above should use the AER_* defines and not the
> HW_EVENT_ERR_* ones which are for memory errors.
>
> Wanna send a fix?
>

Yes. Does it translate into something like this?

From: Rui Wang <rui.y.wang@intel.com>
Date: Fri, 6 Dec 2013 16:47:46 +0800
Subject: [PATCH] Fix severity usage in aer trace event

Signed-off-by: Rui Wang <rui.y.wang@intel.com>
---
 include/trace/events/ras.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

Comments

Ethan Zhao Dec. 6, 2013, 3:11 p.m. UTC | #1
On Fri, Dec 6, 2013 at 5:06 PM, rui wang <ruiv.wang@gmail.com> wrote:
> On 12/5/13, Borislav Petkov <bp@alien8.de> wrote:
>
>> Yes, the AER tracepoint above should use the AER_* defines and not the
>> HW_EVENT_ERR_* ones which are for memory errors.
>>
>> Wanna send a fix?
>>
>
> Yes. Does it translate into something like this?
>
> From: Rui Wang <rui.y.wang@intel.com>
> Date: Fri, 6 Dec 2013 16:47:46 +0800
> Subject: [PATCH] Fix severity usage in aer trace event
>
> Signed-off-by: Rui Wang <rui.y.wang@intel.com>
> ---
>  include/trace/events/ras.h |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/trace/events/ras.h b/include/trace/events/ras.h
> index 88b8783..e2a17d8 100644
> --- a/include/trace/events/ras.h
> +++ b/include/trace/events/ras.h
> @@ -5,7 +5,7 @@
>  #define _TRACE_AER_H
>
>  #include <linux/tracepoint.h>
> -#include <linux/edac.h>
> +#include <linux/aer.h>
>
>
>  /*
> @@ -63,10 +63,10 @@ TRACE_EVENT(aer_event,
>
>         TP_printk("%s PCIe Bus Error: severity=%s, %s\n",
>                 __get_str(dev_name),
> -               __entry->severity == HW_EVENT_ERR_CORRECTED ? "Corrected" :
> -                       __entry->severity == HW_EVENT_ERR_FATAL ?
> +               __entry->severity == AER_CORRECTABLE ? "Corrected" :
> +                       __entry->severity == AER_FATAL ?
>                         "Fatal" : "Uncorrected",

Why not             "Fatal" : "Non-fatal",   ?  per the PCIe spec,
'Fatal' and 'Non-fatal' are sub-category of "
Uncorrected". But here "Uncorrected" means "Non-fatal".

Thanks,
Ethan

> -               __entry->severity == HW_EVENT_ERR_CORRECTED ?
> +               __entry->severity == AER_CORRECTABLE ?
>                 __print_flags(__entry->status, "|", aer_correctable_errors) :
>                 __print_flags(__entry->status, "|", aer_uncorrectable_errors))
>  );
> --
> 1.7.5.4
>
> Regards,
> Rui
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Borislav Petkov Dec. 7, 2013, 5:45 p.m. UTC | #2
On Fri, Dec 06, 2013 at 11:11:07PM +0800, Ethan Zhao wrote:
> > @@ -63,10 +63,10 @@ TRACE_EVENT(aer_event,
> >
> >         TP_printk("%s PCIe Bus Error: severity=%s, %s\n",
> >                 __get_str(dev_name),
> > -               __entry->severity == HW_EVENT_ERR_CORRECTED ? "Corrected" :
> > -                       __entry->severity == HW_EVENT_ERR_FATAL ?
> > +               __entry->severity == AER_CORRECTABLE ? "Corrected" :
> > +                       __entry->severity == AER_FATAL ?
> >                         "Fatal" : "Uncorrected",
> 
> Why not             "Fatal" : "Non-fatal",   ?  per the PCIe spec,
> 'Fatal' and 'Non-fatal' are sub-category of "
> Uncorrected". But here "Uncorrected" means "Non-fatal".

... and just to denote that, it'll probably be best to say:

		__entry->severity == AER_CORRECTABLE ? "Corrected" :
			__entry->severity == AER_FATAL ?
			   "Fatal" : "Uncorrected, non-fatal"

right?

Btw, Rui, you patch is whitespace-damaged so next time please try
sending from a real mail client which doesn't mangle whitespace and not
from the gmail web interface. Sending the patch to yourself and trying
to apply it is always a good test for that.

Thanks.
diff mbox

Patch

diff --git a/include/trace/events/ras.h b/include/trace/events/ras.h
index 88b8783..e2a17d8 100644
--- a/include/trace/events/ras.h
+++ b/include/trace/events/ras.h
@@ -5,7 +5,7 @@ 
 #define _TRACE_AER_H

 #include <linux/tracepoint.h>
-#include <linux/edac.h>
+#include <linux/aer.h>


 /*
@@ -63,10 +63,10 @@  TRACE_EVENT(aer_event,

        TP_printk("%s PCIe Bus Error: severity=%s, %s\n",
                __get_str(dev_name),
-               __entry->severity == HW_EVENT_ERR_CORRECTED ? "Corrected" :
-                       __entry->severity == HW_EVENT_ERR_FATAL ?
+               __entry->severity == AER_CORRECTABLE ? "Corrected" :
+                       __entry->severity == AER_FATAL ?
                        "Fatal" : "Uncorrected",
-               __entry->severity == HW_EVENT_ERR_CORRECTED ?
+               __entry->severity == AER_CORRECTABLE ?
                __print_flags(__entry->status, "|", aer_correctable_errors) :
                __print_flags(__entry->status, "|", aer_uncorrectable_errors))
 );