Created
June 24, 2014 21:20
-
-
Save shawn-sterling/84ee929c54542e5119d1 to your computer and use it in GitHub Desktop.
gather info for virtual cpus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CPULIST=$(ls -d /sys/devices/system/cpu/cpu[0-9]* |sort -tu -k3 -n) | |
echo "shared L2 cache (cat /sys/devices/system/cpu/cpu[0-9]*/cache/index2/shared_cpu_map)" | |
for i in $CPULIST; do | |
A=$(printf $i|cut -d"/" -f6) | |
printf "$A - " | |
cat $i/cache/index2/shared_cpu_map | |
done | |
echo "shared L3 cache (cat /sys/devices/system/cpu/cpu[0-9]*/cache/index3/shared_cpu_map)" | |
for i in $CPULIST; do | |
A=$(printf $i|cut -d"/" -f6) | |
printf "$A - " | |
cat $i/cache/index3/shared_cpu_map | |
done | |
echo "thread siblings (cat /sys/devices/system/cpu/cpu[0-9]*/topology/thread_siblings_list)" | |
for i in $CPULIST; do | |
A=$(printf $i|cut -d"/" -f6) | |
printf "$A - " | |
cat $i/topology/thread_siblings_list | |
done | |
echo "core siblings /sys/devices/system/cpu/cpu[0-9]*/topology/core_siblings_list)" | |
for i in $CPULIST; do | |
A=$(printf $i|cut -d"/" -f6) | |
printf "$A - " | |
cat $i/topology/core_siblings_list | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment