diff options
Diffstat (limited to 'kernel/sched/debug.c')
-rw-r--r-- | kernel/sched/debug.c | 106 |
1 files changed, 57 insertions, 49 deletions
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index 2a0a9995256d..fa178b62ea79 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c | |||
@@ -369,8 +369,12 @@ static void print_cfs_group_stats(struct seq_file *m, int cpu, struct task_group | |||
369 | 369 | ||
370 | #define P(F) \ | 370 | #define P(F) \ |
371 | SEQ_printf(m, " .%-30s: %lld\n", #F, (long long)F) | 371 | SEQ_printf(m, " .%-30s: %lld\n", #F, (long long)F) |
372 | #define P_SCHEDSTAT(F) \ | ||
373 | SEQ_printf(m, " .%-30s: %lld\n", #F, (long long)schedstat_val(F)) | ||
372 | #define PN(F) \ | 374 | #define PN(F) \ |
373 | SEQ_printf(m, " .%-30s: %lld.%06ld\n", #F, SPLIT_NS((long long)F)) | 375 | SEQ_printf(m, " .%-30s: %lld.%06ld\n", #F, SPLIT_NS((long long)F)) |
376 | #define PN_SCHEDSTAT(F) \ | ||
377 | SEQ_printf(m, " .%-30s: %lld.%06ld\n", #F, SPLIT_NS((long long)schedstat_val(F))) | ||
374 | 378 | ||
375 | if (!se) | 379 | if (!se) |
376 | return; | 380 | return; |
@@ -378,26 +382,27 @@ static void print_cfs_group_stats(struct seq_file *m, int cpu, struct task_group | |||
378 | PN(se->exec_start); | 382 | PN(se->exec_start); |
379 | PN(se->vruntime); | 383 | PN(se->vruntime); |
380 | PN(se->sum_exec_runtime); | 384 | PN(se->sum_exec_runtime); |
381 | #ifdef CONFIG_SCHEDSTATS | ||
382 | if (schedstat_enabled()) { | 385 | if (schedstat_enabled()) { |
383 | PN(se->statistics.wait_start); | 386 | PN_SCHEDSTAT(se->statistics.wait_start); |
384 | PN(se->statistics.sleep_start); | 387 | PN_SCHEDSTAT(se->statistics.sleep_start); |
385 | PN(se->statistics.block_start); | 388 | PN_SCHEDSTAT(se->statistics.block_start); |
386 | PN(se->statistics.sleep_max); | 389 | PN_SCHEDSTAT(se->statistics.sleep_max); |
387 | PN(se->statistics.block_max); | 390 | PN_SCHEDSTAT(se->statistics.block_max); |
388 | PN(se->statistics.exec_max); | 391 | PN_SCHEDSTAT(se->statistics.exec_max); |
389 | PN(se->statistics.slice_max); | 392 | PN_SCHEDSTAT(se->statistics.slice_max); |
390 | PN(se->statistics.wait_max); | 393 | PN_SCHEDSTAT(se->statistics.wait_max); |
391 | PN(se->statistics.wait_sum); | 394 | PN_SCHEDSTAT(se->statistics.wait_sum); |
392 | P(se->statistics.wait_count); | 395 | P_SCHEDSTAT(se->statistics.wait_count); |
393 | } | 396 | } |
394 | #endif | ||
395 | P(se->load.weight); | 397 | P(se->load.weight); |
396 | #ifdef CONFIG_SMP | 398 | #ifdef CONFIG_SMP |
397 | P(se->avg.load_avg); | 399 | P(se->avg.load_avg); |
398 | P(se->avg.util_avg); | 400 | P(se->avg.util_avg); |
399 | #endif | 401 | #endif |
402 | |||
403 | #undef PN_SCHEDSTAT | ||
400 | #undef PN | 404 | #undef PN |
405 | #undef P_SCHEDSTAT | ||
401 | #undef P | 406 | #undef P |
402 | } | 407 | } |
403 | #endif | 408 | #endif |
@@ -410,7 +415,8 @@ static char *task_group_path(struct task_group *tg) | |||
410 | if (autogroup_path(tg, group_path, PATH_MAX)) | 415 | if (autogroup_path(tg, group_path, PATH_MAX)) |
411 | return group_path; | 416 | return group_path; |
412 | 417 | ||
413 | return cgroup_path(tg->css.cgroup, group_path, PATH_MAX); | 418 | cgroup_path(tg->css.cgroup, group_path, PATH_MAX); |
419 | return group_path; | ||
414 | } | 420 | } |
415 | #endif | 421 | #endif |
416 | 422 | ||
@@ -429,9 +435,9 @@ print_task(struct seq_file *m, struct rq *rq, struct task_struct *p) | |||
429 | p->prio); | 435 | p->prio); |
430 | 436 | ||
431 | SEQ_printf(m, "%9Ld.%06ld %9Ld.%06ld %9Ld.%06ld", | 437 | SEQ_printf(m, "%9Ld.%06ld %9Ld.%06ld %9Ld.%06ld", |
432 | SPLIT_NS(schedstat_val(p, se.statistics.wait_sum)), | 438 | SPLIT_NS(schedstat_val_or_zero(p->se.statistics.wait_sum)), |
433 | SPLIT_NS(p->se.sum_exec_runtime), | 439 | SPLIT_NS(p->se.sum_exec_runtime), |
434 | SPLIT_NS(schedstat_val(p, se.statistics.sum_sleep_runtime))); | 440 | SPLIT_NS(schedstat_val_or_zero(p->se.statistics.sum_sleep_runtime))); |
435 | 441 | ||
436 | #ifdef CONFIG_NUMA_BALANCING | 442 | #ifdef CONFIG_NUMA_BALANCING |
437 | SEQ_printf(m, " %d %d", task_node(p), task_numa_group_id(p)); | 443 | SEQ_printf(m, " %d %d", task_node(p), task_numa_group_id(p)); |
@@ -626,9 +632,7 @@ do { \ | |||
626 | #undef P64 | 632 | #undef P64 |
627 | #endif | 633 | #endif |
628 | 634 | ||
629 | #ifdef CONFIG_SCHEDSTATS | 635 | #define P(n) SEQ_printf(m, " .%-30s: %d\n", #n, schedstat_val(rq->n)); |
630 | #define P(n) SEQ_printf(m, " .%-30s: %d\n", #n, rq->n); | ||
631 | |||
632 | if (schedstat_enabled()) { | 636 | if (schedstat_enabled()) { |
633 | P(yld_count); | 637 | P(yld_count); |
634 | P(sched_count); | 638 | P(sched_count); |
@@ -636,9 +640,8 @@ do { \ | |||
636 | P(ttwu_count); | 640 | P(ttwu_count); |
637 | P(ttwu_local); | 641 | P(ttwu_local); |
638 | } | 642 | } |
639 | |||
640 | #undef P | 643 | #undef P |
641 | #endif | 644 | |
642 | spin_lock_irqsave(&sched_debug_lock, flags); | 645 | spin_lock_irqsave(&sched_debug_lock, flags); |
643 | print_cfs_stats(m, cpu); | 646 | print_cfs_stats(m, cpu); |
644 | print_rt_stats(m, cpu); | 647 | print_rt_stats(m, cpu); |
@@ -868,10 +871,14 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m) | |||
868 | SEQ_printf(m, "%-45s:%21Ld\n", #F, (long long)F) | 871 | SEQ_printf(m, "%-45s:%21Ld\n", #F, (long long)F) |
869 | #define P(F) \ | 872 | #define P(F) \ |
870 | SEQ_printf(m, "%-45s:%21Ld\n", #F, (long long)p->F) | 873 | SEQ_printf(m, "%-45s:%21Ld\n", #F, (long long)p->F) |
874 | #define P_SCHEDSTAT(F) \ | ||
875 | SEQ_printf(m, "%-45s:%21Ld\n", #F, (long long)schedstat_val(p->F)) | ||
871 | #define __PN(F) \ | 876 | #define __PN(F) \ |
872 | SEQ_printf(m, "%-45s:%14Ld.%06ld\n", #F, SPLIT_NS((long long)F)) | 877 | SEQ_printf(m, "%-45s:%14Ld.%06ld\n", #F, SPLIT_NS((long long)F)) |
873 | #define PN(F) \ | 878 | #define PN(F) \ |
874 | SEQ_printf(m, "%-45s:%14Ld.%06ld\n", #F, SPLIT_NS((long long)p->F)) | 879 | SEQ_printf(m, "%-45s:%14Ld.%06ld\n", #F, SPLIT_NS((long long)p->F)) |
880 | #define PN_SCHEDSTAT(F) \ | ||
881 | SEQ_printf(m, "%-45s:%14Ld.%06ld\n", #F, SPLIT_NS((long long)schedstat_val(p->F))) | ||
875 | 882 | ||
876 | PN(se.exec_start); | 883 | PN(se.exec_start); |
877 | PN(se.vruntime); | 884 | PN(se.vruntime); |
@@ -881,37 +888,36 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m) | |||
881 | 888 | ||
882 | P(se.nr_migrations); | 889 | P(se.nr_migrations); |
883 | 890 | ||
884 | #ifdef CONFIG_SCHEDSTATS | ||
885 | if (schedstat_enabled()) { | 891 | if (schedstat_enabled()) { |
886 | u64 avg_atom, avg_per_cpu; | 892 | u64 avg_atom, avg_per_cpu; |
887 | 893 | ||
888 | PN(se.statistics.sum_sleep_runtime); | 894 | PN_SCHEDSTAT(se.statistics.sum_sleep_runtime); |
889 | PN(se.statistics.wait_start); | 895 | PN_SCHEDSTAT(se.statistics.wait_start); |
890 | PN(se.statistics.sleep_start); | 896 | PN_SCHEDSTAT(se.statistics.sleep_start); |
891 | PN(se.statistics.block_start); | 897 | PN_SCHEDSTAT(se.statistics.block_start); |
892 | PN(se.statistics.sleep_max); | 898 | PN_SCHEDSTAT(se.statistics.sleep_max); |
893 | PN(se.statistics.block_max); | 899 | PN_SCHEDSTAT(se.statistics.block_max); |
894 | PN(se.statistics.exec_max); | 900 | PN_SCHEDSTAT(se.statistics.exec_max); |
895 | PN(se.statistics.slice_max); | 901 | PN_SCHEDSTAT(se.statistics.slice_max); |
896 | PN(se.statistics.wait_max); | 902 | PN_SCHEDSTAT(se.statistics.wait_max); |
897 | PN(se.statistics.wait_sum); | 903 | PN_SCHEDSTAT(se.statistics.wait_sum); |
898 | P(se.statistics.wait_count); | 904 | P_SCHEDSTAT(se.statistics.wait_count); |
899 | PN(se.statistics.iowait_sum); | 905 | PN_SCHEDSTAT(se.statistics.iowait_sum); |
900 | P(se.statistics.iowait_count); | 906 | P_SCHEDSTAT(se.statistics.iowait_count); |
901 | P(se.statistics.nr_migrations_cold); | 907 | P_SCHEDSTAT(se.statistics.nr_migrations_cold); |
902 | P(se.statistics.nr_failed_migrations_affine); | 908 | P_SCHEDSTAT(se.statistics.nr_failed_migrations_affine); |
903 | P(se.statistics.nr_failed_migrations_running); | 909 | P_SCHEDSTAT(se.statistics.nr_failed_migrations_running); |
904 | P(se.statistics.nr_failed_migrations_hot); | 910 | P_SCHEDSTAT(se.statistics.nr_failed_migrations_hot); |
905 | P(se.statistics.nr_forced_migrations); | 911 | P_SCHEDSTAT(se.statistics.nr_forced_migrations); |
906 | P(se.statistics.nr_wakeups); | 912 | P_SCHEDSTAT(se.statistics.nr_wakeups); |
907 | P(se.statistics.nr_wakeups_sync); | 913 | P_SCHEDSTAT(se.statistics.nr_wakeups_sync); |
908 | P(se.statistics.nr_wakeups_migrate); | 914 | P_SCHEDSTAT(se.statistics.nr_wakeups_migrate); |
909 | P(se.statistics.nr_wakeups_local); | 915 | P_SCHEDSTAT(se.statistics.nr_wakeups_local); |
910 | P(se.statistics.nr_wakeups_remote); | 916 | P_SCHEDSTAT(se.statistics.nr_wakeups_remote); |
911 | P(se.statistics.nr_wakeups_affine); | 917 | P_SCHEDSTAT(se.statistics.nr_wakeups_affine); |
912 | P(se.statistics.nr_wakeups_affine_attempts); | 918 | P_SCHEDSTAT(se.statistics.nr_wakeups_affine_attempts); |
913 | P(se.statistics.nr_wakeups_passive); | 919 | P_SCHEDSTAT(se.statistics.nr_wakeups_passive); |
914 | P(se.statistics.nr_wakeups_idle); | 920 | P_SCHEDSTAT(se.statistics.nr_wakeups_idle); |
915 | 921 | ||
916 | avg_atom = p->se.sum_exec_runtime; | 922 | avg_atom = p->se.sum_exec_runtime; |
917 | if (nr_switches) | 923 | if (nr_switches) |
@@ -930,7 +936,7 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m) | |||
930 | __PN(avg_atom); | 936 | __PN(avg_atom); |
931 | __PN(avg_per_cpu); | 937 | __PN(avg_per_cpu); |
932 | } | 938 | } |
933 | #endif | 939 | |
934 | __P(nr_switches); | 940 | __P(nr_switches); |
935 | SEQ_printf(m, "%-45s:%21Ld\n", | 941 | SEQ_printf(m, "%-45s:%21Ld\n", |
936 | "nr_voluntary_switches", (long long)p->nvcsw); | 942 | "nr_voluntary_switches", (long long)p->nvcsw); |
@@ -947,8 +953,10 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m) | |||
947 | #endif | 953 | #endif |
948 | P(policy); | 954 | P(policy); |
949 | P(prio); | 955 | P(prio); |
956 | #undef PN_SCHEDSTAT | ||
950 | #undef PN | 957 | #undef PN |
951 | #undef __PN | 958 | #undef __PN |
959 | #undef P_SCHEDSTAT | ||
952 | #undef P | 960 | #undef P |
953 | #undef __P | 961 | #undef __P |
954 | 962 | ||