Package: xosview
Version: 1.8.3+debian-8guest
Severity: wishlist
Tags: patch

Hello,

Linux 2.6.24 added a ninth value on the cpu lines of /proc/stat. The
attached patch shows it in xosview.

Samuel

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'oldstable'), (500, 'unstable'), (500, 
'stable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.25
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/bash

Versions of packages xosview depends on:
ii  libc6                         2.7-10     GNU C Library: Shared libraries
ii  libgcc1                       1:4.3.0-5  GCC support library
ii  libstdc++6                    4.3.0-5    The GNU Standard C++ Library v3
ii  libx11-6                      2:1.0.3-7  X11 client-side library

xosview recommends no packages.

-- no debconf information

-- 
Samuel
Be warned that typing \fBkillall \fIname\fP may not have the desired
effect on non-Linux systems, especially when done by a privileged user.
(From the killall manual page)
diff -ur xosview-1.8.3+debian/linux/cpumeter.cc 
xosview-1.8.3+debian-mine/linux/cpumeter.cc
--- xosview-1.8.3+debian/linux/cpumeter.cc      2008-06-18 23:20:20.000000000 
+0100
+++ xosview-1.8.3+debian-mine/linux/cpumeter.cc 2008-06-18 23:09:20.000000000 
+0100
@@ -19,10 +19,10 @@
 #define MAX_PROCSTAT_LENGTH 4096
 
 CPUMeter::CPUMeter(XOSView *parent, const char *cpuID)
-: FieldMeterGraph( parent, 8, toUpper(cpuID), "USR/NICE/SYS/SI/HI/WIO/FREE/ST" 
) {
+: FieldMeterGraph( parent, 9, toUpper(cpuID), 
"USR/NICE/SYS/SI/HI/WIO/FREE/GST/ST" ) {
   _lineNum = findLine(cpuID);
   for ( int i = 0 ; i < 2 ; i++ )
-    for ( int j = 0 ; j < 8 ; j++ )
+    for ( int j = 0 ; j < 9 ; j++ )
       cputime_[i][j] = 0;
   cpuindex_ = 0;
 
@@ -41,7 +41,8 @@
   setfieldcolor( 4, parent_->getResource( "cpuInterruptColor" ) );
   setfieldcolor( 5, parent_->getResource( "cpuWaitColor" ) );
   setfieldcolor( 6, parent_->getResource( "cpuFreeColor" ) );
-  setfieldcolor( 7, parent_->getResource( "cpuStolenColor" ) );
+  setfieldcolor( 7, parent_->getResource( "cpuGuestColor" ) );
+  setfieldcolor( 8, parent_->getResource( "cpuStolenColor" ) );
   priority_ = atoi (parent_->getResource( "cpuPriority" ) );
   dodecay_ = parent_->isResourceTrue( "cpuDecay" );
   useGraph_ = parent_->isResourceTrue( "cpuGraph" );
@@ -77,18 +78,19 @@
              >>cputime_[cpuindex_][4]
              >>cputime_[cpuindex_][5]
              >>cputime_[cpuindex_][6]
-             >>cputime_[cpuindex_][7];
+             >>cputime_[cpuindex_][7]
+             >>cputime_[cpuindex_][8];
 
   int oldindex = (cpuindex_+1)%2;
-  for ( int i = 0 ; i < 8 ; i++ ){
-    static int cputime_to_field[8] = { 0, 1, 2, 6, 5, 4, 3, 7 };
+  for ( int i = 0 ; i < 9 ; i++ ){
+    static int cputime_to_field[9] = { 0, 1, 2, 6, 5, 4, 3, 8, 7 };
     int field = cputime_to_field[i];
     fields_[field] = cputime_[cpuindex_][i] - cputime_[oldindex][i];
     total_ += fields_[field];
   }
 
   if (total_){
-    setUsed (total_ - (fields_[5] + fields_[6] + fields_[7]), total_);
+    setUsed (total_ - (fields_[5] + fields_[6] + fields_[7] + fields_[8]), 
total_);
     cpuindex_ = (cpuindex_ + 1) % 2;
   }
 }
diff -ur xosview-1.8.3+debian/linux/cpumeter.h 
xosview-1.8.3+debian-mine/linux/cpumeter.h
--- xosview-1.8.3+debian/linux/cpumeter.h       2008-06-18 23:20:20.000000000 
+0100
+++ xosview-1.8.3+debian-mine/linux/cpumeter.h  2008-06-18 23:18:38.000000000 
+0100
@@ -25,7 +25,7 @@
   static const char *cpuStr(int num);
 protected:
   int _lineNum;
-  long cputime_[2][8];
+  long cputime_[2][9];
   int cpuindex_;
 
   void getcputime(void);
diff -ur xosview-1.8.3+debian/Xdefaults xosview-1.8.3+debian-mine/Xdefaults
--- xosview-1.8.3+debian/Xdefaults      2008-06-18 23:20:20.000000000 +0100
+++ xosview-1.8.3+debian-mine/Xdefaults 2008-06-18 23:09:33.000000000 +0100
@@ -75,7 +75,8 @@
 xosview*cpuSoftIntColor:    red
 xosview*cpuWaitColor:       lightblue
 xosview*cpuFreeColor:       aquamarine
-xosview*cpuStolenColor:     blue
+xosview*cpuGuestColor:      blue
+xosview*cpuStolenColor:     purple
 xosview*cpuPriority:        1
 xosview*cpuDecay:           True
 xosview*cpuGraph:           True
diff -ur xosview-1.8.3+debian/Xdefaults.in 
xosview-1.8.3+debian-mine/Xdefaults.in
--- xosview-1.8.3+debian/Xdefaults.in   2008-06-18 23:20:20.000000000 +0100
+++ xosview-1.8.3+debian-mine/Xdefaults.in      2008-06-18 23:09:20.000000000 
+0100
@@ -75,7 +75,8 @@
 xosview*cpuSoftIntColor:    red
 xosview*cpuWaitColor:       lightblue
 xosview*cpuFreeColor:       aquamarine
-xosview*cpuStolenColor:     blue
+xosview*cpuGuestColor:      blue
+xosview*cpuStolenColor:     purple
 xosview*cpuPriority:        1
 xosview*cpuDecay:           True
 xosview*cpuGraph:           True
diff -ur xosview-1.8.3+debian/Xdefaults.stipple 
xosview-1.8.3+debian-mine/Xdefaults.stipple
--- xosview-1.8.3+debian/Xdefaults.stipple      2008-06-18 23:20:20.000000000 
+0100
+++ xosview-1.8.3+debian-mine/Xdefaults.stipple 2008-06-18 23:09:20.000000000 
+0100
@@ -12,6 +12,7 @@
 xosvstipple*cpuInterruptColor:  red
 xosvstipple*cpuSInterruptColor: red
 xosvstipple*cpuFreeColor:       red
+xosvstipple*cpuGuestColor:      red
 xosvstipple*cpuStolenColor:     red
 xosvstipple*memUsedColor:      orange
 xosvstipple*memSharedColor:    orange
@@ -51,6 +52,7 @@
 xosvstipplebw*cpuInterruptColor:black
 xosvstipplebw*cpuSInterruptColor:black
 xosvstipplebw*cpuFreeColor:    black
+xosvstipplebw*cpuGuestColor:   black
 xosvstipplebw*cpuStolenColor:  black
 xosvstipplebw*memUsedColor:    black
 xosvstipplebw*memSharedColor:  black

Reply via email to