Go to main content

man pages section 3: Library Interfaces and Headers

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

Sun::Solaris::Pg (3)

Name

Sun::Solaris::Pg - Perl interface to Processor Group kstats

Synopsis

Please see following description for synopsis

Description

User Contributed Perl Documentation                                 pod::Pg(3)



NAME
       Solaris::Pg - Perl interface to Processor Group kstats

SYNOPSYS
         use Solaris::Pg;

         $p = Solaris::Pg->new(-cpudata=> 1, -tags=> 1, -swload=> 1);

         @pgs = $p->all();

         @pgs_depth = $p->all_depth_first();

         @pgs_breadth = $p->all_breadth_first();

         @leaves = $p->leaves();

         $root = $p->root;

         $p->update();

         $leaf = $leaves[0];

         $name = $p->sh_name($leaf);

         @names = $p->sharing_relationships();

         @tags = $p->tags($leaf);

         $p1 = Solaris::Pg->new(-cpudata=> 1, -tags=> 1, -swload=> 1);

         if ($p->has_utilization()) {
           $utilization = $p->utilization($p1, $leaf);
           $capacity = $p->capacity($p1, $leaf);
           $accuracy = $p->accuracy($p1, $leaf);
           $tdelta = $p->tdelta($p1);
         }

         $sw_utilization = $p->sw_utilization($p1, $leaf);)

DESCRIPTION
       The Solaris::Pg module provides an interface to the Solaris PG
       information available through pg and pg_cpu kstats. The module provides
       an object oriented interface.

METHODS
   new
       Create a new Pg instance. The new() function accepts arguments in the
       form of a hash. The following subarguments are supported:

       -cpudata
           Collect per-CPU data from kstats if this is True.

       -tags
           Match PGs to physical relationships if this is True.

       -swload
           Collect software CPU load if this is True.

   root
       Return ID of the root of Processor Group hierarchy.

   all
       Return list of all PGs sorted by ID.

   all_depth_first()
       Return list of all PGs sorted by walking the PG hierarchy depth first,
       starting from root.

   all_breadth_first()
       Return list of all PGs sorted by walking the PG hierarchy breadth
       first, starting from root.

   cpus(PG)
       Return list of all CPUs in the PG specified. The list is sorted by CPU
       ID.

   generation([PG])
       Return the generation number for the given PG. Without arguments,
       return the generation number for the whole snapshot. Different
       generation number means that PG configuration may have changed.

   parent(PG)
       Return parent ID or undef if there is no parent.

   children(PG)
       Return list of children for the PG.

   is_leaf(PG)
       Returns T iff PG is leaf.

   leaves
       Returns list of leaf PGs.

   level(PG)
       Return the numeric level of PG in the hierarchy, starting from root
       which has level zero.

   sh_name(PG)
       Returns sharing name for the PG.

   sharing_relationships([PG], ...)
       Without any arguments, returns the list of sharing relationships in the
       snapshot. Relationships are sorted by the level in the hierarchy If any
       PGs are given on the command line, only return sharing relationships
       for given PGs, but still keep them sorted.

   tags(PG)
       Return list of strings describing physical relationships ('core',
       'chip') for the given PG.

   update()
       Update utilization and generation data in the PG snapshot.

   has_utilization(PG)
       Returns True if given PG hasd data about hardware utilization.

   utilization(PGOBJ, PG)
       Return numeric utilization for the time interval represented by two PG
       objects for the given PG. Utilization is a difference in utilization
       value between two snapshots. The given PG must belong to the same
       generation in both snapshots.  Returns undef if utilization can not be
       obtained.

   sw_utilization(PGOBJ, PG)
       Return numeric software utilization for the time interval represented
       by two PG objects for the given PG. Utilization is a difference in
       utilization value between two snapshots. The given PG must belong to
       the same generation in both snapshots. Returns undef if utilization can
       not be obtained. Software utilization is combined CPU load for all CPUs
       in the PG. Returns undef if utilization can not be obtained.

   sw_utilization(PGOBJ, PG, CPU)
       Return utilization for the PG for a given CPU in a given PG.
       Utilization is a difference in utilization value between two snapshots.
       We can only compare utilization between PGs having the same generation
       ID. Returns undef if utilization can not be obtained.

   capacity(PGOBJ, PG)
       Return numeric capacity for the time interval represented by two PG
       objects for the given PG. Note that the actual capacity is the maximum
       of all capacities across all PGs of this type.The given PG must belong
       to the same generation in both snapshots. Returns undef if capacities
       can not be obtained.

   accuracy(PGOBJ, PG)
       Return accuracy of utilization calculation between two snapshots The
       accuracy is determined based on the total time spent running and not
       running the counters.  If T1 is the time counters were running during
       the period and T2 is the time they were turned off, the accuracy is T1
       / (T1 + T2), expressed in percentages.

   tdelta(PGOBJ, PG)
       Return time interval between two snapshots for the given PG. The time
       is expressed in seconds and is a floating-point number.

   EXPORT
       None by default.

SEE ALSO
       pginfo(1), pgstat(1)



perl v5.32.0                      2022-06-28                        pod::Pg(3)