From 6799a329507aaa80ce02352c820e7fd90f239e08 Mon Sep 17 00:00:00 2001 From: "Zane C. Bowers-Hadley" Date: Wed, 28 Aug 2019 01:52:09 -0500 Subject: [PATCH] ready for release --- Proc-ProcessTable-InfoString/Changes | 5 ++- Proc-ProcessTable-InfoString/README | 39 ++++++++++++++----- .../lib/Proc/ProcessTable/InfoString.pm | 17 ++++++++ 3 files changed, 50 insertions(+), 11 deletions(-) diff --git a/Proc-ProcessTable-InfoString/Changes b/Proc-ProcessTable-InfoString/Changes index bf7b64f..e699d46 100644 --- a/Proc-ProcessTable-InfoString/Changes +++ b/Proc-ProcessTable-InfoString/Changes @@ -1,5 +1,6 @@ Revision history for Proc-ProcessTable-InfoString -0.01 Date/time - First version, released on an unsuspecting world. +0.0.1 2019-08-28/01:55 + - Initial release. + diff --git a/Proc-ProcessTable-InfoString/README b/Proc-ProcessTable-InfoString/README index 128650e..70121fe 100644 --- a/Proc-ProcessTable-InfoString/README +++ b/Proc-ProcessTable-InfoString/README @@ -1,15 +1,36 @@ Proc-ProcessTable-InfoString -The README is used to introduce the module and provide instructions on -how to install the module, any machine dependencies it may have (for -example C compilers and installed libraries) and any other information -that should be provided before the module is installed. +Prints a handy info string representing +state and various flags as well as showing +the wait channel in use if there is one. -A README file is required for CPAN modules since CPAN extracts the README -file from a module distribution so that people browsing the archive -can use it to get an idea of the module's uses. It is usually a good idea -to provide version information here so that people can decide whether -fixes for the module are worth downloading. +use Proc::ProcessTable::InfoString; +use Proc::ProcessTable; + +my $is = Proc::ProcessTable::InfoString->new; + +my $p = Proc::ProcessTable->new( 'cache_ttys' => 1 ); +my $pt = $p->table; + +foreach my $proc ( @{ $pt } ){ + print $proc->pid.' '.$is->info( $proc )."\n"; +} + + +results in output like... + + +57255 Rs+ +57254 Ss+ zio->io_ +57253 Ss+ wait +57252 Ss+ zcw->zcw +57226 Ss+ zio->io_ +57224 Ss+ wait +57223 Rs+ +57222 Ss+ wait +56824 Ss+ zio->io_ +55632 Ss+ zcw->zcw +55631 Ss+ wait INSTALLATION diff --git a/Proc-ProcessTable-InfoString/lib/Proc/ProcessTable/InfoString.pm b/Proc-ProcessTable-InfoString/lib/Proc/ProcessTable/InfoString.pm index a860917..62f6d00 100644 --- a/Proc-ProcessTable-InfoString/lib/Proc/ProcessTable/InfoString.pm +++ b/Proc-ProcessTable-InfoString/lib/Proc/ProcessTable/InfoString.pm @@ -36,6 +36,23 @@ Perhaps a little code snippet. print $proc->pid.' '.$is->info( $proc )."\n"; } +The mapping for the left side of the output is as below. + + States Description + Z Zombie + S Sleep + W Wait + R Run + + Flags Description + O Swapped Output + E Exiting + s Session Leader + L POSIX lock advisory + + has controlling terminal + X traced by a debugger + F being forked + =head1 METHODS =head2 new