How to find processor frequency | Unix Linux Forums | HP-UX

  Go Back    


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

How to find processor frequency

HP-UX


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 04-01-2002
manjunath manjunath is offline
Registered User
 
Join Date: Mar 2002
Last Activity: 23 October 2002, 9:34 AM EDT
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
How to find processor frequency

Hello ,


Please tell me how to find processor frequency in HP UNIX .
Sponsored Links
    #2  
Old 04-01-2002
PxT's Avatar
PxT PxT is offline Forum Advisor  
Registered User
 
Join Date: Oct 2000
Last Activity: 7 May 2009, 12:22 PM EDT
Location: Sacramento, CA
Posts: 909
Thanks: 0
Thanked 4 Times in 4 Posts
This bit of perl magic should do it (answer in Mhz):


Code:
#!/usr/contrib/bin/perl

    local($PSTAT, $PSTAT_PROCESSOR) = (239, 10);        # pstat_getprocessor
    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 $cpu_ticks/10000 . "\n";

Sponsored Links
    #3  
Old 04-01-2002
auswipe's Avatar
auswipe auswipe is offline Forum Advisor  
Registered User
 
Join Date: Nov 2001
Last Activity: 28 May 2012, 1:32 PM EDT
Location: Wide Awake Wylie, Texas
Posts: 537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally posted by PxT
This bit of perl magic should do it (answer in Mhz):
PxT:

When I tried that Perl script on my BSD boxes, all I got was a core file. I guess it only works on HP-UX?


Code:
FreeBSD:/home/joeuser/procspeed $ chmod +x procspeed.pl
FreeBSD:/home/joeuser/procspeed $ ./procspeed.pl
Bad system call (core dumped)
FreeBSD:/home/joeuser/procspeed $

So I went back to dmesg output and performed a case insensitive search for "MHz":


Code:
FreeBSD:/home/joeuser $ dmesg | grep -i "mhz"
CPU: AMD Duron(tm) processor (950.04-MHz 686-class CPU)

Just out of curiosity, does this work under HP-UX (I don't have access to a HP-UX box, only BSD boxes at the moment).
    #4  
Old 04-01-2002
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon (Administrator Emeritus)
 
Join Date: Aug 2001
Last Activity: 19 September 2014, 2:05 PM EDT
Location: Ashburn, Virginia
Posts: 9,925
Thanks: 60
Thanked 435 Times in 260 Posts
Quote:
Originally posted by auswipe

Just out of curiosity, does this work under HP-UX (I don't have access to a HP-UX box, only BSD boxes at the moment).
Yes it does. It is using HP's pstat system call which is unique to HP-UX. It won't work on other versions of unix.
Sponsored Links
    #5  
Old 04-02-2002
PxT's Avatar
PxT PxT is offline Forum Advisor  
Registered User
 
Join Date: Oct 2000
Last Activity: 7 May 2009, 12:22 PM EDT
Location: Sacramento, CA
Posts: 909
Thanks: 0
Thanked 4 Times in 4 Posts
As perderabo mentioned, this is hp-ux specific. HP's boot messages generally do not provide the Mhz information, so dmesg cannot be used. The provided perl code should work on any hp-ux machine.
Sponsored Links
    #6  
Old 04-02-2002
auswipe's Avatar
auswipe auswipe is offline Forum Advisor  
Registered User
 
Join Date: Nov 2001
Last Activity: 28 May 2012, 1:32 PM EDT
Location: Wide Awake Wylie, Texas
Posts: 537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally posted by PxT
As perderabo mentioned, this is hp-ux specific. HP's boot messages generally do not provide the Mhz information, so dmesg cannot be used. The provided perl code should work on any hp-ux machine.
Just another bit of information to tuck away until needed.

Thanks
Sponsored Links
    #7  
Old 11-10-2005
titouzb titouzb is offline
Registered User
 
Join Date: Nov 2005
Last Activity: 14 November 2005, 2:29 AM EST
Location: Toulouse (France)
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Just do it in SH

Hi all,

There's a easier way to get CPU frequency on HP-UX 11 :
echo "itick_per_usec/D" | /usr/bin/adb -k /stand/vmunix /dev/mem

Cheers.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Find the feature code of the installed processor card on my p550 balaji_prk AIX 2 07-16-2009 03:01 PM
Processor and processor core balaji_prk AIX 1 02-12-2009 04:31 PM
LPAR processor/virtual processor settings guttew AIX 1 02-01-2007 12:52 PM
Where can I find a Unix OS that will run on a 386 processor? methudrez UNIX Desktop for Dummies Questions & Answers 4 08-08-2002 08:02 AM
To find processor speed & memory in HP Unix 10.2 augustinep UNIX for Dummies Questions & Answers 4 01-30-2002 11:54 AM



All times are GMT -4. The time now is 04:02 PM.