Operating System - HP-UX
1752794 Members
5782 Online
108789 Solutions
New Discussion юеВ

Re: how to get cpu speed and cpu L2 cache size via API

 
alert0919
Advisor

how to get cpu speed and cpu L2 cache size via API

i would like to get PA-RISC and Itanium CPU Speed and L2 cache
I would like to use API to solve it via pstat
could some one give me a C program to do that
My OS include 11v1 11v2 11v3

or tell me how to use pstat to do that
because I use command:machinfo only support Itanium 11.23 Above,but it display type are different 11.23 and 11.31,so I would like to use pstat API to do that

could someone help me?
thanks
7 REPLIES 7
Shiv007
Frequent Advisor

Re: how to get cpu speed and cpu L2 cache size via API

Hi,

Try using the system call sysconf();

do a man on sysconf. You should be able find all the properties w.r.t the CPU.

_SC_CLOCKS_PER_SEC
_SC_CLK_TCK


or try using pstat_getproc().

there is a structure which has all the properties
pst_processor.

also don't forget to check the man for pstat_getproc

Thanks
Shivaprasad
Taifur
Respected Contributor

Re: how to get cpu speed and cpu L2 cache size via API

Hi,

Check below link regarding pstat as follows,
http://docs.hp.com/en/B9106-90009/pstat.2.html
http://docs.hp.com/en/B9073-90040/apbs01.html

You can check by taking nickel output

#cd /opt/contrib/bin
#./nickel

Rgds//
Taifur
Shiv007
Frequent Advisor

Re: how to get cpu speed and cpu L2 cache size via API

if you wanted a command through which you can extract use:

/opt/sfm/bin/CIMUtil -e root/cimv2 HP_Processor

this will list in the form :

or you can as well use

confstr

Thanks
Shivaprasad
alert0919
Advisor

Re: how to get cpu speed and cpu L2 cache size via API

I run this command which is good for me to solve me guestion
thanks
but it could not work on B.11.11 PA-RISC
it shows
bash: /opt/sfm/bin/CIMUtil: No such file or directory

another question
how to show cache size for HP UX
thanks
Shiv007
Frequent Advisor

Re: how to get cpu speed and cpu L2 cache size via API

Hi,

For HPUX 11iv1 11.11, you should have the latest OE which was released in December 2006.

You can try looking into pstat_ calls.

Thanks
Shivaprasad
Steven E. Protter
Exalted Contributor

Re: how to get cpu speed and cpu L2 cache size via API

Shalom,

Correction:
For 11iv1 the Latest OE is June 2009.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
James R. Ferguson
Acclaimed Contributor

Re: how to get cpu speed and cpu L2 cache size via API

Hi:

> SEP: Correction: For 11iv1 the Latest OE is June 2009.

Sorry, that's wrong. The latest _Support Plus_ (standard patch bundle) is June 2009, but the last/latest Operating Environment (OE) Update Release for 11.11 is in fact December 2006. Shivaprasad was correct.

Regards!

...JRF...