aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ppc64')
-rw-r--r--arch/ppc64/kernel/ItLpQueue.c59
-rw-r--r--arch/ppc64/kernel/iSeries_proc.c48
2 files changed, 59 insertions, 48 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
diff --git a/arch/ppc64/kernel/iSeries_proc.c b/arch/ppc64/kernel/iSeries_proc.c
index 356bd9931fcc..0fe3116eba29 100644
--- a/arch/ppc64/kernel/iSeries_proc.c
+++ b/arch/ppc64/kernel/iSeries_proc.c
@@ -40,50 +40,6 @@ static int __init iseries_proc_create(void)
40} 40}
41core_initcall(iseries_proc_create); 41core_initcall(iseries_proc_create);
42 42
43static char *event_types[9] = {
44 "Hypervisor\t\t",
45 "Machine Facilities\t",
46 "Session Manager\t",
47 "SPD I/O\t\t",
48 "Virtual Bus\t\t",
49 "PCI I/O\t\t",
50 "RIO I/O\t\t",
51 "Virtual Lan\t\t",
52 "Virtual I/O\t\t"
53};
54
55static int proc_lpevents_show(struct seq_file *m, void *v)
56{
57 unsigned int i;
58
59 seq_printf(m, "LpEventQueue 0\n");
60 seq_printf(m, " events processed:\t%lu\n",
61 (unsigned long)xItLpQueue.xLpIntCount);
62
63 for (i = 0; i < 9; ++i)
64 seq_printf(m, " %s %10lu\n", event_types[i],
65 (unsigned long)xItLpQueue.xLpIntCountByType[i]);
66
67 seq_printf(m, "\n events processed by processor:\n");
68
69 for_each_online_cpu(i)
70 seq_printf(m, " CPU%02d %10u\n", i, paca[i].lpevent_count);
71
72 return 0;
73}
74
75static int proc_lpevents_open(struct inode *inode, struct file *file)
76{
77 return single_open(file, proc_lpevents_show, NULL);
78}
79
80static struct file_operations proc_lpevents_operations = {
81 .open = proc_lpevents_open,
82 .read = seq_read,
83 .llseek = seq_lseek,
84 .release = single_release,
85};
86
87static unsigned long startTitan = 0; 43static unsigned long startTitan = 0;
88static unsigned long startTb = 0; 44static unsigned long startTb = 0;
89 45
@@ -148,10 +104,6 @@ static int __init iseries_proc_init(void)
148{ 104{
149 struct proc_dir_entry *e; 105 struct proc_dir_entry *e;
150 106
151 e = create_proc_entry("iSeries/lpevents", S_IFREG|S_IRUGO, NULL);
152 if (e)
153 e->proc_fops = &proc_lpevents_operations;
154
155 e = create_proc_entry("iSeries/titanTod", S_IFREG|S_IRUGO, NULL); 107 e = create_proc_entry("iSeries/titanTod", S_IFREG|S_IRUGO, NULL);
156 if (e) 108 if (e)
157 e->proc_fops = &proc_titantod_operations; 109 e->proc_fops = &proc_titantod_operations;