File manager - Edit - /home/newsbmcs.com/public_html/static/img/logo/libproc-processtable-perl.tar
Back
README.gz 0000644 00000004723 15027505476 0006064 0 ustar 00 � }XmS�H����V�l����m����%ˋCq��j,�� �F�a�T��>�#{�ےf�ߞ~�ۓƥ��o�0JM ����MH�ZW�k�vV�@�v�IW�:���R�˛�����)Mo�7�S�۫��ɭ��ema�*����Ղ ��C���R�*��d;4[�gW�늦K݄�4��9���=&�+��3��C�� ��jG�8�0��S�!��S���hiCn+h��`2��1>m /W����x̋�+I�`���1=4+0�����Bs�h<�6$$�.mQ@�(af�&h]�� +2�bȻ�I�-Pl�� �"��j����_�3�,|0�~m�bP#��0��c��`��i13P��{Z?-1�O���� ��Z=�c��>�ތ��< � �Sz6o��8���C<�-+j����=�Vm��P�W�Se�Yڪ8T>�z�>�����KO�3r,"|1��߉��Wl��:6(� )}����7��<L� ��L�����g�L����#�B�Hpδ���"�զ��|���������i�|�K����8" �n�6)�ol�ο@�u$A��뛳�Od��7�F8%��� P���sgױ�+ yA���/�U7W'W����|�P���I:� ��z���p��$�a/�PC傉�Y�:V5���L�he1ob� �̈W-˅Q�����f ��uk�� Rv��}*���N�P��E[`�1��Z���hp.����C�7NR]$;��2[�]Bgގ>`9֚��o�|�'S�T@�0�p��� )r"�/��V�C���&��@>�S;R�hd��u��S�*EX0]mQ����駨�O�z�� Y���A�a����+u8� ���!��E>҇�nfPh͜�Y�qxH4�e'�������ե�?���3C�� ����`�|�A��[�cD B XFϗg�%8{�� �I��>$X"���3��Q �W�t�;&}@�� ڂ�cM�z�#|<�[��e���n%m p'��.����9T�CPa�27��vnSթi5�y�Va�CT�!��1 8����S��d$��6�hR�K4�U�K��� �jt��C}��0�-�W)�(,��D��ـ�Pe�� ��-5� L:#��tW=����^�#ȣ֡k/�|R��o�V�y�}6��2� �����f���8��X�����A u7�@�F�Ċ�7��W��AVm�D�srL^�<�q��c��b���:�E�[�<^\�.���G��G�d��|+Gu��_h�ꭟ�3Vr����f�^O�����IT��9s�y�\L�l*�Nw3����&���%s�%:@�l��ŖO��rʴ8�w�\&R^�^�������/��$��}��>�i��!�|���ϑhgf]���5s!bo QGi}i���.�ct������(���?�_��z�s�+5�Ja�N���<r�?���О��B�k��%h���4���!�Ν7��9Ȭ���z�1Ȭ����u�2��Թ��9X�<�ܔ�'��t��6�[�RW�ah�Y��-T���l h� .C���SOl=���h��mH�k@�,Tg�����/9�9�s;!�>�-{�� �1Owڲ�pe�s�M�wp��VU �F+1F8g�Pm�ty���LƗ ���QA-�Q��̄J' ���u�/�p�� ?K&�y�̨�S e=��v�V�rf2V|ru���=�G]��Two���m�~|������ɧӋ�˛ד$��^j�h����^I�#����ވ $�ծ�&Z�?m�qg�R꼷�Ti=b�% h'�Ё��z��n��'fk�:�����B���3��-ڧ�\%�j�"��ys���%�&�k�b6��hrZ'��տOn���Bs.^���)C$I�(�Ih�X�a�G�'q���Uؚ.3�pY�#��cf��;�^+31���0w��F�N ��3&�4Oj�b�n��B��uq�� z�ѝ�4�K]��������Ѣ|M�ѥ3�N���q1Z �<��U�뵱��a���Ɩ:���P\������;�{v A��+�����ѹ�1�'�'���q��p� �8oS[i�=�(�H�U tI��G�ۭ���:�$��CsF\e�U����3*�ԉ�g8��A�]��~i��;���6sf7O�.4[`����ð�ϟG89�QC�;���[-�P iX�2���t '��b�.�A�C+J&�?ZϛM�Kb�����n���a�K2��?.t����6j���-6� ���S�W�_�}���h0�ԫ����t�P��{��W:ѕ5}N�T� Y��`Lb�`��!F̷~CX�snx�K�;i�|�p#�b���^�.e�0c���2�G��z���Z��k9�O�V� copyright 0000644 00000012677 15027505476 0006527 0 ustar 00 Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Proc-ProcessTable Upstream-Contact: Jonathan Swartz <swartz@pobox.com> Source: https://metacpan.org/release/Proc-ProcessTable Files: * Copyright: 1998-2008, Daniel J. Urist License: Artistic or GPL-1+ Files: os/darwin.* Copyright: 1990, 1993, 1994, The Regents of the University of California License: other * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * The portions of this code which were necessary to tie into the Perl * Proc::ProcessTable module are: * * Copyright (c) 2003, 2004, 2008 by Thomas R. Wyant, III * * and may be reused under the same terms as Perl itself. Files: os/bsdi.* Copyright: 1999, Magic Software Development, Inc. License: Artistic or GPL-1+ Files: os/SunOS.* Copyright: 2001, Shawn A. Clifford <shawn.a.clifford@lmco.com> License: Artistic or GPL-1+ Files: os/aix.* Copyright: 1998, David Paquet License: Artistic or GPL-1+ Files: os/aix_getprocs.* Copyright: 2002, Target Corporation License: Artistic or GPL-1+ Files: os/MSWin32.* Copyright: 1996, 1997, 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. License: GPL-2 Comment: Adapted from ps.cc by J Robert Ray <jrray@jrray.org> Files: os/OpenBSD.c Copyright: 2006, William Yodlowsky <bsd@openbsd.rutgers.edu> License: Artistic or GPL-1+ Files: os/HPUX.c Copyright: 1998, Mike Romberg ( romberg@fsl.noaa.gov ) License: Artistic or GPL-1+ Files: os/obstack.* Copyright: 1988-2021 Free Software Foundation, Inc. License: LGPL-2.1+ Files: lib/Proc/Killall.pm Copyright: 2000, Aaron Sherman License: Artistic or GPL-1+ Files: debian/* Copyright: 2001, 2002, 2004, Marcus Crafter <crafterm@debian.org> 2001, Marcus Crafter <Marcus.Crafter@osa.de> 2006, 2008, Gunnar Wolf <gwolf@debian.org> 2006, Don Armstrong <don@debian.org> 2006, Matej Vela <vela@debian.org> 2006-2019, gregor herrmann <gregoa@debian.org> 2007, 2008, Damyan Ivanov <dmn@debian.org> 2008, Ansgar Burchardt <ansgar@debian.org> 2011-2021, Salvatore Bonaccorso <carnil@debian.org> License: Artistic or GPL-1+ License: Artistic This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License, which comes with Perl. . On Debian systems, the complete text of the Artistic License can be found in `/usr/share/common-licenses/Artistic'. License: GPL-1+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. . On Debian systems, the complete text of version 1 of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-1'. License: GPL-2 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2. . On Debian systems, the complete text of version 2 of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-2'. License: LGPL-2.1+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. . This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. . You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. . On Debian systems, the complete text of the GNU Lesser General Public License can be found in `/usr/share/common-licenses/LGPL-2.1`. changelog.Debian.gz 0000644 00000002721 15027505476 0010233 0 ustar 00 � �W[S�8~�W�iJ(v|!!�vwʥ� d �>��t[�*������=��4�2�3��ѹ|�w�8WJf��C�6d�iPQ�a; ��^�-�y܂o�,���U*��%͙-�� v�LYAĄ��~9\K���-�*'���6�S0��3��\�ȷvl��a&�� .��'tI�$��4�=x�Q���W��+�;����2�6��n��L ��C�$�cFD;��T�Iap��04/~��w| $�i�0y�8�uȗ��#�C)H�I�%�Ɉ���� ��`���B��q��E�8t\�����xU��D� �\P�J"��D��V�dД�;f �>kh�R��Egb� � f�_� }�(� �С#8����˔�<jtX�x��'"f���.ի���=L?��o ��ڭ��.�*y���j\�r���Yэ���F� $�8�XS��wTַ�ܰ����� �Cx O��F˩�r�[�II���C�1�8�Ȅ�c� >�MJ*�Y6Ew�a���SJT�ئ;�E�!,T�I��Ж�3ZP���No)w���U4��:7�JV��T�� >X�Ç�/�w�.����_�6�,�%��6%ǩD]HR8����A��������*n8mr��s�q�%9a��dtxr 9�An9�B���%��^k v)����Z�u��n��ͤ�`�ʌU4,o����� �!#|�2�6��v�g���{�#�A�9du�+gn4�&�k�)�f�!�w��MP���,gg�m�ڈ�ô��/�c��5��!�D�K��}��3d��B�꾆�(�?3αaU���K�JT$�:;u/$�h�_�>���\f������O�sdcu�cs����AÊ��L��^>�Q;P���1�D�R,�u��Wb��:3bV��s�B��TU ��@t��EO��ܕM��?0|�|�h�)��M�'��@�L;p�� )�y�h�5 .�L*~��>V# ������BF���T�16y3]g�Ԁd'#2��L�k��v�^s�uD�6��Űҽf4t���}�ד�γ$�� �5�����@�k�����8���>���/h&'����Ώ�0�������ϧMmH�:q�,q=Hb�� ��4HW%n���1$�vS��Lz1!n�ꌨ̱���ۥ���u�{qk-�|�4�����|�p�<��[��?�)��7��nܭK���d�vi�g���1� G�����M�B{.�Ff��<:�{�\]|��>�\�fo���a�ƾ���W���7��k�;��a��#���7f�b�����1������i��?`( �a�ߋ�9,�3�'�9�N&�7��}��BXu�:x��_Vϑ�tcX�(�N3����/��h��_�$��=���`bT^��8r,}2�W[� ��:� examples/ppt_profile_plot.R 0000755 00000004405 15027505476 0012107 0 ustar 00 #!/usr/bin/env Rscript ## created on 2013-08-30 scale_human <- function(m, info) { for(i in 1:nrow(info)) { cp <- prod(info[1:i,"factor"]) if(m/cp < 100) return( list(factor=cp,abbr=as.character(info[i,"abbr"]))) } return(list(factor=c(1), abbr=as.character(info[1, "abbr"]))) } args <- commandArgs(T) fin <- args[1] fout <- args[2] ## some basic checks if(is.na(fout)) fout <- paste0(fin,".pdf", collapse="") cat("INPUT:", fin, "\n", file=stderr()) cat("OUTPUT:", fout, "\n", file=stderr()) if(fin == fout) stop("input and output files are the same") if(file.info(fin)$size == 0) stop("input file empty") z <- read.table(fin, header=TRUE, sep="\t", fill=TRUE) ## get rid of incomplete columns (sometimes incomplete output while the profiling is running) z.incomplete.idx <- apply(z,c(1), function(x) { any(is.na(x)) }) z <- z[!z.incomplete.idx,] if(nrow(z) < 3) stop("at least 3 data points are needed") cat("data rows:", nrow(z), "\n", file=stderr()) z[!is.finite(z[,"pcpu"]),"pcpu"] <- 0 info.byte <- data.frame(factor=c(1,1024,1024,1024), abbr=c("b", "kb", "mb", "gb")) info.ts <- data.frame(factor=c(1, 60, 60, 24), abbr=c("sec", "min", "h", "d")) t.scale <- scale_human(max(z[,"time"]), info.ts) m.scale <- scale_human(median(z[,"rss"]), info.byte) k2 <- with(z, by(z, tp, function(x) { c( t=mean(x[,"time"])/t.scale[["factor"]], m=mean(x[,"rss"])/m.scale[["factor"]], pc=mean(x[,"pcpu"]) ) })) k <- as.data.frame(do.call(rbind,k2)) k$pc <- k$pc * 100 ## old method. Got rid of plyr dependency #library(plyr) #k <- ddply(z7, .(tp), summarise, t=mean(time)/t.scale[["factor"]], m=mean(rss)/m.scale[["factor"]], pc=mean(pcpu)) span <- 0.3 #if(nrow(k) > 300) #span <- 1/20 pdf(fout,width=13, height=6) plot( pc ~ t, data=k, xlab=paste0("time in ", t.scale[["abbr"]], collapse=" "), ylab="% cpu usage", cex=0.3, pch=16, col="grey20" ) with(k, lines(loess.smooth(t, pc, span=span), col = "brown", lwd=1.6)) plot( m ~ t, data=k, xlab=paste0("time in ", t.scale[["abbr"]], collapse=" "), ylab=paste0("mem in ", m.scale[["abbr"]], collapse=" "), cex=0.3, pch=16, col="grey20" ) with(k, lines(loess.smooth(t, m, span=span), col = "brown", lwd=1.6)) dev.off() examples/pswait 0000755 00000005267 15027505476 0007644 0 ustar 00 #!/usr/bin/perl use strict; use Proc::ProcessTable; exit if ( $#ARGV == -1 ); $|++; my $ptable = Proc::ProcessTable->new; my %waited = (); my %proc; $proc{ $_->pid }=$_->fname foreach (@{$ptable->table}); use Getopt::Long; use Pod::Usage; GetOptions( 'e|exit+' => \( my $endfirst = 0 ), 'v|verbose+' => \( my $verbose = 0 ), 'h|help+' => \( my $help = 0 ), 's|sleep=i' => \( my $sleeptime = 1 ) ); pod2usage(-verbose => 1) && exit if $help; foreach (@ARGV) { next if ( $_ == $$ ); # DON'T wait for myself ! if (/\d+/) { if ( exists $proc{$_} ) { $waited{$_}++; } else { print "nothing like $_\n" if $verbose } next; } foreach my $p ( keys %proc ) { next if ( $p == $$ ); # DON'T wait for myself I said ! $waited{$p}++ if ( $proc{$p} =~ /$_/ ); } } if ($verbose) { print "I am process $$\n"; print "waiting after $_ \n" for ( keys %waited ); print "sleep time set to $sleeptime s\n"; print "will exit on first terminated process\n" if ( $endfirst ); } my $count = scalar keys(%waited); while ( scalar keys(%waited) ) { sleep $sleeptime; %proc = (); $proc{ $_->pid }++ foreach (@{$ptable->table}); foreach my $p ( keys %waited ) { if ( !exists $proc{$p} ) { print "gone $p\n" if $verbose; delete $waited{$p}; } } last if (( scalar keys(%waited) < $count ) && ($endfirst)); } __END__ =head1 PSWAIT pswait - waiting for process(es) to end before doing things =head1 SYNOPSIS pswait [options] [process ID|NAME ...] =head1 USAGE pswait [options] [process ID|NAME ...] Options: -h --help brief help message -v --verbose be verbose -e --exit exit after first process end -s x --sleep x set sleep time to x second (default to 1) =head1 OPTIONS =over 8 =item B<-e, --exit> When giving a list of process to watch, exit when the first process end, it is usefull to easily manage a pool of proces with a shell script. =item B<-h. --help> Print a brief help message and exits. =item B<-s x, --sleep x> set sleep time to x seconds between process checking, default to 1 second. On small machines (or overloaded machines) it could help to check process state only once every minutes instead, using for example -s 60 =item B<-v, --verbose> Inform you on what happening ... which process ends, which process ID are watched for state (usefull when using process names on command line). =back =head1 DESCRIPTION B<pswait> will read the process table of the system and wait for some process to end =head1 AUTHOR DominiX <dominix@despammed.com> =cut examples/ppt_profile.pl 0000755 00000006644 15027505476 0011272 0 ustar 00 #!/usr/bin/perl use warnings; use strict; use Time::HiRes; use Proc::ProcessTable; use Pod::Usage; use Getopt::Long qw(:config auto_help); use IO::Handle; my %opt = ( interval => 1, num_steps => 3, ); GetOptions( \%opt, 'process_id|pid|p', 'help|?', 'interval=f', 'num_steps=i' ) or pod2usage(2); pod2usage( -exitval => 0, -verbose => 2 ) if ( $opt{help} ); pod2usage(2) unless ( @ARGV && @ARGV > 1 ); my ( $log_fn, @cmd ) = @ARGV; my $poll_intervall = int($opt{interval} * 1000 * 1000); my $num_steps = $opt{num_steps}; my $script_start_time = [ Time::HiRes::gettimeofday() ]; my $pid; if ( $opt{process_id} ) { $pid = shift @cmd; } else { $SIG{CHLD} = 'IGNORE'; $pid = fork; die "cannot fork" unless defined $pid; } if ( $pid == 0 ) { #child system(@cmd); exit; } else { #main my $time_point = 1; my @start_time; my @cpu_time; my $ppt = Proc::ProcessTable->new; say STDERR "tracking PID $pid"; my $log_fh; if ( $log_fn eq '-' ) { $log_fh = \*STDOUT; } else { open $log_fh, '>', $log_fn or die "Can't open filehandle: $!"; } print $log_fh join( "\t", qw/tp time pids rss vsz pcpu/ ), "\n"; while ( kill( 0, $pid ) ) { my $t = Time::HiRes::tv_interval($script_start_time); my $pt = parse_ppt( $ppt->table ); my @pids; my $sum_rss = 0; my $sum_vsz = 0; my $sum_cpu = 0; my $sum_start = 0; my %childs = map { $_ => 1 } subproc_ids( $pid, $pt ); $childs{$pid}++ if ( $opt{process_id} ); for my $p (@$pt) { #[0] pid #[1] ppid #[2] rss #[3] size #[4] time #[5] start if ( $childs{ $p->[0] } ) { $sum_rss += $p->[2]; $sum_vsz += $p->[3]; # utime + stime (cutime and cstime not needed, because we iterate through children $sum_cpu += $p->[4]; push @pids, $p->[0]; } } # calc pct cpu per interval: # we need seconds since #https://stackoverflow.com/questions/16726779/how-do-i-get-the-total-cpu-usage-of-an-application-from-proc-pid-stat #pctcpu = ( 100.0f * sum over all (prs->utime + prs->stime ) * 1/1e6 ) / (time(NULL) - prs->start_time); shift @cpu_time if ( @cpu_time > $num_steps ); push @cpu_time, $sum_cpu; shift @start_time if ( @start_time > $num_steps ); push @start_time, $t; my $ratio = 0; if ( @start_time >= $num_steps ) { my $diff_cpu = ( $cpu_time[-1] - $cpu_time[0] ) / 1e6; my $diff_start = ( $start_time[-1] - $start_time[0] ); $ratio = $diff_cpu / $diff_start if ( $diff_start > 0 ); } print $log_fh join( "\t", $time_point, $t, join( ",", @pids ), $sum_rss, $sum_vsz, $ratio ), "\n"; $log_fh->flush; Time::HiRes::usleep($poll_intervall); $time_point++; } $log_fh->close; } sub parse_ppt { my $ppt_table = shift; my @table = map { [ $_->pid, $_->ppid, $_->rss, $_->size, $_->time, $_->start ] } @$ppt_table; return \@table; } sub subproc_ids { my ( $pid, $procs ) = @_; #[ pid, parentid ] my @childs; for my $c ( grep { $_->[1] == $pid } @$procs ) { push @childs, $c->[0]; push @childs, subproc_ids( $c->[0], $procs ); } return @childs; } __END__ =head1 NAME ppt_profile_cmd.pl - track the cpu and memory usage of a command =head1 SYNOPSIS ppt_profile_cmd.pl [OPTIONS] <log file> <command|process_id> [<arg1> <arg2> ... <argn>] =head1 DESCRIPTION =head1 OPTIONS =head1 SEE ALSO =head1 AUTHOR jw bargsten, C<< <jwb at cpan dot org> >> =cut examples/pctcpu_example.pl 0000644 00000004066 15027505476 0011751 0 ustar 00 #!/usr/bin/perl # created on 2018-02-12 use warnings; use strict; use v5.11; use Proc::ProcessTable; use Time::HiRes; my @time_spans; my %cpu_times; my $ppt = Proc::ProcessTable->new; my $start_time = [ Time::HiRes::gettimeofday() ]; my $poll_intervall = int( 2 * 1000 * 1000 ); # 2 sec my $num_steps = 2; local $| = 1; my $cur_step = 0; while (1) { # current and old index of array. # because of modulo, the idcs are rotated. # the old index is always the oldest recorded entry # this means the entry *after* the current index #[ c o . . . ] #[ . c o . . ] #[ . . c o . ] #[ . . . c o ] #[ o . . . c ] my $cur_idx = $cur_step % $num_steps; my $old_idx = ( $cur_step + 1 ) % $num_steps; # calc pct cpu per interval: # we need seconds since # https://stackoverflow.com/questions/16726779/how-do-i-get-the-total-cpu-usage-of-an-application-from-proc-pid-stat my $t = Time::HiRes::tv_interval($start_time); my $pt = $ppt->table; my %active_procs = (); for my $p (@$pt) { # init process info if non-existent my $pid = $p->pid; $active_procs{$pid} = 1; $cpu_times{$pid} //= []; $cpu_times{$pid}[$cur_idx] = $p->time; } $time_spans[$cur_idx] = $t; # clean the cputimes hash my @killed_procs = grep { !$active_procs{$_} } keys %cpu_times ; delete @cpu_times{@killed_procs}; my $ratio = 0; # make sure the array is filled with cpu times if ( $cur_step >= $num_steps ) { # move cursor to top left of screen print "\033[2J"; printf( "%-5s %s\n", "cpu", "pid"); # show cpu usage per process for my $pid (keys %cpu_times) { my $cpu_time = $cpu_times{$pid}; my $diff_cpu = ( $cpu_time->[$cur_idx] - ( $cpu_time->[$old_idx] // 0 ) ) / 1e6; my $diff_start = ( $time_spans[$cur_idx] - $time_spans[$old_idx] ); $ratio = $diff_cpu / $diff_start if ( $diff_start > 0 ); # show only processes that have a usage > 1% printf( "%5.1f %s\n", $ratio * 100, $pid ) if ( $ratio > 0.01 ); } } $cur_step++; Time::HiRes::usleep($poll_intervall); } README.linux 0000644 00000003455 15027505476 0006604 0 ustar 00 SUPPORTED ATTRIBUTES ==================== uid UID of process euid Effective UID of process suid Saved UID of process fuid File UID of process gid GID of process egid Effective GID of process sgid Saved GID of process fgid File GID of process pid process ID ppid parent process ID pgrp process group sess session ID priority priority of process ttynum tty number of process flags flags of process minflt minor page faults cminflt child minor page faults majflt major page faults cmajflt child major page faults utime user mode time (microseconds) stime kernel mode time (microseconds) cutime child utime (microseconds) cstime child stime (microseconds) time user + system time (microseconds) ctime child user + system time (microseconds) size virtual memory size (bytes) rss resident set size (bytes) wchan address of current system call fname file name start start time (seconds since the epoch) pctcpu percent cpu used since process started state state of process pctmem percent memory cmndline full command line of process exec absolute filename (including path) of executed command ttydev path of process's tty cwd current directory of process NOTE ==== This now correctly gives you microseconds. Previously all times were actually in milliseconds even though this file said microseconds. -Jason Smith BUGS ==== Though times are now converted to microseconds, they are limited to jiffie resolution. A jiffie is 100 Hertz on most platforms, 1024 Hertz on Alpha. -Philip Gwyn
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings