aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched_debug.c
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2010-08-04 07:59:13 -0400
committerMichal Marek <mmarek@suse.cz>2010-08-04 07:59:13 -0400
commit772320e84588dcbe1600ffb83e5f328f2209ac2a (patch)
treea7de21b79340aeaa17c58126f6b801b82c77b53a /kernel/sched_debug.c
parent1ce53adf13a54375d2a5c7cdbe341b2558389615 (diff)
parent9fe6206f400646a2322096b56c59891d530e8d51 (diff)
Merge commit 'v2.6.35' into kbuild/kbuild
Conflicts: arch/powerpc/Makefile
Diffstat (limited to 'kernel/sched_debug.c')
-rw-r--r--kernel/sched_debug.c124
1 files changed, 42 insertions, 82 deletions
diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c
index 67f95aada4b9..35565395d00d 100644
--- a/kernel/sched_debug.c
+++ b/kernel/sched_debug.c
@@ -70,16 +70,16 @@ static void print_cfs_group_stats(struct seq_file *m, int cpu,
70 PN(se->vruntime); 70 PN(se->vruntime);
71 PN(se->sum_exec_runtime); 71 PN(se->sum_exec_runtime);
72#ifdef CONFIG_SCHEDSTATS 72#ifdef CONFIG_SCHEDSTATS
73 PN(se->wait_start); 73 PN(se->statistics.wait_start);
74 PN(se->sleep_start); 74 PN(se->statistics.sleep_start);
75 PN(se->block_start); 75 PN(se->statistics.block_start);
76 PN(se->sleep_max); 76 PN(se->statistics.sleep_max);
77 PN(se->block_max); 77 PN(se->statistics.block_max);
78 PN(se->exec_max); 78 PN(se->statistics.exec_max);
79 PN(se->slice_max); 79 PN(se->statistics.slice_max);
80 PN(se->wait_max); 80 PN(se->statistics.wait_max);
81 PN(se->wait_sum); 81 PN(se->statistics.wait_sum);
82 P(se->wait_count); 82 P(se->statistics.wait_count);
83#endif 83#endif
84 P(se->load.weight); 84 P(se->load.weight);
85#undef PN 85#undef PN
@@ -104,7 +104,7 @@ print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
104 SEQ_printf(m, "%9Ld.%06ld %9Ld.%06ld %9Ld.%06ld", 104 SEQ_printf(m, "%9Ld.%06ld %9Ld.%06ld %9Ld.%06ld",
105 SPLIT_NS(p->se.vruntime), 105 SPLIT_NS(p->se.vruntime),
106 SPLIT_NS(p->se.sum_exec_runtime), 106 SPLIT_NS(p->se.sum_exec_runtime),
107 SPLIT_NS(p->se.sum_sleep_runtime)); 107 SPLIT_NS(p->se.statistics.sum_sleep_runtime));
108#else 108#else
109 SEQ_printf(m, "%15Ld %15Ld %15Ld.%06ld %15Ld.%06ld %15Ld.%06ld", 109 SEQ_printf(m, "%15Ld %15Ld %15Ld.%06ld %15Ld.%06ld %15Ld.%06ld",
110 0LL, 0LL, 0LL, 0L, 0LL, 0L, 0LL, 0L); 110 0LL, 0LL, 0LL, 0L, 0LL, 0L, 0LL, 0L);
@@ -114,7 +114,9 @@ print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
114 { 114 {
115 char path[64]; 115 char path[64];
116 116
117 rcu_read_lock();
117 cgroup_path(task_group(p)->css.cgroup, path, sizeof(path)); 118 cgroup_path(task_group(p)->css.cgroup, path, sizeof(path));
119 rcu_read_unlock();
118 SEQ_printf(m, " %s", path); 120 SEQ_printf(m, " %s", path);
119 } 121 }
120#endif 122#endif
@@ -173,11 +175,6 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
173 task_group_path(tg, path, sizeof(path)); 175 task_group_path(tg, path, sizeof(path));
174 176
175 SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, path); 177 SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, path);
176#elif defined(CONFIG_USER_SCHED) && defined(CONFIG_FAIR_GROUP_SCHED)
177 {
178 uid_t uid = cfs_rq->tg->uid;
179 SEQ_printf(m, "\ncfs_rq[%d] for UID: %u\n", cpu, uid);
180 }
181#else 178#else
182 SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu); 179 SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu);
183#endif 180#endif
@@ -384,15 +381,9 @@ __initcall(init_sched_debug_procfs);
384void proc_sched_show_task(struct task_struct *p, struct seq_file *m) 381void proc_sched_show_task(struct task_struct *p, struct seq_file *m)
385{ 382{
386 unsigned long nr_switches; 383 unsigned long nr_switches;
387 unsigned long flags;
388 int num_threads = 1;
389
390 if (lock_task_sighand(p, &flags)) {
391 num_threads = atomic_read(&p->signal->count);
392 unlock_task_sighand(p, &flags);
393 }
394 384
395 SEQ_printf(m, "%s (%d, #threads: %d)\n", p->comm, p->pid, num_threads); 385 SEQ_printf(m, "%s (%d, #threads: %d)\n", p->comm, p->pid,
386 get_nr_threads(p));
396 SEQ_printf(m, 387 SEQ_printf(m,
397 "---------------------------------------------------------\n"); 388 "---------------------------------------------------------\n");
398#define __P(F) \ 389#define __P(F) \
@@ -407,40 +398,38 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m)
407 PN(se.exec_start); 398 PN(se.exec_start);
408 PN(se.vruntime); 399 PN(se.vruntime);
409 PN(se.sum_exec_runtime); 400 PN(se.sum_exec_runtime);
410 PN(se.avg_overlap);
411 PN(se.avg_wakeup);
412 401
413 nr_switches = p->nvcsw + p->nivcsw; 402 nr_switches = p->nvcsw + p->nivcsw;
414 403
415#ifdef CONFIG_SCHEDSTATS 404#ifdef CONFIG_SCHEDSTATS
416 PN(se.wait_start); 405 PN(se.statistics.wait_start);
417 PN(se.sleep_start); 406 PN(se.statistics.sleep_start);
418 PN(se.block_start); 407 PN(se.statistics.block_start);
419 PN(se.sleep_max); 408 PN(se.statistics.sleep_max);
420 PN(se.block_max); 409 PN(se.statistics.block_max);
421 PN(se.exec_max); 410 PN(se.statistics.exec_max);
422 PN(se.slice_max); 411 PN(se.statistics.slice_max);
423 PN(se.wait_max); 412 PN(se.statistics.wait_max);
424 PN(se.wait_sum); 413 PN(se.statistics.wait_sum);
425 P(se.wait_count); 414 P(se.statistics.wait_count);
426 PN(se.iowait_sum); 415 PN(se.statistics.iowait_sum);
427 P(se.iowait_count); 416 P(se.statistics.iowait_count);
428 P(sched_info.bkl_count); 417 P(sched_info.bkl_count);
429 P(se.nr_migrations); 418 P(se.nr_migrations);
430 P(se.nr_migrations_cold); 419 P(se.statistics.nr_migrations_cold);
431 P(se.nr_failed_migrations_affine); 420 P(se.statistics.nr_failed_migrations_affine);
432 P(se.nr_failed_migrations_running); 421 P(se.statistics.nr_failed_migrations_running);
433 P(se.nr_failed_migrations_hot); 422 P(se.statistics.nr_failed_migrations_hot);
434 P(se.nr_forced_migrations); 423 P(se.statistics.nr_forced_migrations);
435 P(se.nr_wakeups); 424 P(se.statistics.nr_wakeups);
436 P(se.nr_wakeups_sync); 425 P(se.statistics.nr_wakeups_sync);
437 P(se.nr_wakeups_migrate); 426 P(se.statistics.nr_wakeups_migrate);
438 P(se.nr_wakeups_local); 427 P(se.statistics.nr_wakeups_local);
439 P(se.nr_wakeups_remote); 428 P(se.statistics.nr_wakeups_remote);
440 P(se.nr_wakeups_affine); 429 P(se.statistics.nr_wakeups_affine);
441 P(se.nr_wakeups_affine_attempts); 430 P(se.statistics.nr_wakeups_affine_attempts);
442 P(se.nr_wakeups_passive); 431 P(se.statistics.nr_wakeups_passive);
443 P(se.nr_wakeups_idle); 432 P(se.statistics.nr_wakeups_idle);
444 433
445 { 434 {
446 u64 avg_atom, avg_per_cpu; 435 u64 avg_atom, avg_per_cpu;
@@ -491,35 +480,6 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m)
491void proc_sched_set_task(struct task_struct *p) 480void proc_sched_set_task(struct task_struct *p)
492{ 481{
493#ifdef CONFIG_SCHEDSTATS 482#ifdef CONFIG_SCHEDSTATS
494 p->se.wait_max = 0; 483 memset(&p->se.statistics, 0, sizeof(p->se.statistics));
495 p->se.wait_sum = 0;
496 p->se.wait_count = 0;
497 p->se.iowait_sum = 0;
498 p->se.iowait_count = 0;
499 p->se.sleep_max = 0;
500 p->se.sum_sleep_runtime = 0;
501 p->se.block_max = 0;
502 p->se.exec_max = 0;
503 p->se.slice_max = 0;
504 p->se.nr_migrations = 0;
505 p->se.nr_migrations_cold = 0;
506 p->se.nr_failed_migrations_affine = 0;
507 p->se.nr_failed_migrations_running = 0;
508 p->se.nr_failed_migrations_hot = 0;
509 p->se.nr_forced_migrations = 0;
510 p->se.nr_wakeups = 0;
511 p->se.nr_wakeups_sync = 0;
512 p->se.nr_wakeups_migrate = 0;
513 p->se.nr_wakeups_local = 0;
514 p->se.nr_wakeups_remote = 0;
515 p->se.nr_wakeups_affine = 0;
516 p->se.nr_wakeups_affine_attempts = 0;
517 p->se.nr_wakeups_passive = 0;
518 p->se.nr_wakeups_idle = 0;
519 p->sched_info.bkl_count = 0;
520#endif 484#endif
521 p->se.sum_exec_runtime = 0;
522 p->se.prev_sum_exec_runtime = 0;
523 p->nvcsw = 0;
524 p->nivcsw = 0;
525} 485}