aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64/kernel/ItLpQueue.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ppc64/kernel/ItLpQueue.c')
-rw-r--r--arch/ppc64/kernel/ItLpQueue.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/arch/ppc64/kernel/ItLpQueue.c b/arch/ppc64/kernel/ItLpQueue.c
index 091aaed4842c..11cd31dfcef8 100644
--- a/arch/ppc64/kernel/ItLpQueue.c
+++ b/arch/ppc64/kernel/ItLpQueue.c
@@ -12,12 +12,26 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/bootmem.h> 14#include <linux/bootmem.h>
15#include <linux/seq_file.h>
16#include <linux/proc_fs.h>
15#include <asm/system.h> 17#include <asm/system.h>
16#include <asm/paca.h> 18#include <asm/paca.h>
17#include <asm/iSeries/ItLpQueue.h> 19#include <asm/iSeries/ItLpQueue.h>
18#include <asm/iSeries/HvLpEvent.h> 20#include <asm/iSeries/HvLpEvent.h>
19#include <asm/iSeries/HvCallEvent.h> 21#include <asm/iSeries/HvCallEvent.h>
20 22
23static char *event_types[9] = {
24 "Hypervisor\t\t",
25 "Machine Facilities\t",
26 "Session Manager\t",
27 "SPD I/O\t\t",
28 "Virtual Bus\t\t",
29 "PCI I/O\t\t",
30 "RIO I/O\t\t",
31 "Virtual Lan\t\t",
32 "Virtual I/O\t\t"
33};
34
21static __inline__ int set_inUse(void) 35static __inline__ int set_inUse(void)
22{ 36{
23 int t; 37 int t;
@@ -208,3 +222,48 @@ void setup_hvlpevent_queue(void)
208 (LpEventStackSize - LpEventMaxSize); 222 (LpEventStackSize - LpEventMaxSize);
209 xItLpQueue.xIndex = 0; 223 xItLpQueue.xIndex = 0;
210} 224}
225
226static int proc_lpevents_show(struct seq_file *m, void *v)
227{
228 unsigned int i;
229
230 seq_printf(m, "LpEventQueue 0\n");
231 seq_printf(m, " events processed:\t%lu\n",
232 (unsigned long)xItLpQueue.xLpIntCount);
233
234 for (i = 0; i < 9; ++i)
235 seq_printf(m, " %s %10lu\n", event_types[i],
236 (unsigned long)xItLpQueue.xLpIntCountByType[i]);
237
238 seq_printf(m, "\n events processed by processor:\n");
239
240 for_each_online_cpu(i)
241 seq_printf(m, " CPU%02d %10u\n", i, paca[i].lpevent_count);
242
243 return 0;
244}
245
246static int proc_lpevents_open(struct inode *inode, struct file *file)
247{
248 return single_open(file, proc_lpevents_show, NULL);
249}
250
251static struct file_operations proc_lpevents_operations = {
252 .open = proc_lpevents_open,
253 .read = seq_read,
254 .llseek = seq_lseek,
255 .release = single_release,
256};
257
258static int __init proc_lpevents_init(void)
259{
260 struct proc_dir_entry *e;
261
262 e = create_proc_entry("iSeries/lpevents", S_IFREG|S_IRUGO, NULL);
263 if (e)
264 e->proc_fops = &proc_lpevents_operations;
265
266 return 0;
267}
268__initcall(proc_lpevents_init);
269