-#!/bin/bash
+#!/bin/sh
-for i in $(ls -1 /sys/devices/system/cpu | grep -E cpu\[0-9\]);
- do printf $i\ && cat /sys/devices/system/cpu/$i/acpi_cppc/highest_perf; done |\
- sort -k2 -r | head -n12
+echo "Best high-performing CCX1 cores:"
+i=0
+while [ $i -ne 8 ]
+ do
+ printf "cpu$i %s\n" $(cat /sys/devices/system/cpu/cpu$i/acpi_cppc/highest_perf);
+ i=$(("$i"+1));
+ done
+echo "Best high-performing CCX2 cores:"
+i=8
+while [ $i -ne 16 ]
+ do
+ printf "cpu$i %s\n" $(cat /sys/devices/system/cpu/cpu$i/acpi_cppc/highest_perf);
+ i=$(("$i"+1));
+ done
+
+# echo "Best low-performing cores:"
+# i=0
+# while [ $i -ne 15 ]
+# do
+# printf "cpu$i %s\n" $(cat /sys/devices/system/cpu/cpu$i/acpi_cppc/lowest_perf);
+# i=$(("$i"+1));
+# done