aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Huschle <huschle@linux.ibm.com>2024-08-12 13:39:30 +0200
committerVasily Gorbik <gor@linux.ibm.com>2024-08-29 22:56:35 +0200
commit307b675cf0193f37fbc50ff9de5322dc1361aa6b (patch)
tree6ca0b34fd6932794cac5f57c957ccde2a18ab77e
parent42419bcdfdcb287918e53500a04aeb532b41ed1f (diff)
s390/wti: Add debugfs file to display missed grace periods per cpu
Introduce a new debug file which allows to determine how many warning track grace periods were missed on each CPU. The new file can be found as /sys/kernel/debug/s390/wti It is formatted as: CPU0 CPU1 [...] CPUx xyz xyz [...] xyz Acked-by: Heiko Carstens <hca@linux.ibm.com> Reviewed-by: Mete Durlu <meted@linux.ibm.com> Signed-off-by: Tobias Huschle <huschle@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
-rw-r--r--arch/s390/kernel/wti.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/s390/kernel/wti.c b/arch/s390/kernel/wti.c
index da8bbffbed9d..949fdbf0e8b6 100644
--- a/arch/s390/kernel/wti.c
+++ b/arch/s390/kernel/wti.c
@@ -5,6 +5,8 @@
* Copyright IBM Corp. 2023
*/
+#include <linux/cpu.h>
+#include <linux/debugfs.h>
#include <linux/kallsyms.h>
#include <linux/smpboot.h>
#include <linux/irq.h>
@@ -117,6 +119,26 @@ static void wti_dbf_grace_period(struct wti_state *st)
wdi->missed++;
}
+static int wti_show(struct seq_file *seq, void *v)
+{
+ struct wti_state *st;
+ int cpu;
+
+ cpus_read_lock();
+ seq_puts(seq, " ");
+ for_each_online_cpu(cpu)
+ seq_printf(seq, "CPU%-8d", cpu);
+ seq_putc(seq, '\n');
+ for_each_online_cpu(cpu) {
+ st = per_cpu_ptr(&wti_state, cpu);
+ seq_printf(seq, " %10lu", st->dbg.missed);
+ }
+ seq_putc(seq, '\n');
+ cpus_read_unlock();
+ return 0;
+}
+DEFINE_SHOW_ATTRIBUTE(wti);
+
static void wti_thread_fn(unsigned int cpu)
{
struct wti_state *st = per_cpu_ptr(&wti_state, cpu);
@@ -143,6 +165,7 @@ static struct smp_hotplug_thread wti_threads = {
static int __init wti_init(void)
{
struct sched_param wti_sched_param = { .sched_priority = MAX_RT_PRIO - 1 };
+ struct dentry *wti_dir;
struct wti_state *st;
int cpu, rc;
@@ -168,6 +191,8 @@ static int __init wti_init(void)
rc = -EOPNOTSUPP;
goto out_subclass;
}
+ wti_dir = debugfs_create_dir("wti", arch_debugfs_dir);
+ debugfs_create_file("stat", 0400, wti_dir, NULL, &wti_fops);
wti_dbg = debug_register("wti", 1, 1, WTI_DBF_LEN);
if (!wti_dbg) {
rc = -ENOMEM;