diff --git a/man/systemd-cgtop.xml b/man/systemd-cgtop.xml
index 7f54b0b982c..fe17165544b 100644
--- a/man/systemd-cgtop.xml
+++ b/man/systemd-cgtop.xml
@@ -277,6 +277,21 @@
respectively.
+
+ k
+
+ Toggle between including or excluding kernel
+ threads in control group task counts.
+
+
+
+ r
+
+ Toggle between recursively including or
+ excluding tasks in child control groups in control group task
+ counts.
+
+
diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
index 040e42ea4b7..0791c5a2d06 100644
--- a/src/cgtop/cgtop.c
+++ b/src/cgtop/cgtop.c
@@ -895,6 +895,20 @@ int main(int argc, char *argv[]) {
arg_cpu_type = arg_cpu_type == CPU_TIME ? CPU_PERCENT : CPU_TIME;
break;
+ case 'k':
+ arg_kernel_threads = !arg_kernel_threads;
+ fprintf(stdout, "\nCounting kernel threads: %s.", yes_no(arg_kernel_threads));
+ fflush(stdout);
+ sleep(1);
+ break;
+
+ case 'r':
+ arg_recursive = !arg_recursive;
+ fprintf(stdout, "\nRecursive task counting: %s", yes_no(arg_recursive));
+ fflush(stdout);
+ sleep(1);
+ break;
+
case '+':
if (arg_delay < USEC_PER_SEC)
arg_delay += USEC_PER_MSEC*250;
@@ -923,8 +937,8 @@ int main(int argc, char *argv[]) {
case 'h':
fprintf(stdout,
"\t<" ON "p" OFF "> By path; <" ON "t" OFF "> By tasks; <" ON "c" OFF "> By CPU; <" ON "m" OFF "> By memory; <" ON "i" OFF "> By I/O\n"
- "\t<" ON "+" OFF "> Increase delay; <" ON "-" OFF "> Decrease delay; <" ON "%%" OFF "> Toggle time\n"
- "\t<" ON "q" OFF "> Quit; <" ON "SPACE" OFF "> Refresh");
+ "\t<" ON "+" OFF "> Inc. delay; <" ON "-" OFF "> Dec. delay; <" ON "%%" OFF "> Toggle time; <" ON "SPACE" OFF "> Refresh\n"
+ "\t<" ON "k" OFF "> Count kernel threads; <" ON "r" OFF "> Count recursively; <" ON "q" OFF "> Quit");
fflush(stdout);
sleep(3);
break;