Description

These functions are used to access the per-zone utilization information for a
given pset. Each pset will have zero or more zones bound to
it.

Typically, a zone will be bound to a single pset, but it
is possible for the global zone to be bound to multiple psets,
as well as non-global zones if psrset(1M) psets are used.

If a zone is bound to multiple psets, it's CPUs shares will
be applied to each pset. For instance, if a zone has 10
shares, and has processes in both pset A and pset B, then
the zone will have 10 shares in both pset A and pset
B. The relative value of those shares will depend on the other zones
running in each pset, and how many shares the other zones have.

If a zone is bound to multiple psets, then its CPU cap
is applied across all psets. The zone may use up to its
cap in CPU time. Some of this time could be spent in
pset A, and the rest in pset B. Each zone does not
get its full CPU cap per pset.

The zs_pset_zone_list() function returns the number of zs_pset_zone_t objects contained within pset.
If pzlist is non-NULL, the pzlist array will be filled with up
to numzs_pset_zone_t objects. The pzlist array must be first allocated by
the caller. The zs_pset_zone_t objects will be returned in alphanumeric ordered by
zone name.

The zs_pset_zone_walk() function is used to walk the list of zones using
a pset. Zones are walked in alphanumeric order. If pz is NULL,
the first zone is returned, otherwise the zone after pz is returned. NULL
is returned if there are no more zones using the pset.

The zs_pset_zone_get_zone() function returns the zs_zone_t object representing the zone for pz.

The zs_pset_zone_get_pset() function returns the zs_pset_t object representing the pset for pz.

The zs_pset_zone_property() function will return the prop property of a pz. See
libzonestat(3LIB) for a description of the ZS_PZ_PROP_* property codes.

The zs_pset_zone_used_time() function sets ts to the total CPU time that has
been used in the pset by the zone, starting at zero from
the point when zs_open(3ZONESTAT) was first called.

The zs_pset_zone_used_cpus() function sets ts to the total number of CPUs that
has been used in the pset by the zone, starting at zero
from the point when zs_open() was first called. The value returned is
the number of CPUs used * 100. For example, if the zone used
1.5 CPUs in the pset, the returned value will be 1500.

The zs_pset_zone_used_pct() function returns the percentage of pct used by the zone
in the pset. See the description of the ZS_PZ_PCT_* codes on the
libzonestat(3LIB) manual page.

Return Values

See Description.

Errors

If a zs_pset_zone_*() function is called with an invalid property or pct
code, the function will abort with abort(3C).

Examples

Example 1 Walk the list of zones and retrieve CPU data.

The following example walks the list of zones using the default pset,
retrieving both the CPU shares and CPU cap, as well as the
percent of each used.