Re: [PATCH v2] RAS: Fix the trace_show() function to output trace_count

From: Borislav Petkov
Date: Mon Oct 17 2022 - 06:36:32 EST


On Wed, Oct 05, 2022 at 12:46:44PM -0700, Tony Luck wrote:
> static int trace_show(struct seq_file *m, void *v)
> {
> - return atomic_read(&trace_count);
> + seq_printf(m, "%d\n", atomic_read(&trace_count));

Still misleading:

$ cat /sys/kernel/debug/ras/daemon_active
1

and it is 1 and not 0 because:

[ 13.177644] trace_open: trace_count: 1, comm: cat
[ 13.178675] trace_release: trace_count: 0, comm: cat

we toggle trace_count when we read it.

I don't know, maybe we should teach RAS daemons to ->write() into that
file their name and PID so that the trace_count counts *only* the RAS
daemons not any reader...

--
Regards/Gruss,
Boris.

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