Created attachment 140345 [details] Screenshot of the CPUs sensor group list. SUMMARY On my 12-thread CPU, when I try adding CPU statistics to a plasma-systemmonitor graph, the sorting order of my CPU cores is incorrect. STEPS TO REPRODUCE 1. Open plasma-systemmonitor. 2. Click "Add New Page..." and "Add". 3. Click the "System Monitor Sensor", and in the right sidebar, click Total Sensors or Sensors. 4. Click "CPUs" and look at the list of sensor groups. OBSERVED RESULT The sort order is "All, Core 1, Core 2, Core 11, Core 12, Core 3..., Core 10, [Group] CPU". EXPECTED RESULT Cores are sorted in numeric order (I think)? SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 5.22.3 KDE Frameworks Version: 5.84.0 Qt Version: 5.15.2 Kernel Version: 5.13.4-zen2-1-zen (64-bit) Graphics Platform: X11 Processors: 12 × AMD Ryzen 5 5600X 6-Core Processor Memory: 15.6 GiB of RAM Graphics Processor: NVIDIA GeForce GT 730/PCIe/SSE2 ADDITIONAL INFORMATION I don't know where the order comes from, or if there's a technical explanation for the strange order. I don't think the 5600X is NUMA, so that shouldn't be it.
We sort the ids lexicographic, what we should do is sort the visible strings
A possibly relevant merge request was started @ https://invent.kde.org/plasma/ksystemstats/-/merge_requests/15
*** Bug 453192 has been marked as a duplicate of this bug. ***
Git commit debcb7ce19068fb5798c343d3bd572eaef4de0a7 by Arjen Hiemstra. Committed on 13/06/2022 at 14:49. Pushed by ahiemstra into branch 'master'. Sensors: Port SensorTreeModel to std::map so we can use a custom compare Currently, the tree ends up being sorted with numbers sorted as characters. Since the sorting happens in the map, if we want to sort things differently we need to override the sorting function. QMap does not support that so use std::map instead with a custom compare object. M +56 -21 sensors/SensorTreeModel.cpp https://invent.kde.org/plasma/libksysguard/commit/debcb7ce19068fb5798c343d3bd572eaef4de0a7