Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Tobias Huschle and committed by
Vasily Gorbik
307b675c 42419bcd

+25
+25
arch/s390/kernel/wti.c
··· 5 5 * Copyright IBM Corp. 2023 6 6 */ 7 7 8 + #include <linux/cpu.h> 9 + #include <linux/debugfs.h> 8 10 #include <linux/kallsyms.h> 9 11 #include <linux/smpboot.h> 10 12 #include <linux/irq.h> ··· 119 117 wdi->missed++; 120 118 } 121 119 120 + static int wti_show(struct seq_file *seq, void *v) 121 + { 122 + struct wti_state *st; 123 + int cpu; 124 + 125 + cpus_read_lock(); 126 + seq_puts(seq, " "); 127 + for_each_online_cpu(cpu) 128 + seq_printf(seq, "CPU%-8d", cpu); 129 + seq_putc(seq, '\n'); 130 + for_each_online_cpu(cpu) { 131 + st = per_cpu_ptr(&wti_state, cpu); 132 + seq_printf(seq, " %10lu", st->dbg.missed); 133 + } 134 + seq_putc(seq, '\n'); 135 + cpus_read_unlock(); 136 + return 0; 137 + } 138 + DEFINE_SHOW_ATTRIBUTE(wti); 139 + 122 140 static void wti_thread_fn(unsigned int cpu) 123 141 { 124 142 struct wti_state *st = per_cpu_ptr(&wti_state, cpu); ··· 165 143 static int __init wti_init(void) 166 144 { 167 145 struct sched_param wti_sched_param = { .sched_priority = MAX_RT_PRIO - 1 }; 146 + struct dentry *wti_dir; 168 147 struct wti_state *st; 169 148 int cpu, rc; 170 149 ··· 191 168 rc = -EOPNOTSUPP; 192 169 goto out_subclass; 193 170 } 171 + wti_dir = debugfs_create_dir("wti", arch_debugfs_dir); 172 + debugfs_create_file("stat", 0400, wti_dir, NULL, &wti_fops); 194 173 wti_dbg = debug_register("wti", 1, 1, WTI_DBF_LEN); 195 174 if (!wti_dbg) { 196 175 rc = -ENOMEM;