diff options
author | Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> | 2015-06-30 05:06:03 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-07-04 04:04:31 -0400 |
commit | 5968cecedd7a09f23e9fcb5f9fb4e893712f35ba (patch) | |
tree | ecc681414550f43744fcf78640979e948c78380d /fs/proc | |
parent | f6db8347993256b58bd4746b0c4c5b935c32210d (diff) |
sched/stat: Expose /proc/pid/schedstat if CONFIG_SCHED_INFO=y
Expand /proc/pid/schedstat output:
- enable it on CONFIG_TASK_DELAY_ACCT=y && !CONFIG_SCHEDSTATS kernels.
- dump all zeroes on kernels that are booted with the 'nodelayacct'
option, which boot option disables delay accounting on
CONFIG_TASK_DELAY_ACCT=y kernels.
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Balbir Singh <bsingharora@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: a.p.zijlstra@chello.nl
Cc: ricklind@us.ibm.com
Link: http://lkml.kernel.org/r/5ccbef17d4bc841084ea6e6421d4e4a23b7b806f.1435654789.git.naveen.n.rao@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/proc')
-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 |