diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2005-06-30 01:08:44 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-06-30 01:08:44 -0400 |
commit | 7b01328d455b50ff040d3a06b342ca370b1d8b0a (patch) | |
tree | aef14d944207a6a3f850e0f24077d172e8415e66 /arch/ppc64 | |
parent | 512d31d6a824a961f39b418f11480f678320e4f3 (diff) |
[PATCH] ppc64: Move xItLpQueue proc code into ItLpQueue.c
Move the code that displays xItLpQueue values in /proc into
ItLpQueue.c.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/ppc64')
-rw-r--r-- | arch/ppc64/kernel/ItLpQueue.c | 59 | ||||
-rw-r--r-- | arch/ppc64/kernel/iSeries_proc.c | 48 |
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 | ||
23 | static 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 | |||
21 | static __inline__ int set_inUse(void) | 35 | static __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 | |||
226 | static 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 | |||
246 | static int proc_lpevents_open(struct inode *inode, struct file *file) | ||
247 | { | ||
248 | return single_open(file, proc_lpevents_show, NULL); | ||
249 | } | ||
250 | |||
251 | static 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 | |||
258 | static 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 | } |
41 | core_initcall(iseries_proc_create); | 41 | core_initcall(iseries_proc_create); |
42 | 42 | ||
43 | static 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 | |||
55 | static 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 | |||
75 | static int proc_lpevents_open(struct inode *inode, struct file *file) | ||
76 | { | ||
77 | return single_open(file, proc_lpevents_show, NULL); | ||
78 | } | ||
79 | |||
80 | static 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 | |||
87 | static unsigned long startTitan = 0; | 43 | static unsigned long startTitan = 0; |
88 | static unsigned long startTb = 0; | 44 | static 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; |