diff options
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 41b7e2d524d..f53e2b8ef52 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -9342,12 +9342,32 @@ out: | |||
9342 | return err; | 9342 | return err; |
9343 | } | 9343 | } |
9344 | 9344 | ||
9345 | static int cpuacct_percpu_seq_read(struct cgroup *cgroup, struct cftype *cft, | ||
9346 | struct seq_file *m) | ||
9347 | { | ||
9348 | struct cpuacct *ca = cgroup_ca(cgroup); | ||
9349 | u64 percpu; | ||
9350 | int i; | ||
9351 | |||
9352 | for_each_present_cpu(i) { | ||
9353 | percpu = cpuacct_cpuusage_read(ca, i); | ||
9354 | seq_printf(m, "%llu ", (unsigned long long) percpu); | ||
9355 | } | ||
9356 | seq_printf(m, "\n"); | ||
9357 | return 0; | ||
9358 | } | ||
9359 | |||
9345 | static struct cftype files[] = { | 9360 | static struct cftype files[] = { |
9346 | { | 9361 | { |
9347 | .name = "usage", | 9362 | .name = "usage", |
9348 | .read_u64 = cpuusage_read, | 9363 | .read_u64 = cpuusage_read, |
9349 | .write_u64 = cpuusage_write, | 9364 | .write_u64 = cpuusage_write, |
9350 | }, | 9365 | }, |
9366 | { | ||
9367 | .name = "usage_percpu", | ||
9368 | .read_seq_string = cpuacct_percpu_seq_read, | ||
9369 | }, | ||
9370 | |||
9351 | }; | 9371 | }; |
9352 | 9372 | ||
9353 | static int cpuacct_populate(struct cgroup_subsys *ss, struct cgroup *cgrp) | 9373 | static int cpuacct_populate(struct cgroup_subsys *ss, struct cgroup *cgrp) |