Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 88581
Collapse All | Expand All

(-)ksysguard.orig/gui/KSysGuardApplet.xml (+1 lines)
Lines 6-11 Link Here
6
  <beam sensorName="cpu/user" hostName="localhost" color="1608191" sensorType="integer" />
6
  <beam sensorName="cpu/user" hostName="localhost" color="1608191" sensorType="integer" />
7
  <beam sensorName="cpu/sys" hostName="localhost" color="16743688" sensorType="integer" />
7
  <beam sensorName="cpu/sys" hostName="localhost" color="16743688" sensorType="integer" />
8
  <beam sensorName="cpu/nice" hostName="localhost" color="16771600" sensorType="integer" />
8
  <beam sensorName="cpu/nice" hostName="localhost" color="16771600" sensorType="integer" />
9
  <beam sensorName="cpu/wait" hostName="localhost" color="16764927" sensorType="integer" />
9
 </display>
10
 </display>
10
 <display topBar="1" vColor="4605510" title="Mem" dock="1" bColor="3223601" graphStyle="0" class="FancyPlotter" unit="" hScale="5" showUnit="0" hLines="1" hCount="2" vLines="0" autoRange="1" min="0" max="0" hColor="14606046" globalUpdate="1" pause="0" fontSize="8" labels="0" vScroll="1" vDistance="30" >
11
 <display topBar="1" vColor="4605510" title="Mem" dock="1" bColor="3223601" graphStyle="0" class="FancyPlotter" unit="" hScale="5" showUnit="0" hLines="1" hCount="2" vLines="0" autoRange="1" min="0" max="0" hColor="14606046" globalUpdate="1" pause="0" fontSize="8" labels="0" vScroll="1" vDistance="30" >
11
  <beam sensorName="mem/physical/application" hostName="localhost" color="1608191" sensorType="integer" />
12
  <beam sensorName="mem/physical/application" hostName="localhost" color="1608191" sensorType="integer" />
(-)ksysguard.orig/gui/SystemLoad.sgrd (+1 lines)
Lines 6-11 Link Here
6
  <beam sensorName="cpu/user" hostName="localhost" color="1608191" sensorType="integer" />
6
  <beam sensorName="cpu/user" hostName="localhost" color="1608191" sensorType="integer" />
7
  <beam sensorName="cpu/sys" hostName="localhost" color="16743688" sensorType="integer" />
7
  <beam sensorName="cpu/sys" hostName="localhost" color="16743688" sensorType="integer" />
8
  <beam sensorName="cpu/nice" hostName="localhost" color="16771600" sensorType="integer" />
8
  <beam sensorName="cpu/nice" hostName="localhost" color="16771600" sensorType="integer" />
9
  <beam sensorName="cpu/wait" hostName="localhost" color="16764927" sensorType="integer" />
9
 </display>
10
 </display>
10
 <display topBar="0" vColor="326429" title="Load Average (1 min)" bColor="3223601" graphStyle="0" class="FancyPlotter" row="0" unit="" hScale="1" column="1" showUnit="0" hLines="1" hCount="5" vLines="1" autoRange="1" min="0" max="0" hColor="326429" globalUpdate="1" pause="0" fontSize="9" labels="1" vScroll="1" vDistance="30" >
11
 <display topBar="0" vColor="326429" title="Load Average (1 min)" bColor="3223601" graphStyle="0" class="FancyPlotter" row="0" unit="" hScale="1" column="1" showUnit="0" hLines="1" hCount="5" vLines="1" autoRange="1" min="0" max="0" hColor="326429" globalUpdate="1" pause="0" fontSize="9" labels="1" vScroll="1" vDistance="30" >
11
  <beam sensorName="cpu/loadavg1" hostName="localhost" color="1608191" sensorType="float" />
12
  <beam sensorName="cpu/loadavg1" hostName="localhost" color="1608191" sensorType="float" />
(-)ksysguard.orig/gui/ksgrd/SensorManager.cc (-2 / +3 lines)
Lines 48-57 Link Here
48
48
49
  // Fill the sensor description dictionary.
49
  // Fill the sensor description dictionary.
50
  mDict.insert( "cpu", new QString( i18n( "CPU Load" ) ) );
50
  mDict.insert( "cpu", new QString( i18n( "CPU Load" ) ) );
