Re: [PATCH] ghes: Track number of recovered hardware errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 14, 2025 at 09:57:29AM -0700, Breno Leitao wrote:
> diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
> index f0584ccad4519..3735cfba17667 100644
> --- a/drivers/acpi/apei/ghes.c
> +++ b/drivers/acpi/apei/ghes.c
> @@ -118,6 +118,12 @@ static inline bool is_hest_sync_notify(struct ghes *ghes)
>  	return notify_type == ACPI_HEST_NOTIFY_SEA;
>  }
>  
> +/* Count the number of hardware recovered errors, to be reported at
> + * crash/vmcore
> + */

Kernel comments style format is:

	/*
	 * A sentence ending with a full-stop.
	 * Another sentence. ...
	 * More sentences. ...
	 */

> +unsigned int ghes_recovered_erors;
> +EXPORT_SYMBOL_GPL(ghes_recovered_erors);

If you're going to do this, then you can perhaps make this variable always
present so that you don't need an export and call it "hardware_errors_count"
or so and all machinery which deals with RAS - GHES, MCE, AER, bla, can
increment it...

> @@ -223,6 +224,9 @@ static int __init crash_save_vmcoreinfo_init(void)
>  	VMCOREINFO_SYMBOL(kallsyms_offsets);
>  	VMCOREINFO_SYMBOL(kallsyms_relative_base);
>  #endif /* CONFIG_KALLSYMS */
> +#ifdef CONFIG_ACPI_APEI_GHES
> +	VMCOREINFO_NUMBER(ghes_recovered_erors);
> +#endif

... and then you can add it to the vmcore image unconditionally as a metric
telling that the machine has had so and so hw errors.

I'd say.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux