From: Tony Luck <tony.luck@intel.com>
To: Borislav Petkov <bp@alien8.de>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
Tony Luck <tony.luck@intel.com>
Subject: [PATCH] RAS: Fix the trace_show() function to output trace_count
Date: Wed, 5 Oct 2022 09:16:45 -0700 [thread overview]
Message-ID: <20221005161645.309068-1-tony.luck@intel.com> (raw)
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
next reply other threads:[~2022-10-05 16:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-05 16:16 Tony Luck [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221005161645.309068-1-tony.luck@intel.com \
--to=tony.luck@intel.com \
--cc=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®