04-11-2002
I tried your code and it worked for me. If nlist returns a zero that is good. Are you getting -1? Are you running as root? You really need to check the result from the open as well.
But the values in that structure were all zeroes. I don't think it is being used. This is the touble with poking around in the kernel. HP changes stuff in there at will. If you get want the cpu times, I would use pstat(). If you must extract them via these calls, I think, that the stuff in sys/dk.h is a better choice.
10 More Discussions You Might Find Interesting
1. Filesystems, Disks and Memory
hi,
In response to your cpu usage answer
I too read sys/sysinfo.h but , if we put these values to access the repective time fields in the array pst_cpu_time which is a member of the structure pst_dynamic values doesn't seem to match, why is like this? (0 Replies)
Discussion started by: sushaga
0 Replies
2. Programming
how can i monitor usages of CPU, Memory, Hard disk etc. under SUN Solaries
through a c program or java program
i want to store that data into database so i can show it graphically
thanks in advance (2 Replies)
Discussion started by: Gajanad Bihani
2 Replies
3. UNIX for Dummies Questions & Answers
when i got the cpu usage values of the all process
running in my sytem i see that 140% of the cpu is used.
(using ps aux command)
i have a 4 cpu system.
can we say that averagely 35% of each cpu is used?
and if i want to speak more precisely,
how can i find out that, which cpu is used at... (4 Replies)
Discussion started by: gfhgfnhhn
4 Replies
4. Programming
Please tell me solaris functions/api for getting following information
1- Function that tells how much memory used by current process
2- Function that tells how much memory used by all running processes
3- Function that tells how much CPU is used by current process
4- Function that tells how... (1 Reply)
Discussion started by: mansoorulhaq
1 Replies
5. Programming
Hi all,
When I have a below while loop in my code (This observation is same for C and Perl)
i= 0;
while(1)
{
i++;
}
for above the CPU uses goes beyond 49% on hp-ux machine, why cpu usage increase at this level for just a simple while loop?
and if I have a single print statement... (2 Replies)
Discussion started by: zing_foru
2 Replies
6. HP-UX
how can I find cpu usage memory usage swap usage and
I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times
my final destination is monitor process
logical volume usage above X % and number of Logical voluage above
can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies
7. Solaris
Hi,
I want to monitor the current cpu usage, monitor usage , disk I/o and network utlization for solaris using SNMP.
I want the oids for above tasks.
can you please tell me that
Thank you (2 Replies)
Discussion started by: S_venkatesh
2 Replies
8. Solaris
Hello Friends,
On one of my Solaris 10 box, CPU usage shows 100% using "sar", "vmstat". However, it has 4 CPUs and prstat and glance are not showing enough processes to justify high CPU utilization.
=========================================================================
$ prstat -a
... (4 Replies)
Discussion started by: mahive
4 Replies
9. Windows & DOS: Issues & Discussions
Hi all,
Top command is used to monitor CPU usage in unix,solaris etc..likewise is there any command in windows environment?
Regards
William (3 Replies)
Discussion started by: William1482
3 Replies
10. AIX
How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies
LEARN ABOUT OPENSOLARIS
nlist
nlist(3UCB) SunOS/BSD Compatibility Library Functions nlist(3UCB)
NAME
nlist - get entries from symbol table
SYNOPSIS
/usr/ucb/cc [ flag ... ] file ...
#include <nlist.h>
int nlist(filename, nl)
char *filename;
struct nlist *nl;
DESCRIPTION
nlist() examines the symbol table from the executable image whose name is pointed to by filename, and selectively extracts a list of values
and puts them in the array of nlist structures pointed to by nl. The name list pointed to by nl consists of an array of structures contain-
ing names, types and values. The n_name field of each such structure is taken to be a pointer to a character string representing a symbol
name. The list is terminated by an entry with a NULL pointer (or a pointer to a NULL string) in the n_name field. For each entry in nl, if
the named symbol is present in the executable image's symbol table, its value and type are placed in the n_value and n_type fields. If a
symbol cannot be located, the corresponding n_type field of nl is set to zero.
RETURN VALUES
Upon normal completion, nlist() returns the number of symbols that were not located in the symbol table. If an error occurs, nlist()
returns -1 and sets all of the n_type fields in members of the array pointed to by nl to zero.
SEE ALSO
cc(1B), nlist(3ELF), a.out(4)
NOTES
Use of these interfaces should be restricted to only applications written on BSD platforms. Use of these interfaces with any of the system
libraries or in multi-thread applications is unsupported.
Only the n_value field is compatibly set. Other fields in the nlist structure are filled with the ELF (Executable and Linking Format)
values (see nlist(3ELF) and a.out(4)).
SunOS 5.11 30 Oct 2007 nlist(3UCB)