"showsystem" 45 lines, 1448 characters
#!/bin/bash
banner=`uname -a`
kernelid=`uname -v`
machinemodel=`prtdiag -v | head -1 | sed 's/System Configuration: Sun Microsystems //'`
raminfo=`prtdiag -v | grep "Memory size"`
echo $banner
echo
echo "Kernel:$kernelid "
echo "Model:$machinemodel "
echo $raminfo
echo
nproc=`(/usr/bin/kstat -m cpu_info | grep chip_id | sort -u | wc -l | tr -d ' ')`
vproc=`(/usr/bin/kstat -m cpu_info | grep 'module: cpu_info' | sort -u | wc -l | tr -d ' ')`
#ncore=`(/usr/bin/kstat -m cpu_info | grep core_id | sort -u | wc -l | tr -d ' ')`
ncore=`(/usr/bin/kstat -m cpu_info | grep core_id | awk '{ print $2 }'| sort -u | wc -l | tr -d ' ')` #thanks to James Ervin#
nstrandspercore=$(($vproc/$ncore))
ncoresperproc=$(($ncore/$nproc))
echo "Total number of physical processors: $nproc"
echo "Number of virtual processors: $vproc"
echo "Total number of cores: $ncore"
echo "Number of cores per physical processor: $ncoresperproc"
echo "Number of hardware threads (strands or vCPUs) per core: $nstrandspercore"
# now derive the vcpu-to-core mapping based on above information #
echo -e "\n** Socket-Core-vCPU mapping **"
vpid=0
for ((i = 1; i <= ${nproc}; ++i ))
do
echo -e "\nPhysical Processor $i:"
for ((j = 1; j <= ${ncoresperproc}; ++j ))
do
echo -e "\tCore $j:"
echo -e "\t\tvCPU ids: $vpid-$(($vpid+$nstrandspercore-1))"
vpid=$(($vpid+$nstrandspercore))
done
done
No comments:
Post a Comment