aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched_debug.c40
-rw-r--r--kernel/sched_rt.c14
2 files changed, 51 insertions, 3 deletions
diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c
index 8bb713040ac9..8e077b9c91cb 100644
--- a/kernel/sched_debug.c
+++ b/kernel/sched_debug.c
@@ -119,9 +119,7 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
119 struct sched_entity *last; 119 struct sched_entity *last;
120 unsigned long flags; 120 unsigned long flags;
121 121
122#if !defined(CONFIG_CGROUP_SCHED) || !defined(CONFIG_USER_SCHED) 122#if defined(CONFIG_CGROUP_SCHED) && defined(CONFIG_FAIR_GROUP_SCHED)
123 SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu);
124#else
125 char path[128] = ""; 123 char path[128] = "";
126 struct cgroup *cgroup = NULL; 124 struct cgroup *cgroup = NULL;
127 struct task_group *tg = cfs_rq->tg; 125 struct task_group *tg = cfs_rq->tg;
@@ -133,6 +131,8 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
133 cgroup_path(cgroup, path, sizeof(path)); 131 cgroup_path(cgroup, path, sizeof(path));
134 132
135 SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, path); 133 SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, path);
134#else
135 SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu);
136#endif 136#endif
137 137
138 SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "exec_clock", 138 SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "exec_clock",
@@ -169,6 +169,39 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
169 cfs_rq->nr_spread_over); 169 cfs_rq->nr_spread_over);
170} 170}
171 171
172void print_rt_rq(struct seq_file *m, int cpu, struct rt_rq *rt_rq)
173{
174#if defined(CONFIG_CGROUP_SCHED) && defined(CONFIG_RT_GROUP_SCHED)
175 char path[128] = "";
176 struct cgroup *cgroup = NULL;
177 struct task_group *tg = rt_rq->tg;
178
179 if (tg)
180 cgroup = tg->css.cgroup;
181
182 if (cgroup)
183 cgroup_path(cgroup, path, sizeof(path));
184
185 SEQ_printf(m, "\nrt_rq[%d]:%s\n", cpu, path);
186#else
187 SEQ_printf(m, "\nrt_rq[%d]:\n", cpu);
188#endif
189
190
191#define P(x) \
192 SEQ_printf(m, " .%-30s: %Ld\n", #x, (long long)(rt_rq->x))
193#define PN(x) \
194 SEQ_printf(m, " .%-30s: %Ld.%06ld\n", #x, SPLIT_NS(rt_rq->x))
195
196 P(rt_nr_running);
197 P(rt_throttled);
198 PN(rt_time);
199 PN(rt_runtime);
200
201#undef PN
202#undef P
203}
204
172static void print_cpu(struct seq_file *m, int cpu) 205static void print_cpu(struct seq_file *m, int cpu)
173{ 206{
174 struct rq *rq = &per_cpu(runqueues, cpu); 207 struct rq *rq = &per_cpu(runqueues, cpu);
@@ -208,6 +241,7 @@ static void print_cpu(struct seq_file *m, int cpu)
208#undef PN 241#undef PN
209 242
210 print_cfs_stats(m, cpu); 243 print_cfs_stats(m, cpu);
244 print_rt_stats(m, cpu);
211 245
212 print_rq(m, rq, cpu); 246 print_rq(m, rq, cpu);
213} 247}
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index fee5fa7c72db..2e0ccdcf046a 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -1444,3 +1444,17 @@ static const struct sched_class rt_sched_class = {
1444 .prio_changed = prio_changed_rt, 1444 .prio_changed = prio_changed_rt,
1445 .switched_to = switched_to_rt, 1445 .switched_to = switched_to_rt,
1446}; 1446};
1447
1448#ifdef CONFIG_SCHED_DEBUG
1449extern void print_rt_rq(struct seq_file *m, int cpu, struct rt_rq *rt_rq);
1450
1451static void print_rt_stats(struct seq_file *m, int cpu)
1452{
1453 struct rt_rq *rt_rq;
1454
1455 rcu_read_lock();
1456 for_each_leaf_rt_rq(rt_rq, cpu_rq(cpu))
1457 print_rt_rq(m, cpu, rt_rq);
1458 rcu_read_unlock();
1459}
1460#endif