Skip to content

Instantly share code, notes, and snippets.

@shawn-sterling
Created June 24, 2014 21:20
Show Gist options
  • Save shawn-sterling/84ee929c54542e5119d1 to your computer and use it in GitHub Desktop.
Save shawn-sterling/84ee929c54542e5119d1 to your computer and use it in GitHub Desktop.
gather info for virtual cpus
#!/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