perfstat_partial_reset Subroutine

Purpose

Empties part of the libperfstat configuration information cache or resets system minimum and maximum counters for disks.

Library

perfstat library (libperfstat.a)

Syntax

#include <libperfstat.h>

int perfstat_partial_reset (name, resetmask)
char * name;
u_longlong_t resetmask;

Description

The perfstat_cpu_total, perfstat_disk, perfstat_diskadapter, perfstat_netinterface, and perfstat_pagingspace subroutines return configuration information that is retrieved from the ODM database and automatically cached by the library. Other metrics provided by the LVM library and the swapqry subroutine are also cached for performance purpose.

The perfstat_partial_reset subroutine flushes some of this information cache and should be called whenever an identified part of the machine configuration has changed.

The perfstat_partial_reset subroutine can be used to reset a particular component (such as hdisk0 or en1) when the name parameter is not NULL and the resetmask parameter contains only one bit. It can also be used to remove a whole category (such as disks or disk paths) from the cached information.

When the name parameter is NULL, the resetmask parameter can contain a combination of bits, such as FLUSH_DISK|RESET_DISK_MINMAX|FLUSH_CPUTOTAL.

Several bit masks are available for the resetmask parameter. The behavior of the function is as follows:
resetmask value Action when name is NULL Action when name is not NULL and a single resetmask is set
FLUSH_CPUTOTAL Flush speed and description in the perfstat_cputotal_t structure An error is returned, and errno is set to EINVAL.
FLUSH_DISK Flush description, adapter, size, free, and vgname in every perfstat_disk_t structure. Flush the list of disk adapters. Flush size, free, and description in every perfstat_diskadapter_t structure. Flush description, adapter, size, free, and vgname in the specified perfstat_disk_t structure. Flush adapter in every perfstat_diskpath_t that matches the disk name followed by _Path. Flush size, free, and description of each perfstat_diskadapter_t that is linked to a path leading to this disk or to the disk itself.
RESET_DISK_ALL Reset system resident all fields in every perfstat_disk_t structure. An error is returned, and errno is set to EINVAL.
RESET_DISK_MINMAX Reset system resident min_rserv, max_rserv, min_wserv, max_wserv, wq_min_time and wq_max_time in every perfstat_disk_t structure. An error is returned, and errno is set to ENOTSUP.
FLUSH_DISKADAPTER Flush the list of disk adapters. Flush size, free, and description in every perfstat_diskadapter_t structure. Flush adapter in every perfstat_diskpath_t structure. Flush description and adapter in every perfstat_disk_t structure. Flush the list of disk adapters. Flush size, free, and description in the specified perfstat_diskadapter_t structure.
FLUSH_DISKPATH Flush adapter in every perfstat_diskpath_t structure. Flush adapter in the specified perfstat_diskpath_t structure.
FLUSH_PAGINGSPACE Flush the list of paging spaces. Flush automatic, type, lpsize, mbsize, hostname, filename, and vgname in every perfstat_pagingspace_t structure. Flush the list of paging spaces. Flush automatic, type, lpsize, mbsize, hostname, filename, and vgname in the specified perfstat_pagingspace_t structure.
FLUSH_NETINTERFACE Flush description in every perfstat_netinterface_t structure. Flush description in the specified perfstat_netinterface_t structure.

This subroutine is not supported inside a workload partition (WPAR). It is not aware of a WPAR.

Parameters

Item Description
name Contains a name identifying the component that metrics should be reset from the libperfstat cache. If this parameter is NULL, matches every component.
resetmask The category of the component if the name parameter is not NULL. The available values are listed in the preceding table. In case the name parameter is NULL, the resetmask parameter can be a combination of bits.

Return Values

The perfstat_partial_reset subroutine returns a value of 0 upon successful completion. If unsuccessful, a value of -1 is returned, and the errno global variable is set to the appropriate code.

Error Codes

Item Description
EINVAL One of the parameters is not valid.

Files

The libperfstat.h file defines standard macros, data types, and subroutines.