Bug 271918 - system load viewer not updating if "show usage of all processors" is checked
Summary: system load viewer not updating if "show usage of all processors" is checked
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Plasma
Component: widget-systemmonitor (show other bugs)
Version: unspecified
Platform: Debian unstable Linux
: NOR normal
Target Milestone: ---
Assignee: Matthew Dawson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-28 14:01 UTC by Marc Haber
Modified: 2011-11-13 04:31 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.0


Attachments
Proposed fix: Explicit typecasts for generation of m_numCPUs (1.18 KB, patch)
2011-06-23 13:49 UTC, emw-kdebugs
Details
added comment for prev fix (983 bytes, patch)
2011-07-03 11:19 UTC, emw-kdebugs
Details
extended comment about prev. fix (1.09 KB, patch)
2011-07-03 11:19 UTC, emw-kdebugs
Details
Patch: added temporary explicit QVariant variable to SystemLoadViewer::dataUpdated (5.63 KB, patch)
2011-07-03 11:20 UTC, emw-kdebugs
Details
Patch: fallback to standard cpu/system/* resources (3.60 KB, patch)
2011-07-03 11:21 UTC, emw-kdebugs
Details
Patch: Always connect to the resource system/cores (1.39 KB, patch)
2011-07-03 11:21 UTC, emw-kdebugs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Haber 2011-04-28 14:01:56 UTC
Version:           unspecified (using KDE 4.6.2) 
OS:                Linux

Hi,

when I activate "show usage of all processors" in system load viewer to get a better view of my system load, system load viewer stops updating the bars in the panel.

Greetings
Marc


Reproducible: Always

Steps to Reproduce:
Right click on system load viewer widget, call up settings screen, check "show usage of all processors", click OK, see bars freeze.

Actual Results:  
Bars are not updated any more, three bars still shown

Expected Results:  
four moving bars.
Comment 1 emw-kdebugs 2011-06-23 13:49:27 UTC
Created attachment 61266 [details]
Proposed fix: Explicit typecasts for generation of m_numCPUs

Hi all,

this patch has been created while debugging this issue on my system (Debian/sid KDE 4.6.3, systemloadviewer applet from source, kdeplasma-addons.git, remotes/origin/4.6) code. The problem was caused by the line 

    m_numCPUs = sys_mon->query("system/cores")["value"].toUInt();

which returned 0 in m_numCPUs. For debugging reasons, I split the expression and typecasts in multiple explicit assignments/casts and it "suddenly" worked. Unfortunately, I don't have more time to analyze the reasons in depth. Anyway, I hope, the patch is sufficiently clean for inclusion in the git repository.

Best regards, Martin
Comment 2 emw-kdebugs 2011-07-03 11:15:48 UTC
Hi all,

after having some more problems with two instances of this applet at session startup (the one instance recognized all cores, the other one did not), I did some more debugging. The result is the following patch set, also including the previous patch for completeness.

Patches 0001--0003:
   The previous fix for explicit type casts. Might not be necessary any more.
   0002/0003 add a comment for that change.

Patch 0004:
   Added a temporary variable in SystemLoadViewer::dataUpdated for 
   data["value"]. Although not necessary to fix anything, it came 
   out of the debugging session. For coding style reasons, I'd 
   prefer to keep this change.

Patch 0005:
   A fix to display at least the system CPU usage if m_showMultiCPU is 
   requested and we don't know the number of cores.

Patch 0006:
   *The* fix for the m_numCPUs = 0 problem. It seems that the applet 
   does not always/automatically get signal sourceAdded("system/cores").
   Thus we explicitly connect to that resource.
Comment 3 emw-kdebugs 2011-07-03 11:19:07 UTC
Created attachment 61567 [details]
added comment for prev fix
Comment 4 emw-kdebugs 2011-07-03 11:19:39 UTC
Created attachment 61568 [details]
extended comment about prev. fix
Comment 5 emw-kdebugs 2011-07-03 11:20:30 UTC
Created attachment 61569 [details]
Patch: added temporary explicit QVariant variable to SystemLoadViewer::dataUpdated
Comment 6 emw-kdebugs 2011-07-03 11:21:12 UTC
Created attachment 61570 [details]
Patch: fallback to standard cpu/system/* resources
Comment 7 emw-kdebugs 2011-07-03 11:21:50 UTC
Created attachment 61571 [details]
Patch: Always connect to the resource system/cores
Comment 8 Matthew Dawson 2011-11-13 04:28:03 UTC
Git commit f0ca12ab794063527a0537bce701423f97bb5972 by Matthew Dawson.
Committed on 13/11/2011 at 04:35.
Pushed by mdawson into branch 'KDE/4.7'.

Fix issue with the system/cores value not being received.

The systemmonitor data engine is 100% asynchronous.  Unfortunately this
makes polling any source impossible.  This caused a hard to pin down
bug related to certain cpu sources not being connected.  To correct this
the system/cores value is now properly polled.  This should avoid/fix
any issues with 'show usage of all processors' option.
BUG: 271918
FIXED-IN: 4.7.4

M  +54   -48   applets/systemloadviewer/systemloadviewer.cpp

http://commits.kde.org/kdeplasma-addons/f0ca12ab794063527a0537bce701423f97bb5972
Comment 9 Matthew Dawson 2011-11-13 04:28:06 UTC
Git commit e19afaf10f0acc72cb2fce1ba9660868a7ffdfac by Matthew Dawson.
Committed on 13/11/2011 at 04:35.
Pushed by mdawson into branch 'master'.

Fix issue with the system/cores value not being received.

The systemmonitor data engine is 100% asynchronous.  Unfortunately this
makes polling any source impossible.  This caused a hard to pin down
bug related to certain cpu sources not being connected.  To correct this
the system/cores value is now properly polled.  This should avoid/fix
any issues with 'show usage of all processors' option.
BUG: 271918
FIXED-IN: 4.8.0

M  +54   -48   applets/systemloadviewer/systemloadviewer.cpp

http://commits.kde.org/kdeplasma-addons/e19afaf10f0acc72cb2fce1ba9660868a7ffdfac