diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2008-04-19 13:45:00 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-19 13:45:00 -0400 |
commit | 7ba2e74ab5a0518bc953042952dd165724bc70c9 (patch) | |
tree | c6a1495130ebef022f21cb3b7acde0842588acb4 /kernel | |
parent | 8f1bc385cfbab474db6c27b5af1e439614f3025c (diff) |
sched: debug: show a weight tree
Print a tree of weights.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched_fair.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index d72e8b41b3e4..89fa32b4edf2 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -1611,6 +1611,30 @@ static const struct sched_class fair_sched_class = { | |||
1611 | }; | 1611 | }; |
1612 | 1612 | ||
1613 | #ifdef CONFIG_SCHED_DEBUG | 1613 | #ifdef CONFIG_SCHED_DEBUG |
1614 | static void | ||
1615 | print_cfs_rq_tasks(struct seq_file *m, struct cfs_rq *cfs_rq, int depth) | ||
1616 | { | ||
1617 | struct sched_entity *se; | ||
1618 | |||
1619 | if (!cfs_rq) | ||
1620 | return; | ||
1621 | |||
1622 | list_for_each_entry_rcu(se, &cfs_rq->tasks, group_node) { | ||
1623 | int i; | ||
1624 | |||
1625 | for (i = depth; i; i--) | ||
1626 | seq_puts(m, " "); | ||
1627 | |||
1628 | seq_printf(m, "%lu %s %lu\n", | ||
1629 | se->load.weight, | ||
1630 | entity_is_task(se) ? "T" : "G", | ||
1631 | calc_delta_weight(SCHED_LOAD_SCALE, se) | ||
1632 | ); | ||
1633 | if (!entity_is_task(se)) | ||
1634 | print_cfs_rq_tasks(m, group_cfs_rq(se), depth + 1); | ||
1635 | } | ||
1636 | } | ||
1637 | |||
1614 | static void print_cfs_stats(struct seq_file *m, int cpu) | 1638 | static void print_cfs_stats(struct seq_file *m, int cpu) |
1615 | { | 1639 | { |
1616 | struct cfs_rq *cfs_rq; | 1640 | struct cfs_rq *cfs_rq; |
@@ -1618,6 +1642,9 @@ static void print_cfs_stats(struct seq_file *m, int cpu) | |||
1618 | rcu_read_lock(); | 1642 | rcu_read_lock(); |
1619 | for_each_leaf_cfs_rq(cpu_rq(cpu), cfs_rq) | 1643 | for_each_leaf_cfs_rq(cpu_rq(cpu), cfs_rq) |
1620 | print_cfs_rq(m, cpu, cfs_rq); | 1644 | print_cfs_rq(m, cpu, cfs_rq); |
1645 | |||
1646 | seq_printf(m, "\nWeight tree:\n"); | ||
1647 | print_cfs_rq_tasks(m, &cpu_rq(cpu)->cfs, 1); | ||
1621 | rcu_read_unlock(); | 1648 | rcu_read_unlock(); |
1622 | } | 1649 | } |
1623 | #endif | 1650 | #endif |