| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 3: Library Interfaces and Headers Oracle Solaris 11 Information Library |
Library Interfaces and Headers
SMHBA_GetAdapterAttributes(3LIB)
SMHBA_GetAdapterPortAttributes(3LIB)
SMHBA_GetBindingCapability(3LIB)
SMHBA_GetDiscoveredPortAttributes(3LIB)
SMHBA_GetFCPhyAttributes(3LIB)
SMHBA_GetPersistentBinding(3LIB)
SMHBA_GetPortAttributesByWWN(3LIB)
SMHBA_GetProtocolStatistics(3LIB)
SMHBA_GetSASPhyAttributes(3LIB)
SMHBA_GetVendorLibraryAttributes(3LIB)
SMHBA_GetWrapperLibraryAttributes(3LIB)
SMHBA_RegisterForAdapterAddEvents(3LIB)
SMHBA_RegisterForAdapterEvents(3LIB)
SMHBA_RegisterForAdapterPhyStatEvents(3LIB)
SMHBA_RegisterForAdapterPortEvents(3LIB)
SMHBA_RegisterForAdapterPortStatEvents(3LIB)
SMHBA_RegisterForTargetEvents(3LIB)
SMHBA_RemoveAllPersistentBindings(3LIB)
SMHBA_RemovePersistentBinding(3LIB)
- zones statistics library
cc [flag ...]file -lzonestat [library... ]#include <zonestat.h>
Functions in this library provide a general purpose mechanism for providing zonerelated resource usage statistics.
Thezonestat library reports system wide and per-zone utilization of physical memory,virtual memory, and CPU resources.
Physical memory usage is reported for both RSS and locked memory. Residentset size (RSS) is the quantity of physical memory that is inuse by each zone. Locked memory is physical memory pinned by applicationsin zones, usually for performance purposes. Physical memory which is locked cannot bepaged out to disk when there is memory pressure.
The virtual memory reported is the total memory allocated by each zone.This includes both anonymous memory allocated by processes (heap, stack, anon), systemV shared memory, and memory consumed bytmpfs file systems (/tmp). Thesystem's total virtual memory is the sum of its physical memory (RAM) anddisk swap devices.
CPU utilization is reported both in terms of total CPU as wellas relative to any processor sets. Processor sets can be created bypsrset(1M), resource pools (poolcfg(1M)), and by dedicated CPU resources created viazonecfg(1M). Itis possible for a zone to consume CPU time in more thanone processor set. This can be due a zone's processes being boundto multiple processor sets, or due to an entire zone being reboundfrom one processor set to another.
For each physical resource, overall usage is reported, as well as systemusage, aggregate usage by all zones, and per-zone usage. system usage reflectsusage by the system which cannot be attributed to a particular zone,such as resource usage by service threads in the kernel.
In addition to usage of physical resources,libzonestat also reports resource usagerelative to each zone's configured resource limits.
This library depends on the zones monitoring service:
svc:/system/zones-monitoring:default
The library will fail to open and read resource usage information ifthis service is not online. From within a NGZ, the globalzone must have an online zones monitoring service for the library tofunction.
Thezs_open(3ZONESTAT) function is used to create a handle to the zonesmonitoring service. Thezs_usage_read(3ZONESTAT) function is used to read the current usageinformation. This usage information can then be inspected using the remaining libraryfunctions. There are also library functions for comparing two usage readings. These arethezs_usage_*() functions.
Each usage reading contains usage information on a variety of resource types.Thezs_resource_*() functions can be used to access the usage of eachresource stored in a usage reading. The following resource types are supported:
The system's online CPUs. This includes all CPUs thaton-line orno-intr state.
This resource is an increasing resource, with values reflecting utilization sincezs_open() was first called.
The CPU resource in term ofncpus * 100 is retrieved viazs_resource_*_int64(). These values will reflect the quantity of CPUs used sincezs_open() was first called.
Thezs_resource_total_time(),zs_resource_used_time(), andzs_resource_zone_used_time() functions return increasing utilization values. These values continually increase, starting from zero at the point whenzs_open() was first called.
The system's physical memory usage in terms of resident pages (RSS).
The system's physical memory usage in terms of locked (unpageable) pages.
Reserved virtual memory. Virtual memory is comprised of the system's RAM and disk swap devices. Virtual memory is reserved when applications allocate memory, such as viabrk(2),malloc(3C),mmap(MAP_ANON), orshmget(2).
The amount of space allocated on disk swap devices. This is the amount of memory that is currently paged out to swap devices. OnlyZS_USER_ALL andZS_FREE is available for the disk swap resource (see user options below).libzonestat does not report a disk swap usage breakdown by the system and zones.
The number of lightweight processes allocated. There is noZS_USER_SYSTEM user for this resource.
The number of processes allocated. This includes zombie processes. There is noZS_USER_SYSTEM user for this resource.
The total size of all System V shared memory segments created. There is noZS_USER_SYSTEM user for this resource.
The total number all System V shared memory segments created. There is noZS_USER_SYSTEM user for this resource.
The total number of System V semaphores created. There is noZS_USER_SYSTEM user for this resource.
The total number of System V message queues created. There is noZS_USER_SYSTEM user for this resource.
The following resource properties are defined:
The total number of CPUs.
The total number of CPUs in either theon-line orno-intr state.
The system's 1 minute load average.
The system's 5 minute load average.
The system's 15 minute load average.
Each resource has a type defining the unit of measurement that ofthe data returned. The supported types are:
The resource is defined as time. Atimestruc_t is used to store the value in seconds and nanoseconds.
The resource is defined as an integer number representing a quantity. Auint64_t is used to store the value.
The resource is defined as an integer number of bytes. Auint64_t is used to store the value.
Resource usage can be queried for the following users:
Total resource used.
Resource used by the system. This is any resource usage which cannot be associated with a particular zone, such as resource usage by the kernel.
Aggregate resource used by all zones.
Resource not used.
See individual resource descriptions above for user restrictions on individual resources.
Each usage read viazs_usage_read() contains a list of the zone whichare running at the time the usage was read. Thezs_zone_*() functionsprovide access to this list of zones, and to the following propertiesand resource limits for each zone:
The name of the zone. The string will be up to lengthZS_ZONENAME_MAX, including the null terminating character.
Thezoneid of the zone.
The IP networking type of the zone. This property will have a value ofZS_IPTYPE_SHARED orZS_IPTYPE_EXCLUSIVE.
The CPU type of the zone. If the zone has a dedicated CPU resource configured, the CPU type will beZS_CPUTYPE_DEDICATED. Otherwise the CPU type will beZS_CPUTYPE_SHARED.
The default scheduling class of the zone.
A list of scheduling classes that are found running inside the zone. The value is a set of flags defined asZS_SCHED_*. If theZS_SCHED_CONFLICT flag is included, this means the zone has processes in both FSS, as well as TS, IA, or FX, with priority less than 60. The behavior of the FSS class is undefined in this scenario.
The quantity of CPU shares allocated to zone. If the zone has no processes running in the FSS scheduling class, the value will beZS_LIMIT_NONE. If the zone has processes running in FSS, the value will be between 0 andZS_SHARES_UNLIMITED, inclusive.
The name of the resource pool to which the zone is bound. If resource pools are not enabled, the value will bepool_default.
The name of the pool pset to which the zone is bound. If resource pools are disabled, the value will bepset_default.
Each usage reading contains usage information on a variety of resource types.Thezs_resource_*() functions can be used to access the usage of eachresource stored in a usage reading. The following resource types are supported:
Each zone can be limited to a decimal number of CPUs worth of CPU time. The value of the CPU cap is 100 times the number of CPUs to cap. For instance, a CPU cap of 50 is a limit to 0.50 CPUs worth of CPU time.
The usage values for this limit are increasing, starting at zero whenzs_open() is first called.
The limit in term ofncpus * 100 is retrieved viazs_zone_limit_int64() andzs_zone_limit_used_uin64(). These values will reflect the quantity of CPUs used sincezs_open() was first called.
The amount of CPU time available and used under the limit is retrieved viazs_zone_limit_time() andzs_zone_limit_used_time(). These functions return increasing utilization values. These values continually increase, starting from zero at the point whenzs_open() was first called, or from the point when the zone or pset was first booted or created.
Each zone's limit of resident pages of physical memory in bytes.
Each zone's limit of locked pages of physical memory in bytes.
The zone's limit of virtual memory (swap) reservation in bytes. Each zone's swap reservations are backed by both physical memory and disk swap devices.
The number of lightweight processes (lwps) executing in each zone.
The number of processes executing in each zone, including zombie processes, which are exited processes that have not been waited upon by their parent process.
Each zone's total size of all System V shared memory segments created. There is noZS_USER_SYSTEM() user for this resource.
Each zone's number all System V shared memory segments created. There is noZS_USER_SYSTEM() user for this resource.
Each zone's number of System V semaphores created. There is noZS_USER_SYSTEM() user for this resource.
Each zone's total number of System V message queues created. There is noZS_USER_SYSTEM user for this resource.
Each zone's total number of lofi devices created. Seelofiadm(1M).
Each usage read viazs_usage_read() contains a list of the processor setswhich existed at the time the usage was read. Thezs_pset_t*() functionsprovide access to this list of pset, and to the following propertiesdefined for each pset:
The name of the processor set. The string will be up to lengthZS_PSETNAME_MAX, including the null terminating character.
Thepsetid of the processor set.
If the processor set was created by azonecfg add dedicated-CPU resource, the type will beZS_CPUTYPE_DEDICATED. Otherwise, the type isZS_CPUTYPE_SHARED.
The number CPUs assigned to the processor set.
The number of CPUs assigned to the processor set which are in theon-line orno-intr state.
The minimum number of CPUs that the system may assign to the processor set.
The maximum number of CPUs that the system may assign to the processor set.
The total number of CPU shares of all zones running in the processor set.
A list of scheduling classes that are found running inside the processor set. The value is a set of flags defined asZS_SCHED_*. If theZS_SCHED_CONFLICT flag is included, this means the zone has processor set has processes both in FSS, as well as TS, IA, or FX, with priority less than 60. The behavior of the FSS class is undefined in this scenario.
The system's 1 minute load average.
The system's 5 minute load average.
The system's 15 minute load average.
In addition to properties, thezs_pset_used_*() functions provide total time, CPU used,percent used, and CPU time used of each processor set.
Each processor set can be in use by one or more zones.Thezs_pset_zone_*() functions provide per-zone usage information for each pset. It isalso possible for an individual zone to be using more than onepset. In this case, the given zone will appear in the per-zoneusage information for every pset that it is using.
The following properties exist on each per-zone pset usage:
A list of scheduling classes that are found running within the zone inside the given pset. The value is a set of flags defined asZS_SCHED_*. If theZS_SCHED_CONFLICT flag is included, this means the zone has processes in TS, IA, or FX, with priority less than 60, while other zones using the processor set are using FSS.
The number of CPU shares of the zone running in the pset. The value will beZS_LIMIT_NONE if the zone is not running in the FSS scheduling class. If the zone has processes running in FSS in the processor set, the value will be between 0 andZS_SHARES_UNLIMITED, inclusive.
The CPU cap of the zone. SeeZS_LIMIT_CPU for description.
In addition to properties, thezs_pset_zone_used_*() functions provide to per-zone CPUs used,percent used, and CPU time of each processor set. Percent of CPUshare, and percent of CPU share used is also provided:
The percentage of the pest used by a zone. The value ispct * 100, with 10000 meaning 100%.
The percentage of a zone's CPU cap that is used by the zone in this pset. The value ispct * 100, with 10000 meaning 100%.
Of the total CPU shares of all zones running in the pset, the percent that belong to this zone. The value ispct * 100, with 10000 meaning 100%.
For example, if there are four zones in the pset, each with 10 CPU shares, each would have a value of 2500 (25% * 100).
Of a zones CPU shares, the percent of them that are being used by the zone's CPU utilization in this pset. The value ispct * 100, with 10000 meaning 100%. This value can exceed 100% (10000) as a zone can use more that its CPU share if there is no contention by other zones.
The shared objectlibcpc.so.1 provides the public interfaces defined below. SeeIntro(3)for additional information on shared object interfaces.
|
64-bit shared object
Seeattributes(5) for descriptions of the following attributes:
|
Thezs_open() function is MT-Safe. The remainingzs_*() functions are MT-Safe withthe exception that only one thread may actively use azs_ctl_t objectat any time. Synchronization is left to the application.
zonestat(1),pooladm(1M),psrset(1M),rcapadm(1M),swap(1M),zoneadm(1M),zonecfg(1M),zonestatd(1M),libpool(3LIB),zs_open(3ZONESTAT),zs_pset(3ZONESTAT),zs_property(3ZONESTAT),zs_pset_zone(3ZONESTAT),zs_resource(3ZONESTAT),zs_usage(3ZONESTAT),zs_zone(3ZONESTAT),attributes(5),resource_controls(5)
The servicesvc:/system/zones-monitoring:default must be enabled in the global zone in orderforzs_open() andzs_read_usage() to succeed. This requirement exists for use oflibzonestat in both the global zone and non-global zones.
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |