OS2-Proc

 view release on metacpan or  search on metacpan

Proc.pm  view on Meta::CPAN

=over

=item $href = global_info()

hash reference with sizes of internal tables for C<modules>, C<procs>,
C<threads>.

  print "$_ => $href->{$_}\n" for qw(modules procs threads);

=item $href_modules = mod_info()

$href_modules indexes modules by their handles, the value being a hash
reference with the following fields:

  cnt_static	 - No. of modules linked in at compile time
  name		 - Full path name (except for SYSINIT/basedevs?)
  segcnt	 - ?? Number of segments?
  static_handles - array reference with handles of modules linked
			at compile time
  static_names	 - same with names
  type		 - ?? SYSINIT/IFS/DMD/SYS=0, DLL/EXE=1, 

=item ($aref_processes, $href_modules) = proc_info(0)

information about all processes and modules on the system.
Each entry referenced by $aref_processes is a hash reference with the
following fields:

  threads	  - Array of hash references with thread information
  pid		  - pid
  ppid		  - parent pid
  proc_type	  - FullScreen/RealMode/VIO/PM/Detached
  type		  - 0..4 (see proc_type)
  status_array    - combination of ExitList/ExitingT1/Exiting/
			NeedsWait/Parent-Waiting/Dying/Embrionic
  state		  - combination of flags in 0x01..0x80 (see status_array)
  sessid	  - SessionId
  module_name	  - full name of the executabale (!)
  module_handle	  - module handle of the executable
  threadcnt	  - No. of threads
  privsem32cnt    - No. of private 32bit semaphores
  sem16cnt	  - No. of 16bit semaphores
  dllcnt	  - length
  shrmemcnt	  - No. of shared memory segments
  fdscnt	  - No. of available file descriptors
  dynamic_names	  - reference to array with full names of
			runtime-loaded modules (!)
  dynamic_handles - same with handles
  static_handles  - array reference with handles of modules linked
			at compile time (!)
  static_names	  - same with names (!)

Each thread-information hash has the following entries

  priority	 - absolute priority (?)
  priority_class - Idle-Time/Regular/Time-Critical/Fixed-High
  priority_level - Priority shift inside class (larger is higher)
  sleepid	 - ???
  slotid	 - "Global" thread id
  state		 - 1,2,5 (see thread_state)
  systime	 - Cumulative no. of busy ticks spent in syscalls
  thread_state	 - Ready/Blocked/Running
  threadid	 - Thread Id "in the process"
  usertime	 - Cumulative no. of busy ticks spent in user code

Keep in mind that the semantic of priority_class is not monotonic,
monotonic is C<Idle-Time/Regular/Fixed-High/Time-Critical>.

The $href_modules is the same as for mod_info().

=item $aref = proc_info()

same info with processes restricted to the current process, and
modules to modules used by the current process.

=item $aref = proc_info($pid)

same about a given ProcessID.

=item $aref = proc_info($pid,$flags)

Allows restriction of the information restricted to one about

  processes	- 0x001
  modules	- 0x002
  semaphores	- 0x004
  shared memory - 0x008
  files		- 0x100

and without any parsing.  The description above corresponds to C<$flags==3>.
Only the combinations of 0x1 and 0x2 are allowed now.  If 0x2 is not
present, the fields marked with C<(!)> are omited from the process
list descriptions.

=item $href = process_info($pid)

Gives a reference to a hash with process information as above, except
for those marked with (!).

=back

=head1 AUTHOR

Ilya Zakharevich <ilya@math.ohio-state.edu>

=head1 SEE ALSO

perl(1).

=cut



( run in 0.738 second using v1.01-cache-2.11-cpan-39bf76dae61 )