System Administration
Showing results for 
Search instead for 
Do you mean 

How to find out CPU Speed(MHz) in HP-UX

Frequent Advisor

How to find out CPU Speed(MHz) in HP-UX

Can anyone help me to find out the command to find out CPU Speed(MHz) in HP-UX
5 REPLIES
Acclaimed Contributor Acclaimed Contributor

Re: How to find out CPU Speed(MHz) in HP-UX

If avaiable in your OS version, use

/usr/contrib/bin/machinfo

or SAM
-> Performance monitors
-> system properties

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Outstanding Contributor Outstanding Contributor

Re: How to find out CPU Speed(MHz) in HP-UX

Try this little script:


MHZ=$(echo itick_per_tick/D \ # echo "itick_per_usec/d" \
| adb -k $HPUX /dev/kmem \ # | adb $HPUX /dev/kmem
| tail -1 \ #For Itanium, use machinfo
| awk '{print $2/10000}')
echo `hostname` has `ioscan -k |grep -n processor \
|wc -l` $MODEL $MHZ "Mhz processor(s)"


Pete

Pete
Honored Contributor Honored Contributor

Re: How to find out CPU Speed(MHz) in HP-UX

# cat /usr/local/bin/hpmem
#!/bin/ksh
#
# Taken from the HP/UniGraphics FAQ
# You must be ROOT to execute this since it uses adb to
# examine the running kernel
#
GetKernelSymbol()
{
echo "$1/D" | \
adb $hpux /dev/kmem | \
tr "\012" " " | \
read junk junk2 kval
}
hpux=/hp-ux
rev=$(uname -r | cut -d. -f2)
if ((rev > 9)); then hpux=/stand/vmunix ;fi
/bin/uname -a
# if Itanium
plat=$(/bin/uname -m)
if [[ $plat = "ia64" ]]; then
speed=`echo "itick_per_usec/D" | adb -o /stand/vmunix /dev/kmem`
print CPU Speed: $speed MHz
else
GetKernelSymbol "processor_count"
print CPU Count: $kval
GetKernelSymbol "itick_per_tick"
let speed=kval/10000
print CPU Speed: $speed MHz
if ((rev > 10)); then
print CPU HW Support: `getconf HW_CPU_SUPP_BITS`-bit
print Kernel Support: `getconf KERNEL_BITS`-bit
GetKernelSymbol "memory_installed_in_machine"
else
GetKernelSymbol "physmem"
fi
fi
ver=$(uname -r | cut -d. -f3)
# if 11iv2 or higher - get memory this way
if ((ver > 22)); then
kernel=$(/usr/sbin/kcpath -x)
hexval=$(echo "phys_mem_pages/A" | adb $kernel /dev/kmem|tail +2|awk '{print $2}')
REAL_MEM=$(echo ${hexval}=D|adb)
mb=$(expr ${REAL_MEM} / 256)
else
let mb=kval*4/1024 # convert pages to MB
fi
print RAM Size: $mb MB
GetKernelSymbol "bufpages"
let mb=kval*4/1024 # convert pages to MB
print bufpages: $mb MB
GetKernelSymbol "maxuprc"
print maxuprc: $kval
GetKernelSymbol "maxvgs"
print maxvgs: $kval
GetKernelSymbol "maxfiles"
print maxfiles: $kval
GetKernelSymbol "max_thread_proc"
print max_thread_proc: $kval
GetKernelSymbol "nfile"
print nfile: $kval
GetKernelSymbol "nproc"
print nproc: $kval
GetKernelSymbol "ninode"
print ninode: $kval
GetKernelSymbol "vfd_cw"
print shmmax: $kval
GetKernelSymbol "shmmni"
print shmmni: $kval
GetKernelSymbol "dbc_max_pct"
print dbc_max_pct: $kval



# cat /usr/local/bin/hpmem.ia64
#!/bin/ksh
#
# Taken from the HP/UniGraphics FAQ
# You must be ROOT to execute this since it uses adb to
# examine the running kernel
#
GetKernelSymbol()
{
echo "$1/D" | \
adb -o $hpux /dev/kmem | \
tr "\012" " " | \
awk -F: '{print $3}' |\
read kval
}
hpux=/stand/vmunix
rev=$(uname -r | cut -d. -f2)
/bin/uname -a
GetKernelSymbol "active_processor_count"
print CPU Count: $kval
GetKernelSymbol "itick_per_usec"
print CPU Speed: $kval MHz
print CPU HW Support: `getconf HW_CPU_SUPP_BITS`-bit
print Kernel Support: `getconf KERNEL_BITS`-bit
GetKernelSymbol "memory_installed_in_machine"
ver=$(uname -r | cut -d. -f3)
# if 11iv2 or higher - get memory this way
if ((ver > 22)); then
kernel=$(/usr/sbin/kcpath -x)
hexval=$(echo "phys_mem_pages/A" | adb -o $kernel /dev/kmem|tail +2|awk '{print $2}')
REAL_MEM=$(echo ${hexval}=D|adb -o)
mb=$(expr ${REAL_MEM} / 256)
else
let mb=kval*4/1024 # convert pages to MB
fi
print RAM Size: $mb MB
GetKernelSymbol "maxuprc"
print maxuprc: $kval
GetKernelSymbol "maxvgs"
print maxvgs: $kval
GetKernelSymbol "maxfiles"
print maxfiles: $kval
GetKernelSymbol "max_thread_proc"
print max_thread_proc: $kval
GetKernelSymbol "nproc"
print nproc: $kval
GetKernelSymbol "ninode"
print ninode: $kval
GetKernelSymbol "vfd_cw"
print shmmax: $kval
GetKernelSymbol "shmmni"
print shmmni: $kval

Output like:

# hpmem.ia64
HP-UX sha1 B.11.31 U ia64 3126345088 unlimited-user license
CPU Count: 1
CPU Speed: 1300 MHz
CPU HW Support: 64-bit
Kernel Support: 64-bit
RAM Size: 6132 MB
maxuprc: 256
maxvgs: 256
maxfiles: 2048
max_thread_proc: 3000
nproc: 4200
ninode: 8192
shmmax: 1073741824
shmmni: 400

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Occasional Visitor

Re: How to find out CPU Speed(MHz) in HP-UX

echo itick_per_usec/D | adb -k /stand/vmunix /dev/kmem | sed 's/itick_per_usec://g'

Highlighted
Advisor

Re: How to find out CPU Speed(MHz) in HP-UX

machinfo command gives you all.