diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-08-30 16:15:08 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-08-31 13:20:44 +0200 |
commit | 7fcfb7ee2f0c2562c0e102915cacbc3ec2c4b8f8 (patch) | |
tree | d4977e34c924ad545240c6426d71d45f33a5632a /src | |
parent | 3cb5beea0c484011fffbd50ae0aaaf71cc699eef (diff) |
cgtop: allow toggling of --recursive= and -k at runtime
Diffstat (limited to 'src')
-rw-r--r-- | src/cgtop/cgtop.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c index 040e42ea4b..0791c5a2d0 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; |