Re: [PATCH 6/7] EDAC, mce_amd: Issue the decoded info through the TP or printk()
From: Steven Rostedt
Date: Fri Aug 25 2017 - 09:33:11 EST
On Fri, 25 Aug 2017 12:24:10 +0200
Borislav Petkov <bp@xxxxxxxxx> wrote:
> From: Borislav Petkov <bp@xxxxxxx>
>
> ... depending on whether we have userspace consumers. Handle the HW_ERR
> prefix accordingly - for printk() I need to do some strsep() monkey
> business.
>
> Signed-off-by: Borislav Petkov <bp@xxxxxxx>
> ---
> drivers/edac/mce_amd.c | 106 +++++++++++++++++++++++++++++++------------------
> 1 file changed, 68 insertions(+), 38 deletions(-)
>
> diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c
> index b7c1f8f7e871..41c09d5b81f0 100644
> --- a/drivers/edac/mce_amd.c
> +++ b/drivers/edac/mce_amd.c
> @@ -2,9 +2,12 @@
> #include <linux/seq_buf.h>
> #include <linux/module.h>
> #include <linux/slab.h>
> +#include <linux/ras.h>
>
> #include <asm/cpu.h>
>
> +#include <trace/events/mce.h>
> +
> #include "mce_amd.h"
>
> static struct amd_decoder_ops *fam_ops;
> @@ -465,7 +468,7 @@ static void decode_mc0_mce(struct mce *m)
> u16 ec = EC(m->status);
> u8 xec = XEC(m->status, xec_mask);
>
> - seq_buf_printf(&sb, HW_ERR "MC0 Error: ");
> + seq_buf_printf(&sb, "MC0 Error: ");
Use seq_buf_puts() in this patch too.
-- Steve
>
> /* TLB error signatures are the same across families */
> if (TLB_ERROR(ec)) {