cgtop: recursively count cgroup member tasks

When showing the number of tasks in a cgroup, recursively count tasks in
child cgroups and include them in the number. This ensures that the
number of tasks is cummulative the same way as memory, cpu and IO
resources are.

Old behaviour can be restored by passing the new --recursive=no switch.
This commit is contained in:
Lennart Poettering
2015-08-31 13:20:44 +02:00
parent 41ba8b6e69
commit 3cb5beea0c
2 changed files with 83 additions and 26 deletions
+12 -1
View File
@@ -176,6 +176,18 @@
the count.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--recursive=</option></term>
<listitem><para>Controls whether the number of tasks shown for
a control group shall include all tasks that are contained in
any of the child control groups as well. Takes a boolean
argument, defaults to <literal>yes</literal>. If enabled the
tasks in child control groups are included, if disabled only
the tasks in the control group itself are
counted.</para></listitem>
</varlistentry>
<varlistentry>
<term><option>-n</option></term>
<term><option>--iterations=</option></term>
@@ -212,7 +224,6 @@
</refsect1>
<refsect1>
<title>Keys</title>