get CPU speed use pstat APIs


 
Thread Tools Search this Thread
Operating Systems HP-UX get CPU speed use pstat APIs
# 1  
Old 04-18-2009
get CPU speed use pstat APIs

I get my CPU speed use pstat APIs
use this program serach google and just test it
#include <errno.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/param.h>
#include <sys/pstat.h>
#define CPU_ID 0
#define HZ_PER_MHZ 1000000
int main()
{
struct pst_processor pst;
union pstun pu;

pu.pst_processor = &pst;
pstat( PSTAT_PROCESSOR, pu, (size_t)sizeof(pst), (size_t)1, CPU_ID);
printf( "%d MHz\n",(int)((double)pst.psp_iticksperclktick * sysconf( _SC_CLK_TCK ) / HZ_PER_MHZ) );

return 0;
}


the resutl shows 399MZ
but I use machinfo command shows 1.59Gz

what's wrong with that code or my machine

my OS is HP UX 11.31 Itanium base
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Rsync quite slow (using very little cpu): how to improve its speed?

I have "inherited" a OmniOS (illumos based) server. I noticed rsync is significantly slower in respect to my reference, FreeBSD 12-CURRENT, running on exactly same hardware. Using same hardware, same command with same source and target disks, OmniOS r151026 gives: test@omniosce:~# time... (11 Replies)
Discussion started by: priyadarshan
11 Replies

2. Solaris

T5140 CPU Speed is 1200 Mhz or 1165 Mhz?

Hi bros, CPU speed of Sun Sparc Enterprise T5140 in data sheet is 1200 Mhz. Why it shows in "prtdiag -v" command each thread just has speed at 1165 Mhz. Thank you, tien86 (4 Replies)
Discussion started by: tien86
4 Replies

3. HP-UX

Help me in finding process name and argument list without using pstat()

Hi everybody, I have an application which displayes the process name and argument list for that each and every process running on the system. For this purpose the application used the pstat_getproc() method which fetches the structure pst_status. By this method we get the programm name up to 15... (0 Replies)
Discussion started by: sardesh3
0 Replies

4. Filesystems, Disks and Memory

data from blktrace: read speed V.S. write speed

I analysed disk performance with blktrace and get some data: read: 8,3 4 2141 2.882115217 3342 Q R 195732187 + 32 8,3 4 2142 2.882116411 3342 G R 195732187 + 32 8,3 4 2144 2.882117647 3342 I R 195732187 + 32 8,3 4 2145 ... (1 Reply)
Discussion started by: W.C.C
1 Replies

5. Solaris

Solaris10 x86 - How to find out the CPU model and speed?

Please let me know if there is any way I can find out (either via command line or SMF) the following: 1.CPU model (eg. Pentium 4,Celeron) 2.CPU speed (eg. 1GHz) for this I could get the output through psrinfo -v, but still is there any other way? 3.Hard disk model (eg. Seagate). When I... (9 Replies)
Discussion started by: saagar
9 Replies

6. Linux

How to find CPU Speed of zLinux

Need to find CPU Speed of zLinux. The commands like cat /proc/cpuinfo and /usr/bin/cpufreq-info does not gave me the expected results. /usr/bin/cpufreq-info prints the .... analyzing CPU 0: no or unknown cpufreq driver is active on this CPU analyzing CPU 1: no or unknown cpufreq... (1 Reply)
Discussion started by: surajb
1 Replies

7. HP-UX

How to find CPU Speed of HP UX

Need to find the CPU speed of HP UX for a non root login. echo "itick_per_usec/D" | adb /stand/vmunix /dev/mem | tail -1 will give the following for non root users ERROR: cannot open `/dev/mem', errno = 13, Permission denied (2 Replies)
Discussion started by: surajb
2 Replies

8. HP-UX

Get CPU speed without root permissions

How can I get the CPUs speed without root permissions? Thanks. (2 Replies)
Discussion started by: psimoes79
2 Replies

9. UNIX for Dummies Questions & Answers

bus speed and CPU info

Hi, Is there a command I can use to find out how many CPU's and what type are on my server? (I was told to use cat /proc/cpuinfo) Also, how do I know what kind of bus speeds are on my server? Thanks in advance:) (3 Replies)
Discussion started by: ihot
3 Replies

10. AIX

cpu speed

how do i determine the speed of a cpu on AIX 4.3.3 or 5.1? (5 Replies)
Discussion started by: csaunders
5 Replies
Login or Register to Ask a Question
PMU(4)							   BSD Kernel Interfaces Manual 						    PMU(4)

NAME
pmu -- support for Power Management Units found in all Apple laptops and some desktop Power Macintosh computers SYNOPSIS
pmu* at obio? nadb* at pmu? battery* at pmu? smartbat* at pmu? DESCRIPTION
The pmu driver provides support for the Power Management Unit found in Apple laptops and some desktop Power Macintosh computers. Functions controlled by the PMU include the real time clock, ADB, power, batteries, on some laptops like the PowerBook 3400c and similar machines it also controls hotkeys and display brightness, on others it provides an iic(9) bus and on some it controls CPU speed. On many older machines it also provides access to some non-volatile memory and thermal sensors. Not all those features are present on all machines, for instance Power Macintosh G4 and later machines don't have ADB, many more recent laptops have display brightness and backlight control built into the graphics controller instead of the PMU, only a few older PowerBooks use the PMU for CPU speed control and newer machines use a different way to access non-volatile memory. However, all known PMUs so far provide a real time clock and power control. Notes by model Real time clock and power control are present and supported on all machines that can run NetBSD/macppc, ADB is supported when present. PowerBook 2400, 3400c, and 3500 Battery status and thermal sensors found on the mainboard and in the battery pack are supported by the battery(4) driver, val- ues can be read via envsys(4). Hotkeys for brightness control are supported, CPU speed control and parameter RAM are present but unsupported. Power Macintosh G4 ADB is not present, iic(9) is present but unsupported. SEE ALSO
battery(4), cuda(4), nadb(4), nvram(4), obio(4), iic(9) BUGS
Some features are currently unsupported, like the iic(9) bus, access to parameter RAM and CPU speed control. BSD
May 14, 2007 BSD