51
  mDict.insert( "idle", new QString( i18n( "Idle Load" ) ) );
51
  mDict.insert( "idle", new QString( i18n( "Idling" ) ) );
52
  mDict.insert( "sys", new QString( i18n( "System Load" ) ) );
53
  mDict.insert( "nice", new QString( i18n( "Nice Load" ) ) );
52
  mDict.insert( "nice", new QString( i18n( "Nice Load" ) ) );
53
  mDict.insert( "sys", new QString( i18n( "System Load" ) ) );
54
  mDict.insert( "user", new QString( i18n( "User Load" ) ) );
54
  mDict.insert( "user", new QString( i18n( "User Load" ) ) );
55
  mDict.insert( "wait", new QString( i18n( "Waiting" ) ) );
55
  mDict.insert( "mem", new QString( i18n( "Memory" ) ) );
56
  mDict.insert( "mem", new QString( i18n( "Memory" ) ) );
56
  mDict.insert( "physical", new QString( i18n( "Physical Memory" ) ) );
57
  mDict.insert( "physical", new QString( i18n( "Physical Memory" ) ) );
57
  mDict.insert( "swap", new QString( i18n( "Swap Memory" ) ) );
58
  mDict.insert( "swap", new QString( i18n( "Swap Memory" ) ) );
(-)ksysguard.orig/ksysguardd/Linux/stat.c (-10 / +53 lines)
Lines 42-47 Link Here
42
  int niceLoad;
42
  int niceLoad;
43
  int sysLoad;
43
  int sysLoad;
44
  int idleLoad;
44
  int idleLoad;
45
  int waitLoad;
45
46
46
  /* To calculate the loads we need to remember the tick values for each
47
  /* To calculate the loads we need to remember the tick values for each
47
   * load type. */
48
   * load type. */
Lines 49-54 Link Here
49
  unsigned long niceTicks;
50
  unsigned long niceTicks;
50
  unsigned long sysTicks;
51
  unsigned long sysTicks;
51
  unsigned long idleTicks;
52
  unsigned long idleTicks;
53
  unsigned long waitTicks;
