diff options
| -rw-r--r-- | fs/proc/base.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 286a422f440e..ad63fa3306df 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
| @@ -304,14 +304,17 @@ static int proc_pid_stack(struct seq_file *m, struct pid_namespace *ns, | |||
| 304 | } | 304 | } |
| 305 | #endif | 305 | #endif |
| 306 | 306 | ||
| 307 | #ifdef CONFIG_SCHEDSTATS | 307 | #ifdef CONFIG_SCHED_INFO |
| 308 | /* | 308 | /* |
| 309 | * Provides /proc/PID/schedstat | 309 | * Provides /proc/PID/schedstat |
| 310 | */ | 310 | */ |
| 311 | static int proc_pid_schedstat(struct seq_file *m, struct pid_namespace *ns, | 311 | static int proc_pid_schedstat(struct seq_file *m, struct pid_namespace *ns, |
| 312 | struct pid *pid, struct task_struct *task) | 312 | struct pid *pid, struct task_struct *task) |
| 313 | { | 313 | { |
| 314 | seq_printf(m, "%llu %llu %lu\n", | 314 | if (unlikely(!sched_info_on())) |
| 315 | seq_printf(m, "0 0 0\n"); | ||
| 316 | else | ||
| 317 | seq_printf(m, "%llu %llu %lu\n", | ||
| 315 | (unsigned long long)task->se.sum_exec_runtime, | 318 | (unsigned long long)task->se.sum_exec_runtime, |
| 316 | (unsigned long long)task->sched_info.run_delay, | 319 | (unsigned long long)task->sched_info.run_delay, |
| 317 | task->sched_info.pcount); | 320 | task->sched_info.pcount); |
| @@ -2600,7 +2603,7 @@ static const struct pid_entry tgid_base_stuff[] = { | |||
| 2600 | #ifdef CONFIG_STACKTRACE | 2603 | #ifdef CONFIG_STACKTRACE |
| 2601 | ONE("stack", S_IRUSR, proc_pid_stack), | 2604 | ONE("stack", S_IRUSR, proc_pid_stack), |
| 2602 | #endif | 2605 | #endif |
| 2603 | #ifdef CONFIG_SCHEDSTATS | 2606 | #ifdef CONFIG_SCHED_INFO |
| 2604 | ONE("schedstat", S_IRUGO, proc_pid_schedstat), | 2607 | ONE("schedstat", S_IRUGO, proc_pid_schedstat), |
| 2605 | #endif | 2608 | #endif |
| 2606 | #ifdef CONFIG_LATENCYTOP | 2609 | #ifdef CONFIG_LATENCYTOP |
| @@ -2948,7 +2951,7 @@ static const struct pid_entry tid_base_stuff[] = { | |||
| 2948 | #ifdef CONFIG_STACKTRACE | 2951 | #ifdef CONFIG_STACKTRACE |
| 2949 | ONE("stack", S_IRUSR, proc_pid_stack), | 2952 | ONE("stack", S_IRUSR, proc_pid_stack), |
| 2950 | #endif | 2953 | #endif |
| 2951 | #ifdef CONFIG_SCHEDSTATS | 2954 | #ifdef CONFIG_SCHED_INFO |
| 2952 | ONE("schedstat", S_IRUGO, proc_pid_schedstat), | 2955 | ONE("schedstat", S_IRUGO, proc_pid_schedstat), |
| 2953 | #endif | 2956 | #endif |
| 2954 | #ifdef CONFIG_LATENCYTOP | 2957 | #ifdef CONFIG_LATENCYTOP |
