linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] RAS: Fix the trace_show() function to output trace_count
@ 2022-10-05 16:16 Tony Luck
  2022-10-05 18:17 ` Borislav Petkov
  0 siblings, 1 reply; 10+ messages in thread
From: Tony Luck @ 2022-10-05 16:16 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: x86, linux-kernel, Tony Luck

The /sys/kernel/debug/ras/daemon_active is used to indicate to some
kernel code whether there is a user mode consumer of RAS trace events
to decide whether to print to the console.

The intent was that reading daemon_active would give the same indication
to users. But the code is broken and does not display anything.

Add a seq_printf() to output the current value of the trace_count.

Fixes: d963cd95bea9 ("RAS, debugfs: Add debugfs interface for RAS subsystem")
Signed-off-by: Tony Luck <tony.luck@intel.com>
---
 drivers/ras/debugfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/ras/debugfs.c b/drivers/ras/debugfs.c
index 0d4f985afbf3..d67af5e08caf 100644
--- a/drivers/ras/debugfs.c
+++ b/drivers/ras/debugfs.c
@@ -15,7 +15,8 @@ EXPORT_SYMBOL_GPL(ras_userspace_consumers);
 
 static int trace_show(struct seq_file *m, void *v)
 {
-	return atomic_read(&trace_count);
+	seq_printf(m, "%d\n", atomic_read(&trace_count));
+	return 0;
 }
 
 static int trace_open(struct inode *inode, struct file *file)
-- 
2.37.3


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

end of thread, other threads:[~2022-10-31 18:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-05 16:16 [PATCH] RAS: Fix the trace_show() function to output trace_count Tony Luck
2022-10-05 18:17 ` Borislav Petkov
2022-10-05 19:46   ` [PATCH v2] " Tony Luck
2022-10-17 10:36     ` Borislav Petkov
2022-10-17 16:09       ` Luck, Tony
2022-10-17 19:40         ` Borislav Petkov
2022-10-18 14:36           ` Tony Luck
2022-10-18 16:05             ` Borislav Petkov
2022-10-18 16:59             ` [PATCH v3] RAS: Fix return value from show_trace() Tony Luck
2022-10-31 18:15               ` [tip: ras/core] " tip-bot2 for Tony Luck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).