52
} CPULoadInfo;
54
} CPULoadInfo;
53
55
54
typedef struct
56
typedef struct
Lines 144-172 Link Here
144
146
145
static void updateCPULoad( const char* line, CPULoadInfo* load )
147
static void updateCPULoad( const char* line, CPULoadInfo* load )
146
{
148
{
147
  unsigned long currUserTicks, currSysTicks, currNiceTicks, currIdleTicks;
149
  unsigned long currUserTicks, currSysTicks, currNiceTicks;
148
  unsigned long totalTicks;
150
  unsigned long currIdleTicks, currWaitTicks, totalTicks;
149
151
150
  sscanf( line, "%*s %lu %lu %lu %lu", &currUserTicks, &currNiceTicks,
152
  sscanf( line, "%*s %lu %lu %lu %lu %lu", &currUserTicks, &currNiceTicks,
151
          &currSysTicks, &currIdleTicks );
153
          &currSysTicks, &currIdleTicks, &currWaitTicks );
152
154
153
  totalTicks = ( currUserTicks - load->userTicks ) +
155
  totalTicks = ( currUserTicks - load->userTicks ) +
154
               ( currSysTicks - load->sysTicks ) +
156
               ( currSysTicks - load->sysTicks ) +
155
               ( currNiceTicks - load->niceTicks ) +
157
               ( currNiceTicks - load->niceTicks ) +
156
               ( currIdleTicks - load->idleTicks );
158
               ( currIdleTicks - load->idleTicks ) +
159
               ( currWaitTicks - load->waitTicks );
157
160
158
  if ( totalTicks > 10 ) {
161
  if ( totalTicks > 10 ) {
159
    load->userLoad = ( 100 * ( currUserTicks - load->userTicks ) ) / totalTicks;
162
    load->userLoad = ( 100 * ( currUserTicks - load->userTicks ) ) / totalTicks;
160
    load->sysLoad = ( 100 * ( currSysTicks - load->sysTicks ) ) / totalTicks;
163
    load->sysLoad = ( 100 * ( currSysTicks - load->sysTicks ) ) / totalTicks;
161
    load->niceLoad = ( 100 * ( currNiceTicks - load->niceTicks ) ) / totalTicks;
164
    load->niceLoad = ( 100 * ( currNiceTicks - load->niceTicks ) ) / totalTicks;
162
    load->idleLoad = ( 100 - ( load->userLoad + load->sysLoad + load->niceLoad ) );
165
    load->idleLoad = ( 100 * ( currIdleTicks - load->idleTicks ) ) / totalTicks;
166
    load->waitLoad = ( 100 * ( currWaitTicks - load->waitTicks ) ) / totalTicks;
163
  } else
167
  } else
164
    load->userLoad = load->sysLoad = load->niceLoad = load->idleLoad = 0;
168
    load->userLoad = load->sysLoad = load->niceLoad = load->idleLoad = load->waitLoad = 0;
165
169
166
  load->userTicks = currUserTicks;
170
  load->userTicks = currUserTicks;
167
  load->sysTicks = currSysTicks;
171
  load->sysTicks = currSysTicks;
168
  load->niceTicks = currNiceTicks;
172
  load->niceTicks = currNiceTicks;
169
  load->idleTicks = currIdleTicks;
173
  load->idleTicks = currIdleTicks;
174
  load->waitTicks = currWaitTicks;
170
}
175
}
171
176
172
static int processDisk( char* tag, char* buf, const char* label, int idx )
177
static int processDisk( char* tag, char* buf, const char* label, int idx )
Lines 550-558 Link Here
550
void initStat( struct SensorModul* sm )
555
void initStat( struct SensorModul* sm )
551
{
556
{
552
  /* The CPU load is calculated from the values in /proc/stat. The cpu
557
  /* The CPU load is calculated from the values in /proc/stat. The cpu
553
   * entry contains 4 counters. These counters count the number of ticks
558
   * entry contains 7 counters. These counters count the number of ticks
554
   * the system has spend on user processes, system processes, nice
559
   * the system has spend on user processes, system processes, nice
555
   * processes and idle time.
560
   * processes, idle and IO-wait time, hard and soft interrupts.
556
   *
561
   *
557
   * SMP systems will have cpu1 to cpuN lines right after the cpu info. The
562
   * SMP systems will have cpu1 to cpuN lines right after the cpu info. The
558
   * format is identical to cpu and reports the information for each cpu.
563
   * format is identical to cpu and reports the information for each cpu.
Lines 560-566 Link Here
560
   *
565
   *
561
   * The /proc/stat file looks like this:
566
   * The /proc/stat file looks like this:
562
   *
567
   *
563
   * cpu  1586 4 808 36274
568
   * cpu  <user> <nice> <system> <idling> <waiting> <hardinterrupt> <softinterrupt>
564
   * disk 7797 0 0 0
569
   * disk 7797 0 0 0
565
   * disk_rio 6889 0 0 0
570
   * disk_rio 6889 0 0 0
566
   * disk_wio 908 0 0 0
571
   * disk_wio 908 0 0 0
Lines 606-611 Link Here
606
      registerMonitor( "cpu/nice", "integer", printCPUNice, printCPUNiceInfo, StatSM );
611
      registerMonitor( "cpu/nice", "integer", printCPUNice, printCPUNiceInfo, StatSM );
607
      registerMonitor( "cpu/sys", "integer", printCPUSys, printCPUSysInfo, StatSM );
612
      registerMonitor( "cpu/sys", "integer", printCPUSys, printCPUSysInfo, StatSM );
608
      registerMonitor( "cpu/idle", "integer", printCPUIdle, printCPUIdleInfo, StatSM );
613
      registerMonitor( "cpu/idle", "integer", printCPUIdle, printCPUIdleInfo, StatSM );
614
      registerMonitor( "cpu/wait", "integer", printCPUWait, printCPUWaitInfo, StatSM );
609
    } else if ( strncmp( "cpu", tag, 3 ) == 0 ) {
615
    } else if ( strncmp( "cpu", tag, 3 ) == 0 ) {
610
      char cmdName[ 24 ];
616
      char cmdName[ 24 ];
611
      /* Load for each SMP CPU */
617
      /* Load for each SMP CPU */
Lines 621-626 Link Here
621
      registerMonitor( cmdName, "integer", printCPUxSys, printCPUxSysInfo, StatSM );
627
      registerMonitor( cmdName, "integer", printCPUxSys, printCPUxSysInfo, StatSM );
622
      sprintf( cmdName, "cpu%d/idle", id );
628
      sprintf( cmdName, "cpu%d/idle", id );
623
      registerMonitor( cmdName, "integer", printCPUxIdle, printCPUxIdleInfo, StatSM );
629
      registerMonitor( cmdName, "integer", printCPUxIdle, printCPUxIdleInfo, StatSM );
630
      sprintf( cmdName, "cpu%d/wait", id );
631
      registerMonitor( cmdName, "integer", printCPUxWait, printCPUxWaitInfo, StatSM );
624
    } else if ( strcmp( "disk", tag ) == 0 ) {
632
    } else if ( strcmp( "disk", tag ) == 0 ) {
625
      unsigned long val;
633
      unsigned long val;
626
      char* b = buf + 5;
634
      char* b = buf + 5;
Lines 853-858 Link Here
853
  fprintf( CurrentClient, "CPU Idle Load\t0\t100\t%%\n" );
861
  fprintf( CurrentClient, "CPU Idle Load\t0\t100\t%%\n" );
854
}
862
}
855
863
864
void printCPUWait( const char* cmd )
865
{
866
  (void)cmd;
867
868
  if ( Dirty )
869
    processStat();
870
871
  fprintf( CurrentClient, "%d\n", CPULoad.waitLoad );
872
}
873
874
void printCPUWaitInfo( const char* cmd )
875
{
876
  (void)cmd;
877
  fprintf( CurrentClient, "CPU Wait Load\t0\t100\t%%\n" );
878
}
879
856
void printCPUxUser( const char* cmd )
880
void printCPUxUser( const char* cmd )
857
{
881
{
858
  int id;
882
  int id;
Lines 929-934 Link Here
929
  fprintf( CurrentClient, "CPU%d Idle Load\t0\t100\t%%\n", id );
953
  fprintf( CurrentClient, "CPU%d Idle Load\t0\t100\t%%\n", id );
930
}
954
}
931
955
956
void printCPUxWait( const char* cmd )
957
{
958
  int id;
959
960
  if ( Dirty )
961
    processStat();
962
963
  sscanf( cmd + 3, "%d", &id );
964
  fprintf( CurrentClient, "%d\n", SMPLoad[ id ].waitLoad );
965
}
966
967
void printCPUxWaitInfo( const char* cmd )
968
{
969
  int id;
970
971
  sscanf( cmd + 3, "%d", &id );
972
  fprintf( CurrentClient, "CPU%d Wait Load\t0\t100\t%%\n", id );
973
}
974
932
void printDiskTotal( const char* cmd )
975
void printDiskTotal( const char* cmd )
933
{
976
{
934
  int id;
977
  int id;
(-)ksysguard.orig/ksysguardd/Linux/stat.h (+4 lines)
Lines 34-39 Link Here
34
void printCPUSysInfo( const char* );
34
void printCPUSysInfo( const char* );
35
void printCPUIdle( const char* );
35
void printCPUIdle( const char* );
36
void printCPUIdleInfo( const char* );
36
void printCPUIdleInfo( const char* );
37
void printCPUWait( const char* );
38
void printCPUWaitInfo( const char* );
37
void printCPUxUser( const char* );
39
void printCPUxUser( const char* );
38
void printCPUxUserInfo( const char* );
40
void printCPUxUserInfo( const char* );
39
void printCPUxNice( const char* );
41
void printCPUxNice( const char* );
Lines 42-47 Link Here
42
void printCPUxSysInfo( const char* );
44
void printCPUxSysInfo( const char* );
43
void printCPUxIdle( const char* );
45
void printCPUxIdle( const char* );
44
void printCPUxIdleInfo( const char* );
46
void printCPUxIdleInfo( const char* );
47
void printCPUxWait( const char* );
48
void printCPUxWaitInfo( const char* );
45
void printDiskTotal( const char* );
49
void printDiskTotal( const char* );
46
void printDiskTotalInfo( const char* );
50
void printDiskTotalInfo( const char* );
47
void printDiskRIO( const char* );
51
void printDiskRIO( const char* );

Return to bug 88581