Bug 435062

Summary: System monitor sensor reports number of CPUs as 0 (zero)
Product: [Plasma] plasmashell Reporter: Patrick Silva <bugseforuns>
Component: System Monitor widgetsAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: ahiemstra, nate, notmart
Priority: NOR    
Version: master   
Target Milestone: 1.0   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In: 5.22
Sentry Crash Report:
Attachments: screenshot
contents of /proc/cpuinfo

Description Patrick Silva 2021-03-28 13:12:29 UTC
Created attachment 137130 [details]
screenshot

SUMMARY
CPU of my laptop is intel i3 3110m.

https://ark.intel.com/content/www/br/pt/ark/products/65700/intel-core-i3-3110m-processor-3m-cache-2-40-ghz.html

According to system monitor sensor, the number of CPUs on my system is zero.
See the attached screenshot please.

EXPECTED RESULT
system monitor sensor should detect the number of CPUs correctly.

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.21.80
KDE Frameworks Version: 5.81.0
Qt Version: 5.15.2
Graphics Platform: Wayland
Comment 1 Arjen Hiemstra 2021-03-28 13:35:48 UTC
Can you attach the contents of /proc/cpuinfo?
Comment 2 Patrick Silva 2021-03-28 13:51:37 UTC
Created attachment 137132 [details]
contents of /proc/cpuinfo
Comment 3 Bug Janitor Service 2021-04-29 09:17:50 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/ksystemstats/-/merge_requests/3
Comment 4 Arjen Hiemstra 2021-04-29 09:29:33 UTC
Git commit 8208a1510af95263c7cabd5d01a849018a1e1f99 by Arjen Hiemstra.
Committed on 29/04/2021 at 09:17.
Pushed by ahiemstra into branch 'master'.

Fix off-by-one for cpuCount on Linux

cpuCount is based on cpu indices, which means we will be one lower than
the actual CPU count. So correct for that.
FIXED-IN: 5.22

M  +4    -0    plugins/cpu/linuxcpuplugin.cpp

https://invent.kde.org/plasma/ksystemstats/commit/8208a1510af95263c7cabd5d01a849018a1e1f99
Comment 5 Patrick Silva 2021-05-04 11:45:08 UTC
This bug persists on neon unstable.

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.21.80
KDE Frameworks Version: 5.82.0
Qt Version: 5.15.2
Graphics Platform: X11
Comment 6 Patrick Silva 2021-05-04 20:48:48 UTC
ops, fixed with updates installed a few minutes ago. Sorry for noise.