1833187 Members
3009 Online
110051 Solutions
New Discussion

Re: cpu speed

 
Regina Mitchell
Frequent Advisor

cpu speed

How do you find the speed of a cpu if you're not root?
12 REPLIES 12
Robert-Jan Goossens
Honored Contributor

Re: cpu speed

Hi,

normaly I would say,

# echo itick_per_tick/D|adb -k /stand/vmunix /dev/kmem | tail -n1 | awk '{print $2/10000 "MHz"}'

Nut I'm not shure you can do this from a non root user. I do not have a UX system at this moment to try.

HTH,
Robert-Jan
Pete Randall
Outstanding Contributor

Re: cpu speed

Shawn,

I use this little script (but it has to be run by root):

HPUX=/stand/vmunix

MHZ=$(echo itick_per_tick/D \
| adb -k $HPUX /dev/kmem \
| tail -1 \
| awk '{print $2/10000}')
echo $MHZ


I don't know of a way to obtain this info as a non-root user.


Pete

Pete
John Palmer
Honored Contributor

Re: cpu speed

You could open up a whole can of security worms and put it in a setuid root script ;-) or you could install sudo to run it... (we've been here before haven't we?).

Regards,
John
Bruno Ganino
Honored Contributor

Re: cpu speed

From the command: # echo "itick_per_usec/D" | adb /stand/vmunix /dev/mem | tail -1

From SAM: Go to Performance Monitors -> System Properties -> Memory

HTH
Bruno

Torino (Turin) +2H
Dave Hutton
Honored Contributor

Re: cpu speed


Can use:
# model
9000/800/L1000-36

And just add a 0 (zero) to the last number, so this server has a 360 processor.


Dave
Dave Hutton
Honored Contributor

Re: cpu speed

Forgot to add, you don't have to be root to do this. I did this as my generic user account.

Dave
MANOJ SRIVASTAVA
Honored Contributor

Re: cpu speed

Model command as a user will give the o/p in this format which has to be understood as speed .

9000/800/N4000-55 ( 550 MHZ)


Manoj Srivastava
Sanjay_6
Honored Contributor

Re: cpu speed

Hi,

This will give you the processor speed.

echo itick_per_usec/D | adb -k /stand/vmunix /dev/kmem

If you want to run this command as non-root user, you should have read access on /dev/kmem.

Hope this helps.

Regds
Geoff Wild
Honored Contributor

Re: cpu speed

Or use this script:

# hpmem
HP-UX pc0003 B.11.11 U 9000/800 2504392627 unlimited-user license
CPU Count: 6
CPU Speed: 750 MHz
CPU HW Support: 64-bit
Kernel Support: 64-bit
RAM Size: 10080 MB
bufpages: 1008 MB
maxuprc: 800
maxvgs: 128
maxfiles: 2048
max_thread_proc: 256
nfile: 189100
nflock: 1200
nproc: 2560
ninode: 16384
shmmax: 1073741824
shmmni: 256
dbc_max_pct: 10
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.
Mike Stroyan
Honored Contributor

Re: cpu speed

% cat cpu_rate.c
#include
#include
#include 1$N1
#include
int main(int argc, char *argv[])7!` á
{
struct pst_processor st;
int id;
for (id=0; pstat_getprocessor(&st, sizeof(st), (size_t)1, id)==1; id++) {
printf("processor %d- %d clock cycles per second\n",
id, st.psp_iticksperclktick * sysconf(_SC_CLK_TCK));
}
return 0;
}
% cpu_rate
processor 0- 750000000 clock cycles per second
processor 1- 750000000 clock cycles per second
Mike Stroyan
Honored Contributor

Re: cpu speed

Hmm, that picked up some interesting noise.
Change

#include 1$N1
#include :Ã Â
int main(int argc, char *argv[])7!` à ¡

to

#include
#include
int main(int argc, char
Mike Stroyan
Honored Contributor

Re: cpu speed

And that dropped some characters. :-)
Just remove the odd characters from the
ends of those three lines.