chiark / gitweb /
cgtop: add % as key to toggle time/percentage
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 2 Apr 2013 18:55:36 +0000 (14:55 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 2 Apr 2013 19:01:44 +0000 (15:01 -0400)
man/systemd-cgtop.xml
src/cgtop/cgtop.c

index c5bb489869fe6cbc3fb7c4a6f9fb2dedc5679d46..e765172234ac46176b8ec7a76ebf9deaecad26c9 100644 (file)
                                 load, respectively.</para></listitem>
                         </varlistentry>
 
+                        <varlistentry>
+                                <term>%</term>
+
+                                <listitem><para>Toggle between showing CPU time as
+                                time or percentage.</para></listitem>
+                        </varlistentry>
+
                         <varlistentry>
                                 <term>+</term>
                                 <term>-</term>
index 38f4c3050dddc20c47832610380da0f16a278270..30167349f16b2110ecb27d66ce08596e4c825051 100644 (file)
@@ -793,6 +793,10 @@ int main(int argc, char *argv[]) {
                         arg_order = ORDER_IO;
                         break;
 
+                case '%':
+                        arg_cpu_type = arg_cpu_type == CPU_TIME ? CPU_PERCENT : CPU_TIME;
+                        break;
+
                 case '+':
                         if (arg_delay < USEC_PER_SEC)
                                 arg_delay += USEC_PER_MSEC*250;
@@ -821,7 +825,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 "Q" OFF "> Quit; <" ON "+" OFF "> Increase delay; <" ON "-" OFF "> Decrease delay; <" ON "SPACE" OFF "> Refresh");
+                                "\t<" ON "+" OFF "> Increase delay; <" ON "-" OFF "> Decrease delay; <" ON "%%" OFF "> Toggle time\n"
+                                "\t<" ON "Q" OFF "> Quit; <" ON "SPACE" OFF "> Refresh");
                         fflush(stdout);
                         sleep(3);
                         break;