Describes the structures and constants used by the libperfstat API subroutines.
#include <libperfstat.h>
The libperfstat.h file defines the following symbolic constants, types, and structures:
IDENTIFIER_LENGTH length of strings included in the structures
The perfstat_id_t structure contains the following members:
char name[IDENTIFIER_LENGTH] name of the identifier
The perfstat_cpu_t structure contains the following members:
char name[IDENTIFIER_LENGTH] CPU name (proc0, proc1, ..) u_longlong_t user CPU user time (raw ticks) u_longlong_t sys CPU sys time (raw ticks) u_longlong_t idle CPU idle time (raw ticks) u_longlong_t wait CPU wait time (raw ticks) u_longlong_t pswitch incremented whenever current running process changes u_longlong_t syscall number of syscalls u_longlong_t sysread number of readings u_longlong_t syswrite number of writings u_longlong_t sysfork number of forks u_longlong_t sysexec number of execs u_longlong_t readch number of bytes read by CPU u_longlong_t writech number of bytes written by CPU
The perfstat_cpu_total_t structure contains the following members:
Int ncpus number of active CPUs Int ncpus_cfg number of configured CPUs char description[IDENTIFIER_LENGTH] CPU description u_longlong_t processorHZ CPU speed in Hz u_longlong_t user CPU user time (raw ticks) u_longlong_t sys CPU sys time (raw ticks) u_longlong_t idle CPU idle time (raw ticks) u_longlong_t wait CPU wait time (raw ticks) u_longlong_t pswitch number of changes of the current running process u_longlong_t syscall number of syscalls executed u_longlong_t sysread number of read system calls u_longlong_t syswrite number of write system calls u_longlong_t sysfork number of forks u_longlong_t sysexec number of execs u_longlong_t readch total number of bytes read u_longlong_t writech total number of bytes written u_longlong_t devintrs total number of interrupts u_longlong_t softintrs total number of software interrupts time_t lbolt number of ticks since last reboot u_longlong_t loadavg[3] load average now, last 5 minutes, last 15 minutes u_longlong_t runque average length of the run queue u_longlong_t swpque average length of the swap queue
The perfstat_disk_t structure contains the following members:
char name[IDENTIFIER_LENGTH] name of the disk char description[IDENTIFIER_LENGTH] disk description u_longlong_t size size of the disk (MB) u_longlong_t free free portion of the disk (MB) u_longlong_t bsize disk block size(bytes) u_longlong_t xrate kbytes/sec xfer rate capability u_longlong_t xfers total transfers to/from disk u_longlong_t wblks blocks written to disk u_longlong_t rblks blocks read from disk u_longlong_t qdepth queue depth u_longlong_t time amount of time disk is active
The perfstat_disk_total_t structure contains the following members:
int number Number of disks u_longlong_t size size of the disks (MB) u_longlong_t free free portion of the disks (MB) u_longlong_t xrate average kbytes/sec xfer rate capability u_longlong_t xfers total transfers to/from disks u_longlong_t wblks blocks written to all disks u_longlong_t rblks blocks read from all disks u_longlong_t time amount of time disk is active
The perfstat_memory_total_t structure contains the following members:
u_longlong_t virt_total total virtual memory (4K pages) u_longlong_t real_total total real memory (4K pages) u_longlong_t real_free free real memory (4K pages) u_longlong_t real_pinned real memory which is pinned (4K pages) u_longlong_t real_inuse real memory which is in use (4K pages) u_longlong_t pgbad count of bad pages u_longlong_t pgexct count of page faults u_longlong_t pgins count of pages paged in u_longlong_t pgouts count of pages paged out u_longlong_t pgspins count of page ins from paging space u_longlong_t pgspouts count of page outs from paging space u_longlong_t scans count of page scans by clock u_longlong_t cycles count of clock hand cycles u_longlong_t pgsteals count of page steals u_longlong_t numperm number frames non-working u_longlong_t pgsp_total total paging space (4K pages) u_longlong_t pgsp_free free paging space (4K pages) u_longlong_t pgsp_rsvd reserved paging space (4K pages)
The perfstat_netinterface_t structure contains the following members:
char name[IDENTIFIER_LENGTH] name of the interface char description[IDENTIFIER_LENGTH] interface description (lscfg type output) uchar type ethernet, tokenring, etc. -> interpretation using /usr/include/net/if_types.h u_longlong_t mtu network frame size u_longlong_t ipackets packets received on interface u_longlong_t ibytes bytes received on interface u_longlong_t ierrors input errors on interface u_longlong_t opackets packets sent on interface u_longlong_t obytes bytes sent on interface u_longlong_t oerrors output errors on interface u_longlong_t collisions collisions on csma interface
The perfstat_netinterface_total_t structure contains the following members:
int number interfaces count u_longlong_t ipackets packets received on interface u_longlong_t ibytes bytes received on interface u_longlong_t ierrors input errors on interface u_longlong_t opackets packets sent on interface u_longlong_t obytes bytes sent on interface u_longlong_t oerrors output errors on interface u_longlong_t collisions collisions on csma interface
The following are declared as functions:
int perfstat_cpu_total(perfstat_id_t *name, perfstat_cpu_total_t* userbuff, int sizeof_userbuff, int desired_number) int perfstat_cpu(perfstat_id_t *name, perfstat_cpu_t* userbuff, int sizeof_userbuff, int desired_number) int perfstat_disk_total(perfstat_id_t *name, perfstat_disk_total_t* userbuff, int sizeof_userbuff, int desired_number) int perfstat_disk(perfstat_id_t *name, perfstat_disk_t* userbuff, int sizeof_userbuff, int desired_number) int perfstat_memory_total(perfstat_id_t *name, perfstat_memory_total_t* userbuff, int sizeof_userbuff, int desired_number) int perfstat_netinterface_total(perfstat_id_t *name, perfstat_netinterface_total_t* userbuff, int sizeof_userbuff, int desired_number) int perfstat_netinterface(perfstat_id_t *name, perfstat_netinterface_t* userbuff, int sizeof_userbuff, int desired_number)
The libperfstat.h file is part of the Base Operating System (BOS) runtime.
The perfstat_cpu subroutine, perfstat_cpu_total subroutine, perfstat_memory_total subroutine, perfstat_disk subroutine, perfstat_disk_total subroutine, perfstat_netinterface subroutine, and perfstat_netinterface_total subroutine.