displays
the last mounted controller which is not specified, so fix it.
Example:
# lssubsys -m
cpuset /cgroup/cpuset
cpu /cgroup/cpu
# lscgroup
cpu:/
cpu:/test
cpuset:/
cpuset:/test
before the patch:
# cgsnapshot -s cpu
# Configuration file generated by cgsnapshot
mount {
cpuset = /cgroup/cpuset;
cpu = /cgroup/cpu;
}
group test {
cpu {
cpu.rt_period_us="
1000000";
cpu.rt_runtime_us="0";
cpu.shares="1024";
}
}
group test {
cpuset {
cpuset.memory_spread_slab="0";
cpuset.memory_spread_page="0";
cpuset.memory_migrate="0";
cpuset.sched_relax_domain_level="-1";
cpuset.sched_load_balance="1";
cpuset.mem_hardwall="0";
cpuset.mem_exclusive="0";
cpuset.cpu_exclusive="0";
cpuset.mems="";
cpuset.cpus="";
}
}
after the patch:
# cgsnapshot -s cpu
# Configuration file generated by cgsnapshot
mount {
cpuset = /cgroup/cpuset;
cpu = /cgroup/cpu;
}
group test {
cpu {
cpu.rt_period_us="
1000000";
cpu.rt_runtime_us="0";
cpu.shares="1024";
}
}
Signed-off-by: Weng Meiling <wengmeiling.weng@huawei.com>
ret = cgroup_get_controller_next(&handle, &controller);
}
- if (max != 0) {
+ if ((!(flags & FL_LIST) ||
+ (is_ctlr_on_list(controllers, cont_names)))
+ && (max != 0)) {
(controllers[max])[0] = '\0';
ret = display_controller_data(
controllers, program_name);