cgroup, sched: Move basic cpu stats from cgroup.stat to cpu.stat
The basic cpu stat is currently shown with "cpu." prefix in cgroup.stat, and the same information is duplicated in cpu.stat when cpu controller is enabled. This is ugly and not very scalable as we want to expand the coverage of stat information which is always available. This patch makes cgroup core always create "cpu.stat" file and show the basic cpu stat there and calls the cpu controller to show the extra stats when enabled. This ensures that the same information isn't presented in multiple places and makes future expansion of basic stats easier. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
This commit is contained in:
@@ -256,7 +256,7 @@ void __cgroup_account_cputime_field(struct cgroup *cgrp,
|
||||
cgroup_cpu_stat_account_end(cgrp, cstat);
|
||||
}
|
||||
|
||||
void cgroup_stat_show_cputime(struct seq_file *seq, const char *prefix)
|
||||
void cgroup_stat_show_cputime(struct seq_file *seq)
|
||||
{
|
||||
struct cgroup *cgrp = seq_css(seq)->cgroup;
|
||||
u64 usage, utime, stime;
|
||||
@@ -278,10 +278,10 @@ void cgroup_stat_show_cputime(struct seq_file *seq, const char *prefix)
|
||||
do_div(utime, NSEC_PER_USEC);
|
||||
do_div(stime, NSEC_PER_USEC);
|
||||
|
||||
seq_printf(seq, "%susage_usec %llu\n"
|
||||
"%suser_usec %llu\n"
|
||||
"%ssystem_usec %llu\n",
|
||||
prefix, usage, prefix, utime, prefix, stime);
|
||||
seq_printf(seq, "usage_usec %llu\n"
|
||||
"user_usec %llu\n"
|
||||
"system_usec %llu\n",
|
||||
usage, utime, stime);
|
||||
}
|
||||
|
||||
int cgroup_stat_init(struct cgroup *cgrp)
|
||||
|
||||
Reference in New Issue
Block a user