Languages and Scripting
Showing results for 
Search instead for 
Do you mean 

How to find the cpu clock speed

SOLVED
Go to Solution
Frequent Advisor

How to find the cpu clock speed

[ Edited ]

Please tell me how to find the cpu clock speed and also how to find out if the system in PA-RISC or not.using command.

 

 

P.S.This thread has been moved from Moved from HP-UX>General  to HP-UX>  languages- HP Forums Moderator

13 REPLIES
Outstanding Contributor [Founder]

Re: How to find the cpu clock speed

I use this little script:

HPUX=/stand/vmunix

MODEL=$(grep -i $(model | tr "/" " " \
| awk '{print $NF}') \
/usr/sam/lib/mo/sched.models \
| awk '{print $NF}')

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


To tell if it's PA-RISC or not, simply issue the model command. Anything that starts with rx is Itanium, everything else is PA-RISC.


Pete

Pete
Honored Contributor [Founder]

Re: How to find the cpu clock speed

echo itick_per_usec/D | adb -k /stand/vmunix /dev/mem
model

rx-itanium
rp-pa-risc

echo "selclass qualifier cpu;info;wait;infolog"|cstm
There is no substitute to HARDWORK
Honored Contributor [Founder]

Re: How to find the cpu clock speed

b) uname -m or model command will tell whether it is Itanium or PA-RISC based.

model is not IA64 then it is PA-RISC one.

a) Processor information:

sam -> performance monitor -> system properties

hth.
Easy to suggest when don't know about the problem!
Valued Contributor [Founder]

Re: How to find the cpu clock speed


From the command-line,

# echo "itick_per_usec/D" | adb /stand/vmunix /dev/mem | tail -1
itick_per_usec: 552

From SAM,

o Go to Performance Monitors -> System Properties -> Memory
o Check Clock Frequency: value
Honored Contributor [Founder]

Re: How to find the cpu clock speed

sam -> performance monitors -> system properties

# echo itick_per_usec/D|adb /stand/vmunix /dev/kmem

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=35140

-Arun


"A ship in the harbor is safe, but that is not what ships are built for"
Honored Contributor [Founder]

Re: How to find the cpu clock speed

sam -> performance monitor -> system properties itself giving information for PA-RISC and clock speed also.

â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â
â â â â Processors: â â â
â â â â Active: 1 â â â
â â â â Total: 1 â â â
â â â â CPU Version: PA 8800 CPU Module 3.2 â â â
â â â â Clock Frequency: 800 MHz â â â
â â â â Machine Identification: 2756521519 â â â â
â â â â Hardware Model: 9000/800/rp3410 â â â â
â â â â Kernel Width Support: 64 â â â â
â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â â

hth.
Easy to suggest when don't know about the problem!
Trusted Contributor [Founder]

Re: How to find the cpu clock speed

# echo "itick_per_usec/D" | adb /stand/vmunix /dev/mem | tail -1


Kamal Mirdad
Frequent Advisor

Re: How to find the cpu clock speed

Thanks a lot guys ...
Honored Contributor [Founder]

Re: How to find the cpu clock speed

Hi Santosh ,

Here is a good one...

Just run this command:

#
echo "CPU Speed is = \c" ; echo itick_per_tick/D|adb -k /stand/vmunix /dev/kmem|tail -1|cut -f2 | awk '{printf "%0f MHz\n", $1/10000}'


Enjoy,
Cheers,
Raj.


" If u think u can , If u think u cannot , - You are always Right . "
Highlighted
Honored Contributor [Founder]

Re: How to find the cpu clock speed

And of course the obligatory perl way:


# cat cpuspeed
perl -e 'local($PSTAT, $PSTAT_PROCESSOR)=(239,10);
local($struct_pst_processor)=("L30");
local($cpu_info, $cpu_ticks);
$cpu_info = "\0" x 120;
syscall($PSTAT, $PSTAT_PROCESSOR, $cpu_info, length($cpu_info), 1, 0);
($cpu_ticks)=(unpack($struct_pst_processor, $cpu_info))[26];
print "speed=".int($cpu_ticks/10000)." Mhz\n";'


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.
Honored Contributor [Founder]

Re: How to find the cpu clock speed

And this Perl one will tell if it is parisc:

# cat cpuinfo
perl -MUnix::Processors -le'print join"\t",$_->id,$_->state,$_->type,$_->clock for @{Unix::Processors->new()->processors}'


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.
Honored Contributor [Founder]

Re: How to find the cpu clock speed

Santosh ,

Also dont forget the easy one :

SAM--> Performance Monitors --> System Properties.


Processors:
Active: 2
Total: 2
CPU Version: 2.0 PA8500
Clock Frequency: 360 MHz
Machine Identification: 145901547
Hardware Model: 9000/800/L2000-36
Kernel Width Support: 64
-----------------------------------------


cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Honored Contributor [Founder]

Re: How to find the cpu clock speed

To complete the set the choices you have,
here is the C program :-)

#include
#include
#include
int main()
{
struct pst_processor psp;
unsigned long int clock_speed, scclktick;
pstat_getprocessor(&psp, sizeof(psp), 1, 0);
scclktick=sysconf(_SC_CLK_TCK);
clock_speed = psp.psp_iticksperclktick * scclktick;
printf("CPU clock speed is %ld Mhz\n", clock_speed/1000000);
}

Compile and run to get the cpu speed.

- Biswajit
:-)