System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Standard method to retrieve processor speed on HPUX 11.31

Gowhar Jan
Esteemed Contributor

Standard method to retrieve processor speed on HPUX 11.31

Hi,

adb and itick_per_usec/D combination don't always yield the same results as machinfo for retrieving processor speed. On HPUX 11.23, there was a known issue around this and a patch available as well. What about HPUX 11.31? I'd like to know what's the standard method to retrieve processor speed on HPUX by using a command other than adb. Thanks!
7 REPLIES
James R. Ferguson
Acclaimed Contributor

Re: Standard method to retrieve processor speed on HPUX 11.31

Hi:

# machinfo

Regards!

...JRF...
Gowhar Jan
Esteemed Contributor

Re: Standard method to retrieve processor speed on HPUX 11.31

I need to use a script to extract the Processor Speed before processing it further. Do you suggest to parse the output of machinfo command for this purpose?

The older version of machinfo used to return results that were straightforward to parse but thats not the case anymore.
James R. Ferguson
Acclaimed Contributor

Re: Standard method to retrieve processor speed on HPUX 11.31

Hi:

> The older version of machinfo used to return results that were straightforward to parse but thats not the case anymore.

Anything is parseable. Please post your output.

Regards!

...JRF...
Gowhar Jan
Esteemed Contributor

Re: Standard method to retrieve processor speed on HPUX 11.31

I agree anything is parseable but if there is a slight change in machinfo output, the parsing script goes for a toss.

Following are the first few lines of machinfo output i'm intersted in:

------------
CPU info:
1 PA-RISC 8800 processor (1 GHz, 64 MB)
CPU version 5
2 logical processors (2 per socket)
------------

Looking at these, i'll have to search for "GHz" and extract the digits backwards till i encounter a "(". Isn't there a cleaner method on HPUX, say, a command invocation with some parameters that return the Processor Speed, e.g., using getconf etc?
Tim Nelson
Honored Contributor

Re: Standard method to retrieve processor speed on HPUX 11.31

PROC_SPEED=`echo itick_per_usec/D | adb -o /stand/vmunix /dev/kmem |awk -F: 'NR>1 {print $2}'`
James R. Ferguson
Acclaimed Contributor

Re: Standard method to retrieve processor speed on HPUX 11.31

Hi (again):

Given your last post, you might do:

# machinfo | perl -nle 'm{processor\s*\(\s*(\d+\s*GHz)}i and print $1'

Regards!

...JRF...

Gowhar Jan
Esteemed Contributor

Re: Standard method to retrieve processor speed on HPUX 11.31

Thanks James!!!