aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/proc/proc_misc.c3
-rw-r--r--include/linux/sched.h4
-rw-r--r--kernel/sched.c1
-rw-r--r--kernel/sched_stats.h9
4 files changed, 9 insertions, 8 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index f6d25db98922..4a768ed5da2e 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -195,9 +195,6 @@ void __init proc_misc_init(void)
195 proc_symlink("mounts", NULL, "self/mounts"); 195 proc_symlink("mounts", NULL, "self/mounts");
196 196
197 /* And now for trickier ones */ 197 /* And now for trickier ones */
198#ifdef CONFIG_SCHEDSTATS
199 proc_create("schedstat", 0, NULL, &proc_schedstat_operations);
200#endif
201#ifdef CONFIG_PROC_KCORE 198#ifdef CONFIG_PROC_KCORE
202 proc_root_kcore = proc_create("kcore", S_IRUSR, NULL, &proc_kcore_operations); 199 proc_root_kcore = proc_create("kcore", S_IRUSR, NULL, &proc_kcore_operations);
203 if (proc_root_kcore) 200 if (proc_root_kcore)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 5c38db536e07..7f60cb9b53cb 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -681,10 +681,6 @@ struct sched_info {
681}; 681};
682#endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */ 682#endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */
683 683
684#ifdef CONFIG_SCHEDSTATS
685extern const struct file_operations proc_schedstat_operations;
686#endif /* CONFIG_SCHEDSTATS */
687
688#ifdef CONFIG_TASK_DELAY_ACCT 684#ifdef CONFIG_TASK_DELAY_ACCT
689struct task_delay_info { 685struct task_delay_info {
690 spinlock_t lock; 686 spinlock_t lock;
diff --git a/kernel/sched.c b/kernel/sched.c
index d906f72b42d2..5a70189d5051 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -55,6 +55,7 @@
55#include <linux/cpuset.h> 55#include <linux/cpuset.h>
56#include <linux/percpu.h> 56#include <linux/percpu.h>
57#include <linux/kthread.h> 57#include <linux/kthread.h>
58#include <linux/proc_fs.h>
58#include <linux/seq_file.h> 59#include <linux/seq_file.h>
59#include <linux/sysctl.h> 60#include <linux/sysctl.h>
60#include <linux/syscalls.h> 61#include <linux/syscalls.h>
diff --git a/kernel/sched_stats.h b/kernel/sched_stats.h
index b8c156979cf2..3d14ce273902 100644
--- a/kernel/sched_stats.h
+++ b/kernel/sched_stats.h
@@ -90,13 +90,20 @@ static int schedstat_open(struct inode *inode, struct file *file)
90 return res; 90 return res;
91} 91}
92 92
93const struct file_operations proc_schedstat_operations = { 93static const struct file_operations proc_schedstat_operations = {
94 .open = schedstat_open, 94 .open = schedstat_open,
95 .read = seq_read, 95 .read = seq_read,
96 .llseek = seq_lseek, 96 .llseek = seq_lseek,
97 .release = single_release, 97 .release = single_release,
98}; 98};
99 99
100static int __init proc_schedstat_init(void)
101{
102 proc_create("schedstat", 0, NULL, &proc_schedstat_operations);
103 return 0;
104}
105module_init(proc_schedstat_init);
106
100/* 107/*
101 * Expects runqueue lock to be held for atomicity of update 108 * Expects runqueue lock to be held for atomicity of update
102 */ 109 */