summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Warner <james.warner@comcast.net>2022-09-19 00:00:00 -0500
committerCraig Small <csmall@dropbear.xyz>2022-09-20 19:34:40 +1000
commit5dc515a6fd4f6bd0d594170dcf32664123b0272e (patch)
tree980f824c311492064cdf0cbc0a5426ed8722579f
parentbd463189d734e9e99312c403c26725b3ff6d5958 (diff)
downloadprocps-ng-5dc515a6fd4f6bd0d594170dcf32664123b0272e.tar.gz
top: harden detailed stats two abreast summary display <=== port of newlib e5386f1f
______________________________ original newlib message When displaying detailed cpu statistics, as opposed to those scalable graphs, only two per line can be shown. Therefore, if we are showing a detail version, our '4' toggle must prematurely revert to single mode display. Conversely, the 't' toggle must also turn off that '4' toggle rather than try to print more than 2 abreast if we're currently executing in detailed statistics mode. Signed-off-by: Jim Warner <james.warner@comcast.net>
-rw-r--r--top/top.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/top/top.c b/top/top.c
index 08e1c80..92fff6d 100644
--- a/top/top.c
+++ b/top/top.c
@@ -5860,6 +5860,9 @@ static void keys_summary (int ch) {
if ((w->rc.double_up >= ADJOIN_limit)
|| ((w->rc.double_up >= smp_num_cpus)))
w->rc.double_up = 0;
+ if ((w->rc.double_up > 1)
+ && (!w->rc.graph_cpus))
+ w->rc.double_up = 0;
OFFw(w, (View_CPUSUM | View_CPUNOD));
break;
case 'C':
@@ -5883,6 +5886,9 @@ static void keys_summary (int ch) {
w->rc.graph_cpus = 0;
OFFw(w, View_STATES);
}
+ if ((w->rc.double_up > 1)
+ && (!w->rc.graph_cpus))
+ w->rc.double_up = 0;
break;
default: // keep gcc happy
break;