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
PLIPCONFIG(8)															     PLIPCONFIG(8)

NAME
plipconfig - fine tune PLIP device parameters SYNOPSIS
plipconfig interface plipconfig interface [nibble NN] [trigger NN] [unit NN] DESCRIPTION
Plipconfig is used to (hopefully) improve PLIP performance by changing the default timing parameters used by the PLIP protocol. Results are dependent on the parallel port hardware, cable, and the CPU speed of each machine on each end of the PLIP link. If the single interface argument is given, plipconfig displays the status of the given interface only. Otherwise, it will try to set the options. OPTIONS
nibble NN Sets the nibble wait value in microseconds. Default is 3000. trigger NN Sets the trigger wait value in microseconds. Default is 500. PLIP speed can in some cases be improved by lowering the default values. Values which are too low may cause excess use of CPU, poor inter- rupt response time resulting in serial ports dropping characters, or in dropping of PLIP packets. Changing the plip MTU can also affect PLIP speed. NOTE
If you get no response it is far more likely the irq is wrong and needs setting with ifconfig. The few cases where the default parameters will be too fast are those using very long cables. Something you should never do as the parallel port is not specified or designed for driving long cable runs. SEE ALSO
ifconfig(8) BUGS
Non. AUTHOR
John Paul Morrison, <jmorriso@bogomips.ee.ubc.ca>, <ve7jpm@ve7jpm.ampr.org> 17 February 1995 PLIPCONFIG(8)