Re: [PATCH 0/7] EDAC, mce_amd: Issue decoded MCE through the tracepoint

mark gross
2017-08-30T21:47:22Z

On Wed, Aug 30, 2017 at 01:48:43PM +0200, Borislav Petkov wrote:
> Btw,
>
> how about communicating stuff to the userspace daemon like this?
>
> This'll simplify a lot of detection in userspace.
>
> Thoughts?
>
> ---
> diff --git a/drivers/ras/debugfs.c b/drivers/ras/debugfs.c
> index 501603057dff..62d3da9d256f 100644
> --- a/drivers/ras/debugfs.c
> +++ b/drivers/ras/debugfs.c
> @@ -1,5 +1,7 @@
> #include <linux/debugfs.h>
>
> +#include "../../arch/x86/kernel/cpu/mcheck/mce-internal.h"
FWIW I this looks fishy in arch independent code.
I assume this include is for the definition of the mca_cfg global used in the
printf below.

> +
> struct dentry *ras_debugfs_dir;
>
> static atomic_t trace_count = ATOMIC_INIT(0);
> @@ -12,7 +14,9 @@ EXPORT_SYMBOL_GPL(ras_userspace_consumers);
>
> static int trace_show(struct seq_file *m, void *v)
> {
> - return atomic_read(&trace_count);
> + seq_printf(m, "readers:%d\n", atomic_read(&trace_count));
> + seq_printf(m, "has decoder:%d\n", mca_cfg.has_decoder);

do you want to worry about this debugfs interfaces as ABI?
debugfs changes have bitten me on one specific OS in irritating ways.

I'm not sure what the word is for debugfs interfaces as ABI these days so this
feedback may be not so useful.

--mark

> + return 0;
> }
>
> static int trace_open(struct inode *inode, struct file *file)
>
> --
> Regards/Gruss,
> Boris.
>
> Good mailing practices for 400: avoid top-posting and trim the reply.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-edac" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html