[Bug 201531] [NEW] kde-guidance-powermanager shows extraneous CPU on kernel 2.6.24

rg0now retvari at tmit.bme.hu
Wed Mar 12 19:40:13 UTC 2008


Public bug reported:

Binary package hint: kde-guidance

The info panel brought up by clicking on the kde-guidance-powermanager
systray icon shows 3 CPUs instead of the correct 2. While the third CPU
is greyed out, this is still a bit confusing and very annoying.

The problem comes from the cpuidle framework introduced in newer kernels
(like 2.6.24), which adds an additional directory entry in
'/sys/devices/system/cpu', which is parsed erroneously by kde-guidance-
powermanager as an additional CPU.

More specifically, I tracked down the problem to 'powermanage.py', line
306

    def _checkCpuCapabilities(self):
        """ Find out the number of CPUs / cores, check which governors are avaible."""
        cpufreq_dir = "/sys/devices/system/cpu"
        self.cpus = []
        for cpu in os.listdir(cpufreq_dir):
            if cpu.startswith('cpu'):
                self.cpus.append(cpu)

While on older kernels, the condition "cpu.startswith('cpu)" works fine,
on recent kernels a new directory called "cpuidle" appeared in this
directory, which also matches the 'if' condition, and thusly an
extraneous CPU is added the 'self.cpus' list, which is clearly wrong.

To correct this problem, change the if condition to:

            if re.compile('cpu\d+').match(cpu):

(and don't forget to import 're'), which specifically matches for CPUs.

This is Ubuntu 7.10, gutsy, kde-guidance-powermanager version
0.8.0svn20070928-0ubuntu7

Patch attached.

** Affects: kde-guidance (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: cpu extra guidance kde powermanager

-- 
kde-guidance-powermanager shows extraneous CPU on kernel 2.6.24
https://bugs.launchpad.net/bugs/201531
You received this bug notification because you are a member of Kubuntu
Team, which is subscribed to kde-guidance in ubuntu.




More information about the kubuntu-bugs mailing list