Linux EDAC development
 help / color / mirror / Atom feed
* [5/5] EDAC, mce_amd: Print ExtErrorCode and description on a single line
@ 2019-02-01 22:55 Yazen Ghannam
  0 siblings, 0 replies; 4+ messages in thread
From: Yazen Ghannam @ 2019-02-01 22:55 UTC (permalink / raw)
  To: linux-edac@vger.kernel.org
  Cc: Ghannam, Yazen, linux-kernel@vger.kernel.org, bp@suse.de,
	tony.luck@intel.com, x86@kernel.org

From: Yazen Ghannam <yazen.ghannam@amd.com>

Save a log line by printing the extended error code and the description
on a single line. This is similar to how errors are printed in other
subsystems, e.g. "#, description". If we don't have a valid description
then only the number/code is printed.

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
---
 drivers/edac/mce_amd.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c
index 7e29ceabdf6f..f286b880f981 100644
--- a/drivers/edac/mce_amd.c
+++ b/drivers/edac/mce_amd.c
@@ -965,13 +965,12 @@ static void decode_smca_error(struct mce *m)
 
 	ip_name = smca_get_long_name(bank_type);
 
-	pr_emerg(HW_ERR "%s Extended Error Code: %d\n", ip_name, xec);
+	pr_emerg(HW_ERR "%s Ext. Error Code: %d", ip_name, xec);
 
 	/* Only print the decode of valid error codes */
 	if (xec < smca_mce_descs[bank_type].num_descs &&
 			(hwid->xec_bitmap & BIT_ULL(xec))) {
-		pr_emerg(HW_ERR "%s Error: ", ip_name);
-		pr_cont("%s.\n", smca_mce_descs[bank_type].descs[xec]);
+		pr_cont(", %s.\n", smca_mce_descs[bank_type].descs[xec]);
 	}
 
 	if (bank_type == SMCA_UMC && xec == 0 && decode_dram_ecc)

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [5/5] EDAC, mce_amd: Print ExtErrorCode and description on a single line
@ 2019-02-03 12:21 Borislav Petkov
  0 siblings, 0 replies; 4+ messages in thread
From: Borislav Petkov @ 2019-02-03 12:21 UTC (permalink / raw)
  To: Ghannam, Yazen
  Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org,
	bp@suse.de, tony.luck@intel.com, x86@kernel.org

On Fri, Feb 01, 2019 at 10:55:54PM +0000, Ghannam, Yazen wrote:
> From: Yazen Ghannam <yazen.ghannam@amd.com>
> 
> Save a log line by printing the extended error code and the description
> on a single line. This is similar to how errors are printed in other
> subsystems, e.g. "#, description". If we don't have a valid description
> then only the number/code is printed.
> 
> Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
> ---
>  drivers/edac/mce_amd.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c
> index 7e29ceabdf6f..f286b880f981 100644
> --- a/drivers/edac/mce_amd.c
> +++ b/drivers/edac/mce_amd.c
> @@ -965,13 +965,12 @@ static void decode_smca_error(struct mce *m)
>  
>  	ip_name = smca_get_long_name(bank_type);
>  
> -	pr_emerg(HW_ERR "%s Extended Error Code: %d\n", ip_name, xec);
> +	pr_emerg(HW_ERR "%s Ext. Error Code: %d", ip_name, xec);
>  
>  	/* Only print the decode of valid error codes */
>  	if (xec < smca_mce_descs[bank_type].num_descs &&
>  			(hwid->xec_bitmap & BIT_ULL(xec))) {
> -		pr_emerg(HW_ERR "%s Error: ", ip_name);
> -		pr_cont("%s.\n", smca_mce_descs[bank_type].descs[xec]);
> +		pr_cont(", %s.\n", smca_mce_descs[bank_type].descs[xec]);

If the if-condition doesn't hit, we never print the \n

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [5/5] EDAC, mce_amd: Print ExtErrorCode and description on a single line
@ 2019-02-04 15:14 Yazen Ghannam
  0 siblings, 0 replies; 4+ messages in thread
From: Yazen Ghannam @ 2019-02-04 15:14 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org,
	bp@suse.de, tony.luck@intel.com, x86@kernel.org

> -----Original Message-----
> From: Borislav Petkov <bp@alien8.de>
> Sent: Sunday, February 3, 2019 6:22 AM
> To: Ghannam, Yazen <Yazen.Ghannam@amd.com>
> Cc: linux-edac@vger.kernel.org; linux-kernel@vger.kernel.org; bp@suse.de;
> tony.luck@intel.com; x86@kernel.org
> Subject: Re: [PATCH 5/5] EDAC, mce_amd: Print ExtErrorCode and description
> on a single line
> 
> On Fri, Feb 01, 2019 at 10:55:54PM +0000, Ghannam, Yazen wrote:
> > From: Yazen Ghannam <yazen.ghannam@amd.com>
> >
> > Save a log line by printing the extended error code and the description
> > on a single line. This is similar to how errors are printed in other
> > subsystems, e.g. "#, description". If we don't have a valid description
> > then only the number/code is printed.
> >
> > Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
> > ---
> >  drivers/edac/mce_amd.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c
> > index 7e29ceabdf6f..f286b880f981 100644
> > --- a/drivers/edac/mce_amd.c
> > +++ b/drivers/edac/mce_amd.c
> > @@ -965,13 +965,12 @@ static void decode_smca_error(struct mce *m)
> >
> >  	ip_name = smca_get_long_name(bank_type);
> >
> > -	pr_emerg(HW_ERR "%s Extended Error Code: %d\n", ip_name, xec);
> > +	pr_emerg(HW_ERR "%s Ext. Error Code: %d", ip_name, xec);
> >
> >  	/* Only print the decode of valid error codes */
> >  	if (xec < smca_mce_descs[bank_type].num_descs &&
> >  			(hwid->xec_bitmap & BIT_ULL(xec))) {
> > -		pr_emerg(HW_ERR "%s Error: ", ip_name);
> > -		pr_cont("%s.\n", smca_mce_descs[bank_type].descs[xec]);
> > +		pr_cont(", %s.\n", smca_mce_descs[bank_type].descs[xec]);
> 
> If the if-condition doesn't hit, we never print the \n
> 

Yes, you're right. But it seems that the next pr_* that's not a pr_cont will be on
a newline automatically.

Should I add an explicit newline just to be sure we get one?

Thanks,
Yazen

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [5/5] EDAC, mce_amd: Print ExtErrorCode and description on a single line
@ 2019-02-04 16:36 Borislav Petkov
  0 siblings, 0 replies; 4+ messages in thread
From: Borislav Petkov @ 2019-02-04 16:36 UTC (permalink / raw)
  To: Ghannam, Yazen
  Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org,
	tony.luck@intel.com, x86@kernel.org

On Mon, Feb 04, 2019 at 03:14:27PM +0000, Ghannam, Yazen wrote:
> Yes, you're right. But it seems that the next pr_* that's not a pr_cont will be on
> a newline automatically.

Ah, that must be that printk continuation fun around

  4bcc595ccd80 ("printk: reinstate KERN_CONT for printing continuation lines")

> Should I add an explicit newline just to be sure we get one?

Nah, no need. If anything, we should strive to get rid of KERN_CONT, if
possible.

Thx.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-04 16:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-04 16:36 [5/5] EDAC, mce_amd: Print ExtErrorCode and description on a single line Borislav Petkov
  -- strict thread matches above, loose matches on Subject: below --
2019-02-04 15:14 Yazen Ghannam
2019-02-03 12:21 Borislav Petkov
2019-02-01 22:55 Yazen Ghannam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox