티스토리 뷰

리눅스 하이퍼쓰레딩(Hyper Threading) 활성화 확인 방법

 

#!/bin/sh

 

## HostName

hostname >> cpu.txt

##IP

ifconfig bond0 | grep "inet addr" | awk '/inet/ {sub(/addr:/,"",$2); print $2}' >> cpu.txt

##Product Name

dmidecode -s system-product-name >> cpu.txt

##CPU Model Name

cat /proc/cpuinfo | grep "model name" | head -n 1 | awk -F : {'print $2'} >> cpu.txt

##CPU Socket

#dmidecode -t processor | grep "Socket Designation" | wc -l >> cpu.txt

cat /proc/cpuinfo | grep "physical id" | sort -u | wc -l >> cpu.txt

##CPU Core

dmidecode -t processor | grep "Core Count" | sort -u | awk {'print $3'} >> cpu.txt

 

cat cpu.txt

 

##Hyper-threading technology

cpus1=`cat /proc/cpuinfo | grep "physical id" | sort -u | wc -l`

cpuc1=`dmidecode -t processor | grep "Core Count" | sort -u | awk {'print $3'}`

 

num1=$(expr $cpus1 \* $cpuc1 \* 2)

num2=`cat /proc/cpuinfo | grep processor | wc -l`

 

if [ $num1 -eq $num2 ]

then

           echo "HTT"

else

           echo "None"

fi

 

rm -f cpu.txt

 

# sh cpu-HTT.sh

bind

192.168.20.22

ProLiant DL380p Gen8

Intel(R) Xeon(R) CPU E5-2650L 0 @ 1.80GHz

2

8

HTT

 

댓글
댓글쓰기 폼