diff options
| author | James Morris <jmorris@namei.org> | 2011-03-07 18:55:06 -0500 |
|---|---|---|
| committer | James Morris <jmorris@namei.org> | 2011-03-07 18:55:06 -0500 |
| commit | 1cc26bada9f6807814806db2f0d78792eecdac71 (patch) | |
| tree | 5509b5139db04af6c13db0a580c84116a4a54039 /kernel/sched_debug.c | |
| parent | eae61f3c829439f8f9121b5cd48a14be04df451f (diff) | |
| parent | 214d93b02c4fe93638ad268613c9702a81ed9192 (diff) | |
Merge branch 'master'; commit 'v2.6.38-rc7' into next
Diffstat (limited to 'kernel/sched_debug.c')
| -rw-r--r-- | kernel/sched_debug.c | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c index 1dfae3d014b..eb6cb8edd07 100644 --- a/kernel/sched_debug.c +++ b/kernel/sched_debug.c | |||
| @@ -16,6 +16,8 @@ | |||
| 16 | #include <linux/kallsyms.h> | 16 | #include <linux/kallsyms.h> |
| 17 | #include <linux/utsname.h> | 17 | #include <linux/utsname.h> |
| 18 | 18 | ||
| 19 | static DEFINE_SPINLOCK(sched_debug_lock); | ||
| 20 | |||
| 19 | /* | 21 | /* |
| 20 | * This allows printing both to /proc/sched_debug and | 22 | * This allows printing both to /proc/sched_debug and |
| 21 | * to the console | 23 | * to the console |
| @@ -86,6 +88,26 @@ static void print_cfs_group_stats(struct seq_file *m, int cpu, struct task_group | |||
| 86 | } | 88 | } |
| 87 | #endif | 89 | #endif |
| 88 | 90 | ||
| 91 | #ifdef CONFIG_CGROUP_SCHED | ||
| 92 | static char group_path[PATH_MAX]; | ||
| 93 | |||
| 94 | static char *task_group_path(struct task_group *tg) | ||
| 95 | { | ||
| 96 | if (autogroup_path(tg, group_path, PATH_MAX)) | ||
| 97 | return group_path; | ||
| 98 | |||
| 99 | /* | ||
| 100 | * May be NULL if the underlying cgroup isn't fully-created yet | ||
| 101 | */ | ||
| 102 | if (!tg->css.cgroup) { | ||
| 103 | group_path[0] = '\0'; | ||
| 104 | return group_path; | ||
| 105 | } | ||
| 106 | cgroup_path(tg->css.cgroup, group_path, PATH_MAX); | ||
| 107 | return group_path; | ||
| 108 | } | ||
| 109 | #endif | ||
| 110 | |||
| 89 | static void | 111 | static void |
| 90 | print_task(struct seq_file *m, struct rq *rq, struct task_struct *p) | 112 | print_task(struct seq_file *m, struct rq *rq, struct task_struct *p) |
| 91 | { | 113 | { |
| @@ -108,6 +130,9 @@ print_task(struct seq_file *m, struct rq *rq, struct task_struct *p) | |||
| 108 | SEQ_printf(m, "%15Ld %15Ld %15Ld.%06ld %15Ld.%06ld %15Ld.%06ld", | 130 | SEQ_printf(m, "%15Ld %15Ld %15Ld.%06ld %15Ld.%06ld %15Ld.%06ld", |
| 109 | 0LL, 0LL, 0LL, 0L, 0LL, 0L, 0LL, 0L); | 131 | 0LL, 0LL, 0LL, 0L, 0LL, 0L, 0LL, 0L); |
| 110 | #endif | 132 | #endif |
| 133 | #ifdef CONFIG_CGROUP_SCHED | ||
| 134 | SEQ_printf(m, " %s", task_group_path(task_group(p))); | ||
| 135 | #endif | ||
| 111 | 136 | ||
| 112 | SEQ_printf(m, "\n"); | 137 | SEQ_printf(m, "\n"); |
| 113 | } | 138 | } |
| @@ -144,7 +169,11 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) | |||
| 144 | struct sched_entity *last; | 169 | struct sched_entity *last; |
| 145 | unsigned long flags; | 170 | unsigned long flags; |
| 146 | 171 | ||
| 172 | #ifdef CONFIG_FAIR_GROUP_SCHED | ||
| 173 | SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, task_group_path(cfs_rq->tg)); | ||
| 174 | #else | ||
| 147 | SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu); | 175 | SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu); |
| 176 | #endif | ||
| 148 | SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "exec_clock", | 177 | SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "exec_clock", |
| 149 | SPLIT_NS(cfs_rq->exec_clock)); | 178 | SPLIT_NS(cfs_rq->exec_clock)); |
| 150 | 179 | ||
| @@ -191,7 +220,11 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) | |||
| 191 | 220 | ||
| 192 | void print_rt_rq(struct seq_file *m, int cpu, struct rt_rq *rt_rq) | 221 | void print_rt_rq(struct seq_file *m, int cpu, struct rt_rq *rt_rq) |
| 193 | { | 222 | { |
| 223 | #ifdef CONFIG_RT_GROUP_SCHED | ||
| 224 | SEQ_printf(m, "\nrt_rq[%d]:%s\n", cpu, task_group_path(rt_rq->tg)); | ||
| 225 | #else | ||
| 194 | SEQ_printf(m, "\nrt_rq[%d]:\n", cpu); | 226 | SEQ_printf(m, "\nrt_rq[%d]:\n", cpu); |
| 227 | #endif | ||
| 195 | 228 | ||
| 196 | #define P(x) \ | 229 | #define P(x) \ |
| 197 | SEQ_printf(m, " .%-30s: %Ld\n", #x, (long long)(rt_rq->x)) | 230 | SEQ_printf(m, " .%-30s: %Ld\n", #x, (long long)(rt_rq->x)) |
| @@ -212,6 +245,7 @@ extern __read_mostly int sched_clock_running; | |||
| 212 | static void print_cpu(struct seq_file *m, int cpu) | 245 | static void print_cpu(struct seq_file *m, int cpu) |
| 213 | { | 246 | { |
| 214 | struct rq *rq = cpu_rq(cpu); | 247 | struct rq *rq = cpu_rq(cpu); |
| 248 | unsigned long flags; | ||
| 215 | 249 | ||
| 216 | #ifdef CONFIG_X86 | 250 | #ifdef CONFIG_X86 |
| 217 | { | 251 | { |
| @@ -262,14 +296,20 @@ static void print_cpu(struct seq_file *m, int cpu) | |||
| 262 | P(ttwu_count); | 296 | P(ttwu_count); |
| 263 | P(ttwu_local); | 297 | P(ttwu_local); |
| 264 | 298 | ||
| 265 | P(bkl_count); | 299 | SEQ_printf(m, " .%-30s: %d\n", "bkl_count", |
| 300 | rq->rq_sched_info.bkl_count); | ||
| 266 | 301 | ||
| 267 | #undef P | 302 | #undef P |
| 303 | #undef P64 | ||
| 268 | #endif | 304 | #endif |
| 305 | spin_lock_irqsave(&sched_debug_lock, flags); | ||
| 269 | print_cfs_stats(m, cpu); | 306 | print_cfs_stats(m, cpu); |
| 270 | print_rt_stats(m, cpu); | 307 | print_rt_stats(m, cpu); |
| 271 | 308 | ||
| 309 | rcu_read_lock(); | ||
| 272 | print_rq(m, rq, cpu); | 310 | print_rq(m, rq, cpu); |
| 311 | rcu_read_unlock(); | ||
| 312 | spin_unlock_irqrestore(&sched_debug_lock, flags); | ||
| 273 | } | 313 | } |
| 274 | 314 | ||
| 275 | static const char *sched_tunable_scaling_names[] = { | 315 | static const char *sched_tunable_scaling_names[] = { |
