aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/smtc-proc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-01 20:51:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-01 20:51:54 -0400
commit20b4fb485227404329e41ad15588afad3df23050 (patch)
treef3e099f0ab3da8a93b447203e294d2bb22f6dc05 /arch/mips/kernel/smtc-proc.c
parentb9394d8a657cd3c064fa432aa0905c1b58b38fe9 (diff)
parentac3e3c5b1164397656df81b9e9ab4991184d3236 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull VFS updates from Al Viro, Misc cleanups all over the place, mainly wrt /proc interfaces (switch create_proc_entry to proc_create(), get rid of the deprecated create_proc_read_entry() in favor of using proc_create_data() and seq_file etc). 7kloc removed. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (204 commits) don't bother with deferred freeing of fdtables proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.h proc: Make the PROC_I() and PDE() macros internal to procfs proc: Supply a function to remove a proc entry by PDE take cgroup_open() and cpuset_open() to fs/proc/base.c ppc: Clean up scanlog ppc: Clean up rtas_flash driver somewhat hostap: proc: Use remove_proc_subtree() drm: proc: Use remove_proc_subtree() drm: proc: Use minor->index to label things, not PDE->name drm: Constify drm_proc_list[] zoran: Don't print proc_dir_entry data in debug reiserfs: Don't access the proc_dir_entry in r_open(), r_start() r_show() proc: Supply an accessor for getting the data from a PDE's parent airo: Use remove_proc_subtree() rtl8192u: Don't need to save device proc dir PDE rtl8187se: Use a dir under /proc/net/r8180/ proc: Add proc_mkdir_data() proc: Move some bits from linux/proc_fs.h to linux/{of.h,signal.h,tty.h} proc: Move PDE_NET() to fs/proc/proc_net.c ...
Diffstat (limited to 'arch/mips/kernel/smtc-proc.c')
-rw-r--r--arch/mips/kernel/smtc-proc.c64
1 files changed, 26 insertions, 38 deletions
diff --git a/arch/mips/kernel/smtc-proc.c b/arch/mips/kernel/smtc-proc.c
index aee7c8177b5d..9fb714450e95 100644
--- a/arch/mips/kernel/smtc-proc.c
+++ b/arch/mips/kernel/smtc-proc.c
@@ -16,6 +16,7 @@
16#include <asm/mipsregs.h> 16#include <asm/mipsregs.h>
17#include <asm/cacheflush.h> 17#include <asm/cacheflush.h>
18#include <linux/proc_fs.h> 18#include <linux/proc_fs.h>
19#include <linux/seq_file.h>
19 20
20#include <asm/smtc_proc.h> 21#include <asm/smtc_proc.h>
21 22
@@ -30,51 +31,39 @@ unsigned long selfipis[NR_CPUS];
30 31
31struct smtc_cpu_proc smtc_cpu_stats[NR_CPUS]; 32struct smtc_cpu_proc smtc_cpu_stats[NR_CPUS];
32 33
33static struct proc_dir_entry *smtc_stats;
34
35atomic_t smtc_fpu_recoveries; 34atomic_t smtc_fpu_recoveries;
36 35
37static int proc_read_smtc(char *page, char **start, off_t off, 36static int smtc_proc_show(struct seq_file *m, void *v)
38 int count, int *eof, void *data)
39{ 37{
40 int totalen = 0;
41 int len;
42 int i; 38 int i;
43 extern unsigned long ebase; 39 extern unsigned long ebase;
44 40
45 len = sprintf(page, "SMTC Status Word: 0x%08x\n", smtc_status); 41 seq_printf(m, "SMTC Status Word: 0x%08x\n", smtc_status);
46 totalen += len; 42 seq_printf(m, "Config7: 0x%08x\n", read_c0_config7());
47 page += len; 43 seq_printf(m, "EBASE: 0x%08lx\n", ebase);
48 len = sprintf(page, "Config7: 0x%08x\n", read_c0_config7()); 44 seq_printf(m, "Counter Interrupts taken per CPU (TC)\n");
49 totalen += len; 45 for (i=0; i < NR_CPUS; i++)
50 page += len; 46 seq_printf(m, "%d: %ld\n", i, smtc_cpu_stats[i].timerints);
51 len = sprintf(page, "EBASE: 0x%08lx\n", ebase); 47 seq_printf(m, "Self-IPIs by CPU:\n");
52 totalen += len; 48 for(i = 0; i < NR_CPUS; i++)
53 page += len; 49 seq_printf(m, "%d: %ld\n", i, smtc_cpu_stats[i].selfipis);
54 len = sprintf(page, "Counter Interrupts taken per CPU (TC)\n"); 50 seq_printf(m, "%d Recoveries of \"stolen\" FPU\n",
55 totalen += len; 51 atomic_read(&smtc_fpu_recoveries));
56 page += len; 52 return 0;
57 for (i=0; i < NR_CPUS; i++) { 53}
58 len = sprintf(page, "%d: %ld\n", i, smtc_cpu_stats[i].timerints);
59 totalen += len;
60 page += len;
61 }
62 len = sprintf(page, "Self-IPIs by CPU:\n");
63 totalen += len;
64 page += len;
65 for(i = 0; i < NR_CPUS; i++) {
66 len = sprintf(page, "%d: %ld\n", i, smtc_cpu_stats[i].selfipis);
67 totalen += len;
68 page += len;
69 }
70 len = sprintf(page, "%d Recoveries of \"stolen\" FPU\n",
71 atomic_read(&smtc_fpu_recoveries));
72 totalen += len;
73 page += len;
74 54
75 return totalen; 55static int smtc_proc_open(struct inode *inode, struct file *file)
56{
57 return single_open(file, smtc_proc_show, NULL);
76} 58}
77 59
60static const struct file_operations smtc_proc_fops = {
61 .open = smtc_proc_open,
62 .read = seq_read,
63 .llseek = seq_lseek,
64 .release = seq_release,
65};
66
78void init_smtc_stats(void) 67void init_smtc_stats(void)
79{ 68{
80 int i; 69 int i;
@@ -86,6 +75,5 @@ void init_smtc_stats(void)
86 75
87 atomic_set(&smtc_fpu_recoveries, 0); 76 atomic_set(&smtc_fpu_recoveries, 0);
88 77
89 smtc_stats = create_proc_read_entry("smtc", 0444, NULL, 78 proc_create("smtc", 0444, NULL, &smtc_proc_fops);
90 proc_read_smtc, NULL);
91} 79}