How to find the cpu clock speed (1849 Views)
Reply
Frequent Advisor
santosh jha
Posts: 81
Registered: ‎05-25-2003
Message 1 of 14 (1,849 Views)
Accepted Solution

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

Outstanding Contributor
Pete Randall
Posts: 16,205
Registered: ‎11-03-1996
Message 2 of 14 (1,849 Views)

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
RAC_1
Posts: 5,920
Registered: ‎03-21-2002
Message 3 of 14 (1,849 Views)

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
Muthukumar_5
Posts: 4,030
Registered: ‎06-09-2004
Message 4 of 14 (1,849 Views)

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
VEL_1
Posts: 140
Registered: ‎12-08-2004
Message 5 of 14 (1,849 Views)

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
Arunvijai_4
Posts: 4,194
Registered: ‎04-07-2005
Message 6 of 14 (1,849 Views)

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
Muthukumar_5
Posts: 4,030
Registered: ‎06-09-2004
Message 7 of 14 (1,849 Views)

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
morganelan
Posts: 283
Registered: ‎02-21-2003
Message 8 of 14 (1,849 Views)

Re: How to find the cpu clock speed

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


Kamal Mirdad
Frequent Advisor
santosh jha
Posts: 81
Registered: ‎05-25-2003
Message 9 of 14 (1,849 Views)

Re: How to find the cpu clock speed

Thanks a lot guys ...
Honored Contributor
Raj D.
Posts: 2,624
Registered: ‎06-12-2004
Message 10 of 14 (1,849 Views)

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 . "
Honored Contributor
Geoff Wild
Posts: 7,170
Registered: ‎06-04-2001
Message 11 of 14 (1,847 Views)

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
Geoff Wild
Posts: 7,170
Registered: ‎06-04-2001
Message 12 of 14 (1,847 Views)

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
Raj D.
Posts: 2,624
Registered: ‎06-12-2004
Message 13 of 14 (1,847 Views)

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
Biswajit Tripathy
Posts: 508
Registered: ‎12-11-2004
Message 14 of 14 (1,847 Views)

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
:-)
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.