Commit e272d4c2 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] schedstat: UP fix

SMP fix --
    for_each_domain() is not defined if not CONFIG_SMP, so show_schedstat
    needed a couple of extra ifdefs.
Signed-off-by: default avatarRick Lindsley <ricklind@us.ibm.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 40efa147
Version 10 of schedstats includes support for sched_domains, which
hit the mainline kernel in 2.6.7. Some counters make more sense to be
per-runqueue; other to be per-domain.
per-runqueue; other to be per-domain. Note that domains (and their associated
information) will only be pertinent and available on machines utilizing
CONFIG_SMP.
In version 10 of schedstat, there is at least one level of domain
statistics for each cpu listed, and there may well be more than one
......@@ -83,7 +85,9 @@ The last six are statistics dealing with pull_task():
Domain statistics
-----------------
One of these is produced per domain for each cpu described.
One of these is produced per domain for each cpu described. (Note that if
CONFIG_SMP is not defined, *no* domains are utilized and these lines
will not appear in the output.)
domain<N> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
......
......@@ -483,8 +483,10 @@ static int show_schedstat(struct seq_file *seq, void *v)
seq_printf(seq, "timestamp %lu\n", jiffies);
for_each_online_cpu(cpu) {
runqueue_t *rq = cpu_rq(cpu);
#ifdef CONFIG_SMP
struct sched_domain *sd;
int dcnt = 0;
#endif
/* runqueue-specific stats */
seq_printf(seq,
......@@ -506,6 +508,7 @@ static int show_schedstat(struct seq_file *seq, void *v)
rq->pt_lost[itype]);
seq_printf(seq, "\n");
#ifdef CONFIG_SMP
/* domain-specific stats */
for_each_domain(cpu, sd) {
char mask_str[NR_CPUS];
......@@ -524,6 +527,7 @@ static int show_schedstat(struct seq_file *seq, void *v)
sd->sbe_pushed, sd->sbe_attempts,
sd->ttwu_wake_affine, sd->ttwu_wake_balance);
}
#endif
}
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment