summaryrefslogtreecommitdiffstats
path: root/patches/procps-3.2.8/0012-top_irix.patch
blob: 334798ee041586cd486938c361f84f7f8047bf23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From 8d8c23f4cae6eb9de188d7261a23adff0b14954c Mon Sep 17 00:00:00 2001
From: http://ftp.de.debian.org/debian/pool/main/p/procps/procps_3.2.8-8.debian.tar.gz <info@debian.org>
Date: Fri, 19 Mar 2010 21:58:45 +0100
Subject: [PATCH 12/70] top_irix

===================================================================
---
 top.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/top.c b/top.c
index 6d4a7cc..c7e7553 100644
--- a/top.c
+++ b/top.c
@@ -1783,7 +1783,8 @@ static void configs_read (void)
       confighlp(Winstk[i].rc.fieldscur);
    }
 
-   if(Rc.mode_irixps && smp_num_cpus>1){
+   if(Rc.mode_irixps && smp_num_cpus>1 &&
+      !(CHKw(Curwin, Show_THREADS))) {
       // good for 100 CPUs per process
       pcpu_max_value = 9999.0;
       Fieldstab[P_CPU].fmts = " %4.0f";
@@ -2570,6 +2571,15 @@ static void do_key (unsigned c)
       case 'H':
          if (VIZCHKc) {
             TOGw(Curwin, Show_THREADS);
+            if(Rc.mode_irixps && smp_num_cpus>1 &&
+               !(CHKw(Curwin, Show_THREADS))){
+               // good for 100 CPUs per process
+               pcpu_max_value = 9999.0;
+               Fieldstab[P_CPU].fmts = " %4.0f";
+            } else {
+               pcpu_max_value = 99.9;
+               Fieldstab[P_CPU].fmts = " %#4.1f";
+            }
             show_msg(fmtmk("Show threads %s"
                , CHKw(Curwin, Show_THREADS) ? "On" : "Off"));
          }
@@ -2626,7 +2636,8 @@ static void do_key (unsigned c)
          Rc.mode_irixps = !Rc.mode_irixps;
          show_msg(fmtmk("Irix mode %s", Rc.mode_irixps ? "On" : "Off"));
 #endif
-         if(Rc.mode_irixps && smp_num_cpus>1){
+         if(Rc.mode_irixps && smp_num_cpus>1 &&
+            !(CHKw(Curwin, Show_THREADS))){
             // good for 100 CPUs per process
             pcpu_max_value = 9999.0;
             Fieldstab[P_CPU].fmts = " %4.0f";
-- 
1.7.0