Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/top/dist Switch off per-cpu states by default (...



details:   https://anonhg.NetBSD.org/src/rev/5d97c62f7eaf
branches:  trunk
changeset: 778364:5d97c62f7eaf
user:      sborrill <sborrill%NetBSD.org@localhost>
date:      Fri Mar 23 14:46:05 2012 +0000

description:
Switch off per-cpu states by default (i.e. display a single CPU line with a
mean average). Program behaviour now tallies with the man page, but more
importantly, the default behaviour is now sensible for modern multi-core
machines.

If you want the previous behaviour, please set TOP="-1" in your environment.

Fix multiple "1" options not toggling and thus allow settings in TOP
environmental variable to be reversed by a command line option.

Tweak description of "1"  command in interactive mode.

OK christos@

diffstat:

 external/bsd/top/dist/commands.c |  2 +-
 external/bsd/top/dist/top.c      |  4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 53f5ef985d92 -r 5d97c62f7eaf external/bsd/top/dist/commands.c
--- a/external/bsd/top/dist/commands.c  Fri Mar 23 13:32:51 2012 +0000
+++ b/external/bsd/top/dist/commands.c  Fri Mar 23 14:46:05 2012 +0000
@@ -943,7 +943,7 @@
     { ' ', cmd_update, "update screen" },
     { '?', cmd_help, "help; show this text" },
     { 'h', cmd_help, NULL },
-    { '1', cmd_percpustates, "toggle the detail per cpu of cpustates" },
+    { '1', cmd_percpustates, "toggle the display of cpu states per cpu" },
     { 'C', cmd_color, "toggle the use of color" },
     { 'H', cmd_threads, "toggle the display of individual threads" },
     { 't', cmd_threads, NULL },
diff -r 53f5ef985d92 -r 5d97c62f7eaf external/bsd/top/dist/top.c
--- a/external/bsd/top/dist/top.c       Fri Mar 23 13:32:51 2012 +0000
+++ b/external/bsd/top/dist/top.c       Fri Mar 23 14:46:05 2012 +0000
@@ -345,8 +345,6 @@
        {
        case '1':
            gstate->percpustates = !gstate->percpustates;
-           gstate->fulldraw = Yes;
-           gstate->max_topn += display_setmulti(gstate->percpustates);
            break;
 #ifdef ENABLE_COLOR
        case 'C':
@@ -771,7 +769,7 @@
     gstate->fulldraw = Yes;
     gstate->use_color = Yes;
     gstate->interactive = Maybe;
-    gstate->percpustates = Yes;
+    gstate->percpustates = No;
 
     /* preset defaults for process selection */
     gstate->pselect.idle = Yes;



Home | Main Index | Thread Index | Old Index