#!/bin/bash
echo "=== CPU INFO ==="
lscpu | grep -E 'Model name|CPU.s.|MHz|Thread|Core|Socket|Boost'
echo "=== CPUFREQ GOVERNOR ==="
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null || echo "no cpufreq governor"
echo "=== CPUFREQ AVAILABLE GOVERNORS ==="
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors 2>/dev/null || echo "none"
echo "=== CPUFREQ MIN/MAX ==="
echo "min: $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 2>/dev/null || echo N/A)"
echo "max: $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 2>/dev/null || echo N/A)"
echo "cur: $(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq 2>/dev/null || echo N/A)"
echo "cpuinfo_max: $(cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq 2>/dev/null || echo N/A)"
echo "=== BOOST ==="
cat /sys/devices/system/cpu/cpufreq/boost 2>/dev/null || echo "no boost sysfs"
echo "=== MSR BOOST ==="
sudo rdmsr 0xC0010015 2>/dev/null || echo "rdmsr not available"
echo "=== ACTUAL FREQ PER CORE ==="
for i in 0 1 2 3 4 5; do
  freq=$(cat /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_cur_freq 2>/dev/null || echo "N/A")
  echo "CPU${i}: ${freq} kHz"
done
echo "=== AMD PSTATE ==="
cat /sys/devices/system/cpu/amd_pstate/status 2>/dev/null || echo "no amd_pstate"
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver 2>/dev/null || echo "no scaling_driver"
