11-10-2005
Quote:
Originally Posted by titouzb
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.
Interesting. That works on HP-UX 10.20 as well. itick_per_usec is a new one on me. I knew about itick_per_tick but you need to multiply that by hz and then divide by 1,000,000. itick_per_tick is really what the pstat system call is returning. Since hz has been 100 forever, PxT is effectively doing the same calculation.
Even though the variable you mention avoids the need for arithmetic, adb is doing a fair amount of work to extract that data (as it must to extract any data). pstat is a single system call. That is not a real big deal here, but in a program to, say, monitor free memory on a busy system, it can start to matter. Also using adb requires read permission on /dev/mem and there are security concerns in making all of /dev/mem available. pstat() can be invoked by a any user.
I have several korn scripts that use adb to extract data from the kernel. I am in the process of rewriting them in perl using pstat(). They are faster and I can run them without special privileges. The real problem I am encountering is that pstat() does not have everything. I have been able to get some more stuff with the sysinfo() call, but I still have not found everything. So some scripts may still need adb.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have a D series HP server with HP UNIX 10.20 as the OS. How will I obtain the processor speed and memory of the machine. I have 'root' privileges. (4 Replies)
Discussion started by: augustinep
4 Replies
2. UNIX Desktop Questions & Answers
Hey, can anyone recommend a URL (or website) where I can download a basic (or old) UNIX OS that will run on an ancient laptop that has a 386 processor, 4MB of RAM and a 40MB harddrive? Your help and suggestions are much appreciated! :confused: (4 Replies)
Discussion started by: methudrez
4 Replies
3. HP-UX
Does anyone know if there is a command in hp-ux to find out the frequencies of the cpus on the server. I know in sun the command is /usr/sbin/psrinfo -v (on Sun)??Thanks (3 Replies)
Discussion started by: lnineill
3 Replies
4. AIX
Question is on setting of Physical and Virtual processors for LPARs to make proper use of virtualization capabilities.
Environment is a 8-way p570 with 4 LPARs.
lparVIO1 and lparVIO2:
AIX 5300-04-01
Mode/Type= Shared-SMT/Capped
Minimum Processors= 0.10
Desired Processors= 0.50
Maximum... (1 Reply)
Discussion started by: guttew
1 Replies
5. AIX
Guys...
Hows it going???
I have been going through the hardware spec of IBM system p systems.. and here i am confused
for IBM Power 520 Express it says
Processor cores:
One, two or four 64-bit 4.2 GHz POWER6 with AltiVec™ SIMD and Hardware Decimal Floating-Point acceleration
... (1 Reply)
Discussion started by: balaji_prk
1 Replies
6. Solaris
:cool: after installing solaris 10 5/08/09 directory the computer rebooting then the massage "out of frequency" appear.i want a solution first
second my main board is GA-MA780G UD3H (14 Replies)
Discussion started by: medo2008
14 Replies
7. AIX
Guys
Does anyone know how to find the feature code of the installed processor card on my p550? Through AIX or HMC.
Basically I need to find the processor card type.
Thanks in advance
Bala (2 Replies)
Discussion started by: balaji_prk
2 Replies
8. Shell Programming and Scripting
Hi,
I have a file containing the frequency's of an element sorted in ascending order. The file looks something like this:
#Element Frequency
1 1
2 1
3 1
4 1
5 1
6 ... (5 Replies)
Discussion started by: sajal.bhatia
5 Replies
9. Shell Programming and Scripting
Hi,
Could anyone help me with the following question, if I have two colums (names and frequency) as follows in a file called name.txt
Michael 1
Jones 1
Ben 2
Rebeca 4
David 1
and I want to use bash script called freqnames.sh that takes one argument (name) and the output should be... (3 Replies)
Discussion started by: jboy
3 Replies
10. Shell Programming and Scripting
Hi,
I have a file with more than 1 million records.. Each row has a distance number.. I want to know how many times is each number occurring from min to max number..
2
5
120
208
7
28
45
6
33
120
7
208
so onn..
output
0-0 (4 Replies)
Discussion started by: Diya123
4 Replies
LEARN ABOUT OPENDARWIN
processor_info
processor_info(2) System Calls processor_info(2)
NAME
processor_info - determine type and status of a processor
SYNOPSIS
#include <sys/types.h>
#include <sys/processor.h>
int processor_info(processorid_t processorid, processor_info_t *infop);
DESCRIPTION
The processor_info() function returns the status of the processor specified by processorid in the processor_info_t structure pointed to by
infop.
The structure processor_info_t contains the following members:
int pi_state;
char pi_processor_type[PI_TYPELEN];
char pi_fputypes[PI_FPUTYPE];
int pi_clock;
The pi_state member is the current state of the processor, either P_ONLINE, P_OFFLINE, P_NOINTR, P_FAULTED, P_SPARE, or P_POWEROFF.
The pi_processor_type member is a null-terminated ASCII string specifying the type of the processor.
The pi_fputypes member is a null-terminated ASCII string containing the comma-separated types of floating-point units (FPUs) attached to
the processor. This string will be empty if no FPU is attached.
The pi_clock member is the processor clock frequency rounded to the nearest megahertz. It may be 0 if not known.
RETURN VALUES
Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error.
ERRORS
The processor_info() function will fail if:
EINVAL An non-existent processor ID was specified.
The caller is in a non-global zone, the pools facility is active, and the processor is not a member of the zone's pool's
processor set.
EFAULT The processor_info_t structure pointed to by infop was not writable by the user.
SEE ALSO
pooladm(1M), psradm(1M), psrinfo(1M), zoneadm(1M), p_online(2), sysconf(3C)
SunOS 5.10 28 Jun 2004 processor_info(2)