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 |
FIRST_CPU | pseudo-name for the first logical cpu |
FIRST_DISK | pseudo-name for the first disk |
FIRST_DISKADAPTER | pseudo-name for the first disk adpate |
FIRST_NETINTERFACE | pseudo-name for the first network interface |
FIRST_PAGINGSPACE | pseudo-name for the first paging space |
FIRST_PROTOCOL | pseudo-name for the first protocol |
FIRST_NETBUFFER | pseudo-name for the first network buffer size |
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] | logical processor name (cpu0, cpu1, ..) |
u_longlong_t user | raw number of clock ticks spent in user mode |
u_longlong_t sys | raw number of clock ticks spent in system mode |
u_longlong_t idle | raw number of clock ticks spent idle |
u_longlong_t wait | raw number of clock ticks spent waiting for I/O |
_longlong_t pswitch | number of context switches (changes of currently running process) |
u_longlong_t syscall | number of system calls executed |
u_longlong_t sysread | number of read system calls executed |
u_longlong_t syswrite | number of write system calls executed |
u_longlong_t sysfork | number of fork system call executed |
u_longlong_t sysexec | number of exec system call executed |
u_longlong_t readch | number of characters tranferred with read system call |
u_longlong_t writech | number of characters tranferred with write system ca |
u_longlong_t bread | number of block reads |
u_longlong_t bwrite | number of block writes |
u_longlong_t lread | number of logical read requests |
u_longlong_t lwrite | number of logical write requests |
u_longlong_t phread | number of physical reads (reads on raw device) |
u_longlong_t phwrite | number of physical writes (writes on raw device) |
u_longlong_t iget | number of inode lookups |
u_longlong_t namei | number of vnode lookup from a path name |
u_longlong_t dirblk | number of 512-byte block reads by the directory search routine to locate an entry for a file |
u_longlong_t msg | number of IPC message operations |
u_longlong_t sema | number of IPC semaphore operations |
The perfstat_cpu_total_t structure contains the following members:
int ncpus | number of active logical processors |
int ncpus_cfg | number of configured processors |
char description [IDENTIFIER_LENGTH] | processor description (type/official name) |
u_longlong_t processorHZ | processor speed in Hz |
u_longlong_t user | raw total number of clock ticks spent in user mode |
u_longlong_t sys | raw total number of clock ticks spent in system mode |
u_longlong_t idle | raw total number of clock ticks spent idle |
u_longlong_t wait | raw total number of clock ticks spent waiting for I/O |
u_longlong_t pswitch | number of process switches (change in currently running process) |
u_longlong_t syscall | number of syscalls executed |
u_longlong_t sysread | number of read system calls executed |
u_longlong_t syswrite | number of write system calls executed |
u_longlong_t sysfork | number of forks system calls executed |
u_longlong_t sysexec | number of execs system calls executed |
u_longlong_t readch | number of characters tranferred with read system call |
u_longlong_t writech | number of characters tranferred with write system call |
u_longlong_t devintrs | number of device interrupts |
u_longlong_t softintrs | number of software interrupts |
ime_t lbolt | number of ticks since last reboot |
u_longlong_t loadavg[3] | (1<< SBITS) times the average number of runnables processes during the last 1, 5 and 15 minutes. To calculate the load average, divide the numbers by (1<< SBITS). SBITS is defined in <sys/proc.h>. |
u_longlong_t runque | length of the run queue (processes ready) |
u_longlong_t swpque | length of the swap queue (processes waiting to be paged in) |
u_longlong_t bread | number of blocks read |
u_longlong_t bwrite | number of blocks written |
u_longlong_t lread | number of logical read requests |
u_longlong_t lwrite | number of logical write requests |
u_longlong_t phread | number of physical reads (reads on raw devices) |
u_longlong_t phwrite | number of physical writes (writes on raw devices) |
u_longlong_t runocc | updated whenever runque is updated, i.e. the runqueue is occupied. This can be used to compute the simple average of ready processes |
u_longlong_t swpocc | updated whenever swpque is updated. i.e. the swpqueue is occupied. This can be used to compute the simple average processes waiting to be paged in |
u_longlong_t iget | number of inode lookups |
u_longlong_t namei | number of vnode lookup from a path name |
u_longlong_t dirblk | number of 512-byte block reads by the directory search routine to locate an entry for a file |
u_longlong_t msg | number of IPC message operations |
u_longlong_t sema | number of IPC semaphore operations |
u_longlong_t rcvint | number of tty receive interrupts |
u_longlong_t xmtint | number of tyy transmit interrupts |
u_longlong_t mdmint | number of modem interrupts |
u_longlong_t tty_rawinch | number of raw input characters |
u_longlong_t tty_caninch | number of canonical input characters (always zero) |
u_longlong_t tty_rawoutch | number of raw output characters |
u_longlong_t ksched | number of kernel processes created |
u_longlong_t koverf | number of kernel process creation
attempts where:
|
u_longlong_t kexit | number of kernel processes that became zombies |
u_longlong_t rbread | number of remote read requests |
u_longlong_t rbread | number of remote read requests |
u_longlong_t rbwrt | number of remote writes |
u_longlong_t rcwrt | number of cached remote writes |
u_longlong_t traps | number of traps |
nt ncpus_high | index of highest procssor online |
The perfstat_disk_t structure contains the following members:
char name[IDENTIFIER_LENGTH] name of the disk char description[IDENTIFIER_LENGTH] disk description (from ODM) char vgname[IDENTIFIER_LENGTH] volume group name (from ODM) u_longlong_t size size of the disk (in MB) u_longlong_t free free portion of the disk (in MB) u_longlong_t bsize disk block size(in bytes) u_longlong_t xrate kbytes/sec xfer rate capability u_longlong_t xfers number of transfers to/from disk u_longlong_t wblks number of blocks written to disk u_longlong_t rblks number of blocks read from disk u_longlong_t qdepth queue depth u_longlong_t time amount of time disk is active char adapter[IDENTIFIER_LENGTH] disk adapter name (from ODM)
The perfstat_disk_total_t structure contains the following members:
int number total number of disks u_longlong_t size total size of all disks (in MB) u_longlong_t free free portion of all disks (in MB) u_longlong_t xrate total kbytes/sec xfer rate capability u_longlong_t xfers total number of transfers to/from disk 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 disks are active
The perfstat_diskadapter_t structure contains the following members:
char name[IDENTIFIER_LENGTH] name of the adapter (from ODM) char description[IDENTIFIER_LENGTH] adapter description (from ODM) int number number of disks connected to adapter u_longlong_t size total size of all disks (in MB) u_longlong_t free free portion of all disks (in MB) u_longlong_t xrate total kbytes/sec xfer rate capability u_longlong_t xfers total number of transfers to/from disk u_longlong_t wblks blocks written via adapter u_longlong_t rblks blocks read via adapter u_longlong_t time amount of time disks are active
The perfstat_memory_total_t structure contains the following members:
u_longlong_t virt_total total virtual memory (in 4KB pages) u_longlong_t real_total total real memory (in 4KB pages) u_longlong_t real_free free real memory (in 4KB pages) u_longlong_t real_pinned real memory which is pinned (in 4KB pages) u_longlong_t real_inuse real memory which is in use (in 4KB pages) u_longlong_t pgbad number of bad pages u_longlong_t pgexct number of page faults u_longlong_t pgins number of pages paged in u_longlong_t pgouts number of pages paged out u_longlong_t pgspins number of page ins from paging space u_longlong_t pgspouts number of page outs from paging space u_longlong_t scans number of page scans by clock u_longlong_t cycles number of page replacement cycles u_longlong_t pgsteals number of page steals u_longlong_t numperm number of frames used for files (in 4KB pages) u_longlong_t pgsp_total total paging space (in 4KB pages) u_longlong_t pgsp_free free paging space (in 4KB pages) u_longlong_t pgsp_rsvd reserved paging space (in 4KB pages) u_longlong_t real_system real memory used by system segments (in 4KB pages). This is the sum of all the used pages in segment marked for system usage. Since segment classifications are not always guaranteed to be accurate, this number is only an approximation. u_longlong_t real_user real memory used by non-system segments (in 4KB pages). This is the sum of all pages used in segments not marked for system usage. Since segment classifications are not always guaranteed to be accurate, this number is only an approximation. u_longlong_t real_process real memory used by process segments (in 4KB pages). This is real_total-real_free-numperm-real_system. Since real_system is an approximation, this number is as well.
The perfstat_netinterface_t structure contains the following members:
char name[IDENTIFIER_LENGTH] name of the interface char description[IDENTIFIER_LENGTH] interface description (from ODM, similar to lscfg output) uchar type ethernet, tokenring, etc. interpretation can be done using /usr/include/net/if_types.h u_longlong_t mtu network frame size u_longlong_t ipacets number of packets received on interface u_longlong_t ibytes number of bytes received on interface u_longlong_t ierrors number of input errors on interface u_longlong_t opackets number of packets sent on interface u_longlong_t obytes number of bytes sent on interface u_longlong_t oerrors number of output errors on interface u_longlong_t collisions number of collisions on csma interface u_longlong_t bitrate adapter rating in bit per second
The perfstat_netinterface_total_t structure contains the following members:
int number number of network interfaces u_longlong_t ipackets number of packets received on interface u_longlong_t ibytes number of bytes received on interface u_longlong_t ierrors number of input errors on interface u_longlong_t opackets number of packets sent on interface u_longlong_t obytes number of bytes sent on interface u_longlong_t oerrors number of output errors on interface u_longlong_t collisions number of collisions on csma interface
The perfstat_pagingspace_t structure contains the following members:
char name[IDENTIFIER_LENGTH] paging space name char type type of paging device. Possible values are: LV_PAGING logical volume NFS_PAGING NFS file
The nfs_paging union has the following fields:
char nfs_paging.hostname[IDENTIFIER_LENGTH] host name of paging server char nfs_paging.filename[IDENTIFIER_LENGTH] swap file name on server
The lv_paging union has the following fields:
char lv_paging.vgname[IDENTIFIER_LENGTH] volume group name longlong_t lp_size size in number of logical partitions longlong_t mb_size size in megabytes longlong_t mb_used portion used in megabytes longlong_t io_pending number of pending I/O char active indicates if active (1 if so, 0 if not) char automatic indicates if automatic (1 if so, 0 if not)
The perfstat_netbuffer_t structure contains the following members:
char name[IDENTIFIER_LENGTH] size in ascii, always power of 2 (ex: "32", "64", "128") u_longlong_t inuse number of buffer currently allocated u_longlong_t calls number of buffer allocations since last reset u_longlong_t delayed number of delayed allocations u_longlong_t free number of free calls u_longlong_t failed number of failed allocations u_longlong_t highwatermark high threshold for number of buffer allocated u_longlong_t freed number of buffers freed
The perfstat_protool_t structure contains the following members:
char name[IDENTIFIER_LENGTH] ip, ipv6, icmp, icmpv6, udp, tcp, rpc, nfs, nfsv2, nfsv8
The ip union contains the following fields:
u_longlong_t ip.ipackets number of input packets u_longlong_t ip.ierrors number of input errors u_longlong_t ip.iqueueoverflow number of input queue overflows u_longlong_t ip.opackets number of output packets u_longlong_t ip.oerrors number of output errors The ipv6 union contains the following fields: _longlong_t ipv6.ipackets number of input packets u_longlong_t ipv6.ierrors number of input errors u_longlong_t ipv6.iqueueoverflow number of input queue overflows u_longlong_t ipv6.opackets number of output packets u_longlong_t ipv6.oerrors number of output errors The icmp union contains the following fields: u_longlong_t icmp.received number of packets received u_longlong_t icmp.sent number of packets sent u_longlong_t icmp.errors number of errors The icmpv6 union contains the following fields: u_longlong_t icmpv6.received number of packets received u_longlong_t icmpv6.sent number of packets sent u_longlong_t icmpv6.errors number of errors The udp union contains the following fields: u_longlong_t udp.ipackets number of input packets u_longlong_t udp.ierrors number of input errors u_longlong_t udp.opackets number of output packets u_longlong_t udp.no_socket number of packets dropped due to no socket The tcp union contains the following fields: u_longlong_t tcp.ipackets number of input packets u_longlong_t tcp.ierrors number of input errors u_longlong_t tcp.opackets number of output packets u_longlong_t tcp.initiated number of connections initiated u_longlong_t tcp.accepted number of connections accepted u_longlong_t tcp.established number of connections established u_longlong_t tcp.dropped number of connections dropped The rpc union contains the following fields: u_longlong_t rpc.client.stream.calls total NFS client RPC connection-oriented calls u_longlong_t rpc.client.stream.badcalls rejected NFS client RPC calls u_longlong_t rpc.client.stream.badxids bad NFS client RPC call responses u_longlong_t rpc.client.stream.timeouts timed out NFS client RPC calls with no reply u_longlong_t rpc.client.stream.newcreds total NFS client RPC authentication refreshes u_longlong_t rpc.client.stream.badverfs total NFS client RPC bad verifier in response u_longlong_t rpc.client.stream.timers NFS client RPC timout greater than timeout value u_longlong_t rpc.client.stream.nomem NFS client RPC calls memory allocation failure u_longlong_t rpc.client.stream.cantconn failed NFS client RPC calls u_longlong_t rpc.client.stream.interrupts NFS client RPC calls fail due to interrupt u_longlong_t rpc.client.dgram.calls total NFS client RPC connectionless calls u_longlong_t rpc.client.dgram.badcalls rejected NFS client RPC calls u_longlong_t rpc.client.dgram.retrans retransmitted NFS client RPC calls u_longlong_t rpc.client.dgram.badxids bad NFS client RPC call responses u_longlong_t rpc.client.dgram.timeouts timed out NFS client RPC calls with no reply u_longlong_t rpc.client.dgram.newcreds total NFS client RPC authentication refreshes u_longlong_t rpc.client.dgram.badverfs total NFS client RPC bad verifier in response u_longlong_t rpc.client.dgram.timers NFS client RPC timout greater than timeout value u_longlong_t rpc.client.dgram.nomem NFS client RPC calls memory allocation failure u_longlong_t rpc.client.dgram.cantsend NFS client RPC calls not sent u_longlong_t rpc.server.stream.calls total NFS server RPC connection-oriented requests u_longlong_t rpc.server.stream.badcalls rejected NFS server RPC requests u_longlong_t rpc.server.stream.nullrecv NFS server RPC calls failed due to unavailable packet u_longlong_t rpc.server.stream.badlen NFS server RPC requests failed due to bad length u_longlong_t rpc.server.stream.xdrcall NFS server RPC requests failed due to bad header u_longlong_t rpc.server.stream.dupchecks NFS server RPC calls found in request cache u_longlong_t rpc.server.stream.dupreqs total NFS server RPC call duplicates u_longlong_t rpc.server.dgram.calls total NFS server RPC connectionless requests u_longlong_t rpc.server.dgram.badcalls rejected NFS server RPC requests u_longlong_t rpc.server.dgram.nullrecv NFS server RPC calls failed due to unavailable packet u_longlong_t rpc.server.dgram.badlen NFS server RPC requests failed due to bad length u_longlong_t rpc.server.dgram.xdrcall NFS server RPC requests failed due to bad header u_longlong_t rpc.server.dgram.dupchecks NFS server RPC calls found in request cache u_longlong_t rpc.server.dgram.dupreqs total NFS server RPC call duplicates The nfs union contains the following fields: u_longlong_t nfs.client.calls total NFS client requests u_longlong_t nfs.client.badcalls total NFS client failed calls u_longlong_t nfs.client.clgets total number of client nfs clgets u_longlong_t nfs.client.cltoomany total number of client nfs cltoomany u_longlong_t nfs.server.calls total NFS server requests u_longlong_t nfs.server.badcalls total NFS server failed calls u_longlong_t nfs.server.public_v2 total number of nfs version 2 server calls u_longlong_t nfs.server.public_v3 total number of nfs version 3 server calls The nfsv2 union contains the following fields: u_longlong_t nfsv2.client.calls NFS V2 client requests u_longlong_t nfsv2.client.null NFS V2 client null requests u_longlong_t nfsv2.client.getattr NFS V2 client getattr requests u_longlong_t nfsv2.client.setattr NFS V2 client setattr requests u_longlong_t nfsv2.client.root NFS V2 client root requests u_longlong_t nfsv2.client.lookup NFS V2 client file name lookup requests u_longlong_t nfsv2.client.readlink NFS V2 client readlink requests u_longlong_t nfsv2.client.read NFS V2 client read requests u_longlong_t nfsv2.client.writecache NFS V2 client write cache requests u_longlong_t nfsv2.client.write NFS V2 client write requests u_longlong_t nfsv2.client.create NFS V2 client file creation requests u_longlong_t nfsv2.client.remove NFS V2 client file removal requests u_longlong_t nfsv2.client.rename NFS V2 client file rename requests u_longlong_t nfsv2.client.link NFS V2 client link creation requests u_longlong_t nfsv2.client.symlink NFS V2 client symbolic link creation requests u_longlong_t nfsv2.client.mkdir NFS V2 client directory creation requests u_longlong_t nfsv2.client.rmdir NFS V2 client directory removal requests u_longlong_t nfsv2.client.readdir NFS V2 client read-directory requests u_longlong_t nfsv2.client.statfs NFS V2 client file stat requests u_longlong_t nfsv2.server.calls NFS V2 server requests u_longlong_t nfsv2.server.null NFS V2 server null requests u_longlong_t nfsv2.server.getattr NFS V2 server getattr requests u_longlong_t nfsv2.server.setattr NFS V2 server setattr requests u_longlong_t nfsv2.server.root NFS V2 server root requests u_longlong_t nfsv2.server.lookup NFS V2 server file name lookup requests u_longlong_t nfsv2.server.readlink NFS V2 server readlink requests u_longlong_t nfsv2.server.read NFS V2 server read requests u_longlong_t nfsv2.server.writecache NFS V2 server cache requests u_longlong_t nfsv2.server.write NFS V2 server write requests u_longlong_t nfsv2.server.create NFS V2 server file creation requests u_longlong_t nfsv2.server.remove NFS V2 server file removal requests u_longlong_t nfsv2.server.rename NFS V2 server file rename requests u_longlong_t nfsv2.server.link NFS V2 server link creation requests u_longlong_t nfsv2.server.symlink NFS V2 server symbolic link creation requests u_longlong_t nfsv2.server.mkdir NFS V2 server directory creation requests u_longlong_t nfsv2.server.rmdir NFS V2 server directory removal requests u_longlong_t nfsv2.server.readdir NFS V2 server read-directory requests u_longlong_t nfsv2.server.statfs NFS V2 server file stat requests The nfsv3 union contains the following fields: u_longlong_t nfsv3.client.calls NFS V3 client calls u_longlong_t nfsv3.client.null NFS V3 client null requests u_longlong_t nfsv3.client.getattr NFS V3 client getattr requests u_longlong_t nfsv3.client.setattr NFS V3 client setattr requests u_longlong_t nfsv3.client.lookup NFS V3 client file name lookup requests u_longlong_t nfsv3.client.access NFS V3 client access requests u_longlong_t nfsv3.client.readlink NFS V3 client readlink requests u_longlong_t nfsv3.client.read NFS V3 client read requests u_longlong_t nfsv3.client.write NFS V3 client write requests u_longlong_t nfsv3.client.create NFS V3 client file creation requests u_longlong_t nfsv3.client.mkdir NFS V3 client directory creation requests u_longlong_t nfsv3.client.symlink NFS V3 client symbolic link creation requests u_longlong_t nfsv3.client.mknod NFS V3 client mknod creation requests u_longlong_t nfsv3.client.remove NFS V3 client file removal requests u_longlong_t nfsv3.client.rmdir NFS V3 client directory removal requests u_longlong_t nfsv3.client.rename NFS V3 client file rename requests u_longlong_t nfsv3.client.link NFS V3 client link creation requests u_longlong_t nfsv3.client.readdir NFS V3 client read-directory requests u_longlong_t nfsv3.client.readdirplus NFS V3 client read-directory plus requests u_longlong_t nfsv3.client.fsstat NFS V3 client file stat requests u_longlong_t nfsv3.client.fsinfo NFS V3 client file info requests u_longlong_t nfsv3.client.pathconf NFS V3 client path configure requests u_longlong_t nfsv3.client.commit NFS V3 client commit requests u_longlong_t nfsv3.server.calls NFS V3 server requests u_longlong_t nfsv3.server.null NFS V3 server null requests u_longlong_t nfsv3.server.getattr NFS V3 server getattr requests u_longlong_t nfsv3.server.setattr NFS V3 server setattr requests u_longlong_t nfsv3.server.lookup NFS V3 server file name lookup requests u_longlong_t nfsv3.server.access NFS V3 server file access requests u_longlong_t nfsv3.server.readlink NFS V3 server readlink requests u_longlong_t nfsv3.server.read NFS V3 server read requests u_longlong_t nfsv3.server.write NFS V3 server write requests u_longlong_t nfsv3.server.create NFS V3 server file creation requests u_longlong_t nfsv3.server.mkdir NFS V3 server director6 creation requests u_longlong_t nfsv3.server.symlink NFS V3 server symbolic link creation requests u_longlong_t nfsv3.server.mknod NFS V3 server mknode creation requests u_longlong_t nfsv3.server.remove NFS V3 server file removal requests u_longlong_t nfsv3.server.rmdir NFS V3 server directory removal requests u_longlong_t nfsv3.server.rename NFS V3 server file rename requests u_longlong_t nfsv3.server.link NFS V3 server link creation requests u_longlong_t nfsv3.server.readdir NFS V3 server read-directory requests u_longlong_t nfsv3.server.readdirplus NFS V3 server read-directory plus requests u_longlong_t nfsv3.server.fsstat NFS V3 server file stat requests u_longlong_t nfsv3.server.fsinfo NFS V3 server file info requests u_longlong_t nfsv3.server.pathconf NFS V3 server path configure requests u_longlong_t nfsv3.server.commit NFS V3 server commit requests The following are declared as functions: int perfstat_cpu(perfstat_id_t *name, perfstat_cpu_t *userbuff, int sizeof_userbuff, int desired_number) int perfstat_cpu_total(perfstat_id_t *name, perfstat_cpu_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_disk_total(perfstat_id_t *name, perfstat_disk_total_t *userbuff, int sizeof_userbuff, int desired_number) int perfstat_diskadapter(perfstat_id_t *name, perfstat_diskadapter_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(perfstat_id_t *name, perfstat_netinterface_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_pagingspace(perfstat_id_t *name, perfstat_pagingspace_t *userbuff, int sizeof_userbuff, int desired_number) int perfstat_netbuffer(perfstat_id_t *name, perfstat_netbuffer_t *userbuff, int sizeof_userbuff, int desired_number) int perfstat_protocol(perfstat_id_t *name, perfstat_protocol_t *userbuff, int sizeof_userbuff, int desired_number) void perfsta_reset(void) Related Information
The perfstat_cpu subroutine, perfstat_cpu_total subroutine, perfstat_memory_total subroutine, perfstat_disk subroutine, perfstat_disk_total subroutine, perfstat_diskadapter subroutine, perfstat_netinterface subroutine, and perfstat_netinterface_total subroutine, perfstat_pagingspace subroutine, perfstat_netbuffer subroutine, perfstat_protocol, and perfstat_reset subroutines.
Perfstat API tool in AIX 5L Version 5.2 Performance Tools Guide and Reference