Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Languages and Scripting
cancel
Showing results for 
Search instead for 
Did you mean: 

How to find the cpu clock speed

SOLVED
Go to solution
santosh jha
Frequent Advisor

How to find the cpu clock speed

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
Pete Randall
Outstanding Contributor
Solution

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
RAC_1
Honored Contributor

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
Muthukumar_5
Honored Contributor

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!
VEL_1
Valued Contributor

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
Arunvijai_4
Honored Contributor

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"
Muthukumar_5
Honored Contributor

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!
morganelan
Trusted Contributor

Re: How to find the cpu clock speed

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


Kamal Mirdad
santosh jha
Frequent Advisor

Re: How to find the cpu clock speed

Thanks a lot guys ...
Raj D.
Honored Contributor

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
Geoff Wild
Honored Contributor

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.
Geoff Wild
Honored Contributor

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.
Raj D.
Honored Contributor

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 . "
Biswajit Tripathy
Honored Contributor

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
:-)