Skip to content

Commit 5ac5c4d

Browse files
Peter ZijlstraIngo Molnar
authored andcommitted
sched: clean up debug info
Impact: clean up and fix debug info printout While looking over the sched_debug code I noticed that we printed the rq schedstats for every cfs_rq, ammend this. Also change nr_spead_over into an int, and fix a little buglet in min_vruntime printing. Signed-off-by: Peter Zijlstra <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent f7160c7 commit 5ac5c4d

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

kernel/sched.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ struct cfs_rq {
399399
*/
400400
struct sched_entity *curr, *next, *last;
401401

402-
unsigned long nr_spread_over;
402+
unsigned int nr_spread_over;
403403

404404
#ifdef CONFIG_FAIR_GROUP_SCHED
405405
struct rq *rq; /* cpu runqueue to which this cfs_rq is attached */

kernel/sched_debug.c

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
144144
last = __pick_last_entity(cfs_rq);
145145
if (last)
146146
max_vruntime = last->vruntime;
147-
min_vruntime = rq->cfs.min_vruntime;
147+
min_vruntime = cfs_rq->min_vruntime;
148148
rq0_min_vruntime = per_cpu(runqueues, 0).cfs.min_vruntime;
149149
spin_unlock_irqrestore(&rq->lock, flags);
150150
SEQ_printf(m, " .%-30s: %Ld.%06ld\n", "MIN_vruntime",
@@ -161,26 +161,8 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
161161
SPLIT_NS(spread0));
162162
SEQ_printf(m, " .%-30s: %ld\n", "nr_running", cfs_rq->nr_running);
163163
SEQ_printf(m, " .%-30s: %ld\n", "load", cfs_rq->load.weight);
164-
#ifdef CONFIG_SCHEDSTATS
165-
#define P(n) SEQ_printf(m, " .%-30s: %d\n", #n, rq->n);
166-
167-
P(yld_exp_empty);
168-
P(yld_act_empty);
169-
P(yld_both_empty);
170-
P(yld_count);
171164

172-
P(sched_switch);
173-
P(sched_count);
174-
P(sched_goidle);
175-
176-
P(ttwu_count);
177-
P(ttwu_local);
178-
179-
P(bkl_count);
180-
181-
#undef P
182-
#endif
183-
SEQ_printf(m, " .%-30s: %ld\n", "nr_spread_over",
165+
SEQ_printf(m, " .%-30s: %d\n", "nr_spread_over",
184166
cfs_rq->nr_spread_over);
185167
#ifdef CONFIG_FAIR_GROUP_SCHED
186168
#ifdef CONFIG_SMP
@@ -260,6 +242,25 @@ static void print_cpu(struct seq_file *m, int cpu)
260242
#undef P
261243
#undef PN
262244

245+
#ifdef CONFIG_SCHEDSTATS
246+
#define P(n) SEQ_printf(m, " .%-30s: %d\n", #n, rq->n);
247+
248+
P(yld_exp_empty);
249+
P(yld_act_empty);
250+
P(yld_both_empty);
251+
P(yld_count);
252+
253+
P(sched_switch);
254+
P(sched_count);
255+
P(sched_goidle);
256+
257+
P(ttwu_count);
258+
P(ttwu_local);
259+
260+
P(bkl_count);
261+
262+
#undef P
263+
#endif
263264
print_cfs_stats(m, cpu);
264265
print_rt_stats(m, cpu);
265266

0 commit comments

Comments
 (0)