Bug 478079 - Plasma System Monitor reporting incorrect CPU usage for applications
Summary: Plasma System Monitor reporting incorrect CPU usage for applications
Status: RESOLVED FIXED
Alias: None
Product: plasma-systemmonitor
Classification: Applications
Component: general (show other bugs)
Version: 5.90.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2023-12-04 20:43 UTC by dominickator122102
Modified: 2023-12-06 11:26 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
As you can see the CPU usage for Firefox is more then the entire system is using. (148.34 KB, image/png)
2023-12-04 20:43 UTC, dominickator122102
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dominickator122102 2023-12-04 20:43:28 UTC
Created attachment 163866 [details]
As you can see the CPU usage for Firefox is more then the entire system is using.

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

When looking at the Applications menu under the system monitor home page CPU usage is incorrectly reported on a per app basis.

STEPS TO REPRODUCE
1. Open system monitor with Firefox open.
2. Look at the per application cpu usage.

OBSERVED RESULT
Firefox is reporting 9% usage of my CPU when the total CPU usage is shown as just over 6%.

EXPECTED RESULT
The CPU usage for Firefox should not be more then the total CPU usage

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
(available in About System)
KDE Plasma Version: 5.90
KDE Frameworks Version: 5.246.0
Qt Version: 6.6.1

ADDITIONAL INFORMATION
Comment 1 fanzhuyifan 2023-12-05 00:31:19 UTC
I think the CPU usage for the apps is calculated with 100% being fully using a single core, while for the entire system 100% means fully using all the cores in the system.
Comment 2 Arjen Hiemstra 2023-12-05 15:07:04 UTC
https://invent.kde.org/plasma/plasma-systemmonitor/-/merge_requests/242

When using the "scaled" display style (the default) usage should be scaled by the total number of cores. That broke in 6 due to some changes with tables.
Comment 3 Arjen Hiemstra 2023-12-06 11:26:26 UTC
Git commit ec2b8120bc17ab53f3eae08ad157484b3bc82412 by Arjen Hiemstra.
Committed on 06/12/2023 at 12:24.
Pushed by ahiemstra into branch 'master'.

table: Use base delegate text in cell delegates

We want to be able to override the cell text, which hardcoding to
model.display breaks. Instead, we can use the text property of the
delegate and default that to model.display.

M  +2    -0    src/table/BaseCellDelegate.qml
M  +1    -1    src/table/FirstCellDelegate.qml
M  +2    -2    src/table/LineChartCellDelegate.qml
M  +1    -2    src/table/TextCellDelegate.qml

https://invent.kde.org/plasma/plasma-systemmonitor/-/commit/ec2b8120bc17ab53f3eae08ad157484b3bc82412