Commit 547e9e2
committed
tools/power turbostat: Fix incorrect sorting of PMT telemetry
JIRA: https://issues.redhat.com/browse/RHEL-127415
commit cafb47b
Author: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
Date: Sat Aug 9 10:35:15 2025 +0530
tools/power turbostat: Fix incorrect sorting of PMT telemetry
The pmt_telemdir_sort() comparison function was returning a boolean
value (0 or 1) instead of the required negative, zero, or positive
value for proper sorting. This caused unpredictable and incorrect
ordering of telemetry directories named telem0, telem1, ..., telemN.
Update the comparison logic to return -1, 0, or 1 based on the
numerical value extracted from the directory name, ensuring correct
numerical ordering when using scandir.
This change improves stability and correctness when iterating PMT
telemetry directories.
Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
(cherry picked from commit cafb47b)
Assisted-by: Patchpal
Signed-off-by: David Arcari <darcari@redhat.com>1 parent 2c141fa commit 547e9e2
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1890 | 1890 | | |
1891 | 1891 | | |
1892 | 1892 | | |
1893 | | - | |
| 1893 | + | |
1894 | 1894 | | |
1895 | 1895 | | |
1896 | 1896 | | |
| |||
0 commit comments