Operating System - HP-UX
1847935 Members
3893 Online
104021 Solutions
New Discussion

Processor Speed without Root privilege

 
SOLVED
Go to solution
Martin Hristov
New Member

Processor Speed without Root privilege

Hi,

I need to obtain the CPU speed, but do not have root privileges. I tried ioscan -C processor but could not run it. I checked the syslog, but the system did not record this info at startup. Any ideas will be greatly appreciated.

Thanks
7 REPLIES 7
Sridhar Bhaskarla
Honored Contributor

Re: Processor Speed without Root privilege

Hi Martin,

I cannot guarantee. But try these following.

1.

$/usr/sbin/cstm
map -> sel dev xx -> info ->infolog

(where xx is the index of any of the CPUs listed in the map's output)

In the infolog, it will list "Processor Speed".

2.

The neat thing about RP class servers is that HP adds the CPU speed to the model. For ex.,

$model
9000/800/N4000-44

The above means 440mhz processor. However you older ones do not contain this information in the model string.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Michael Tully
Honored Contributor
Solution

Re: Processor Speed without Root privilege


echo "selclass qualifier cpu;info;wait;infolog" | cstm

Look for the output of the processor speed.
Anyone for a Mutiny ?
Jeff Schussele
Honored Contributor

Re: Processor Speed without Root privilege

Hey Michael,

I've got K580s & N4000-55s that output only "N/A" in the Processor Speed field from that cstm command.
Not sure that's 100% reliable.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Michael Tully
Honored Contributor

Re: Processor Speed without Root privilege

Are you guys trying to gang up on me .... ;^)

I don't get that problem on my systems, I did actually try a couple of them....

I would have suggested this command but you need to be root:

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

But it gives an error 13
Anyone for a Mutiny ?
Martin Hristov
New Member

Re: Processor Speed without Root privilege

Hi Guys,

Thanks for all the replies. I tried echo "selclass qualifier cpu;info;wait;infolog" | cstm on a couple of servers and did get N/A for CPU speed. Model worked as expected, but I am also not sure if it is 100% reliable. I am still a newbie on HP-UX, but I am somewhat surprised that it is so hard to get that info comared to Solaris.
Thanks again.
monasingh_1
Trusted Contributor

Re: Processor Speed without Root privilege

Well, not always available but If you have console connected to the machine and if still has the boot process in its buffer then you can just page up on the console and get the CPU speed, IT will be just after machine boots...
Dietmar Konermann
Honored Contributor

Re: Processor Speed without Root privilege

Martin,

there seems to be really no straight-forward way for non-root to get this information.

However, the kernel provides it through the pstat() systemcall. You may use this little C proggie...

#include
#include

main()
{
struct pst_processor psp;

if (pstat_getprocessor(&psp, sizeof(psp), 1, 0) != -1) {
printf ("%i MHz\n", psp.psp_iticksperclktick/10000);
}
else {
perror("pstat_getprocessor");
exit (1);
}
exit (0);
}

Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)