[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-extra-gear
Subject:    [Kde-extra-gear] KCPULoad for more than 2 CPUs
From:       Johannes Sixt <johannes.sixt () telecom ! at>
Date:       2005-12-02 21:54:13
Message-ID: 200512022254.13510.johannes.sixt () telecom ! at
[Download RAW message or body]

I've a Dual Xeon box with hyperthreading, i.e. 4 logical CPUs. Unfortunately, 
KCPULoad can't display more than 2 CPUs. I have created a series of patches
which make KCPULoad display as many graphs as there are CPUs. I have submitted 
the patches to Ben Burton, who is listed as maintainer, but have not received 
any response from him nor were the patches applied. Is someone willing to 
apply them?

The patches must be applied as they are numbered. (or apply 
http://members.nextra.at/johsixt/kcpuload/manycpus.diff, which is the 
cumulation of the individual patches.) They are against kcpuload 
svn revision 420912. There was one relevant change since then, but there is 
appearently no conflict.

The patch also affects the translatable strings, but I have not done anything 
in this respect. Furthermore, the two icons for the color menu entry that 
have the digits '0' and '1' overlaid become obsolete and can be removed. (The 
patches can't remove binary files.)

Here's the diffstat of the cumulated patches:

 kcpuload.cpp  |  115 +++++++++++++++-----------
 kcpuload.h    |    5 +
 kcpuproc.cpp  |  158 +++++++++++++-----------------------
 kcpuproc.h    |  218 +++++++++++++++++++++-----------------------------
 statpopup.cpp |  176 +++++++++++++++++-----------------------
 statpopup.h   |   61 ++++++-------
 6 files changed, 325 insertions(+), 408 deletions(-)

Less code, more functionality!! *g*

The BSD-specific code compiles, but I don't know whether it still works.

Below I briefly explain what each patch does.

-- Hannes

* step1-structTicks.diff
http://members.nextra.at/johsixt/kcpuload/step1-structTicks.diff

Merges the individual and explicitly numbered variables for the readings into 
a struct Ticks. The struct has functions that return the system, user, 
non-idle (total), and elapsed time.

* step2-structCPU.diff
http://members.nextra.at/johsixt/kcpuload/step2-structCPU.diff

This is basically a code cleanup by moving individual variables into a new 
struct CPU. Parsing /proc/stat is moved into a (Linux-specific) function.

* step3-noexplicitpercent.diff
http://members.nextra.at/johsixt/kcpuload/step3-noexplicitpercent.diff

This patch further cleans up the code by using the previously introduced 
functions of struct CPU instead of the explicitly numbered (and unnumbered) 
percentage functions.

* step4-dynamicreadings.diff
http://members.nextra.at/johsixt/kcpuload/step4-dynamicreadings.diff

This patch now makes the array of readings dynamically adapt to the number of 
CPUs found in /proc/stat. It also reduces the number of sections where Linux 
and BSD specific code is used. The Linux part now no longer needs to 
special-case the SMP case.

* step5-structReading.diff
http://members.nextra.at/johsixt/kcpuload/step5-structReading.diff

Here we put the individual and explicitly numbered variables for the dock 
windows into a new struct Reading.

* step6-singlecolorentry.diff
http://members.nextra.at/johsixt/kcpuload/step6-singlecolorentry.diff

Now we restructure the context menu: It no longer contains entries to change 
color for all CPUs, but only a single entry that applies to the dock where 
the context menu is invoked.

* step7-simplifycheckmark.diff
http://members.nextra.at/johsixt/kcpuload/step7-simplifycheckmark.diff

This simplifies the initialization of the checkmarked style entry. (Because we 
need to avoid the calls to the slots setFill...().)

* step8-dynamicdocks.diff
http://members.nextra.at/johsixt/kcpuload/step8-dynamicdocks.diff

This final big patch makes the array of docks dynamic. (I was unable to break 
this patch in smaller parts.)
_______________________________________________
Kde-extra-gear mailing list
Kde-extra-gear@kde.org
https://mail.kde.org/mailman/listinfo/kde-extra-gear
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic