PATH:
usr
/
bin
#!/usr/bin/perl eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' if 0; # not running under some shell use strict; my $VERSION = sprintf("1.%06d", q$Revision$ =~ /(\d+)/o); use Data::Dumper; use DBI::ProfileData; use Getopt::Long; # default options my $number = 10; my $sort = 'total'; my $filename = 'dbi.prof'; my $reverse = 0; my $case_sensitive = 0; my (%match, %exclude); # get options from command line GetOptions( 'version' => sub { die "dbiprof $VERSION\n" }, 'help' => sub { exit usage() }, 'number=i' => \$number, 'sort=s' => \$sort, 'dumpnodes!' => \my $dumpnodes, 'reverse' => \$reverse, 'match=s' => \%match, 'exclude=s' => \%exclude, 'case-sensitive' => \$case_sensitive, 'delete!' => \my $opt_delete, ) or exit usage(); sub usage { print <<EOS; dbiprof [options] [files] Reads and merges DBI profile data from files and prints a summary. files: defaults to $filename options: -number=N show top N, defaults to $number -sort=S sort by S, defaults to $sort -reverse reverse the sort -match=K=V for filtering, see docs -exclude=K=V for filtering, see docs -case_sensitive for -match and -exclude -delete rename files before reading then delete afterwards -version print version number and exit -help print this help EOS return 1; } # list of files defaults to dbi.prof my @files = @ARGV ? @ARGV : ('dbi.prof'); # instantiate ProfileData object my $prof = eval { DBI::ProfileData->new( Files => \@files, DeleteFiles => $opt_delete, ); }; die "Unable to load profile data: $@\n" if $@; if (%match) { # handle matches while (my ($key, $val) = each %match) { if ($val =~ m!^/(.+)/$!) { $val = $case_sensitive ? qr/$1/ : qr/$1/i; } $prof->match($key, $val, case_sensitive => $case_sensitive); } } if (%exclude) { # handle excludes while (my ($key, $val) = each %exclude) { if ($val =~ m!^/(.+)/$!) { $val = $case_sensitive ? qr/$1/ : qr/$1/i; } $prof->exclude($key, $val, case_sensitive => $case_sensitive); } } # sort the data $prof->sort(field => $sort, reverse => $reverse); # all done, print it out if ($dumpnodes) { $Data::Dumper::Indent = 1; $Data::Dumper::Terse = 1; $Data::Dumper::Useqq = 1; $Data::Dumper::Deparse = 0; print Dumper($prof->nodes); } else { print $prof->report(number => $number); } exit 0; __END__ =head1 NAME dbiprof - command-line client for DBI::ProfileData =head1 SYNOPSIS See a report of the ten queries with the longest total runtime in the profile dump file F<prof1.out>: dbiprof prof1.out See the top 10 most frequently run queries in the profile file F<dbi.prof> (the default): dbiprof --sort count See the same report with 15 entries: dbiprof --sort count --number 15 =head1 DESCRIPTION This tool is a command-line client for the DBI::ProfileData. It allows you to analyze the profile data file produced by DBI::ProfileDumper and produce various useful reports. =head1 OPTIONS This program accepts the following options: =over 4 =item --number N Produce this many items in the report. Defaults to 10. If set to "all" then all results are shown. =item --sort field Sort results by the given field. Sorting by multiple fields isn't currently supported (patches welcome). The available sort fields are: =over 4 =item total Sorts by total time run time across all runs. This is the default sort. =item longest Sorts by the longest single run. =item count Sorts by total number of runs. =item first Sorts by the time taken in the first run. =item shortest Sorts by the shortest single run. =item key1 Sorts by the value of the first element in the Path, which should be numeric. You can also sort by C<key2> and C<key3>. =back =item --reverse Reverses the selected sort. For example, to see a report of the shortest overall time: dbiprof --sort total --reverse =item --match keyN=value Consider only items where the specified key matches the given value. Keys are numbered from 1. For example, let's say you used a DBI::Profile Path of: [ DBIprofile_Statement, DBIprofile_Methodname ] And called dbiprof as in: dbiprof --match key2=execute Your report would only show execute queries, leaving out prepares, fetches, etc. If the value given starts and ends with slashes (C</>) then it will be treated as a regular expression. For example, to only include SELECT queries where key1 is the statement: dbiprof --match key1=/^SELECT/ By default the match expression is matched case-insensitively, but this can be changed with the --case-sensitive option. =item --exclude keyN=value Remove items for where the specified key matches the given value. For example, to exclude all prepare entries where key2 is the method name: dbiprof --exclude key2=prepare Like C<--match>, If the value given starts and ends with slashes (C</>) then it will be treated as a regular expression. For example, to exclude UPDATE queries where key1 is the statement: dbiprof --match key1=/^UPDATE/ By default the exclude expression is matched case-insensitively, but this can be changed with the --case-sensitive option. =item --case-sensitive Using this option causes --match and --exclude to work case-sensitively. Defaults to off. =item --delete Sets the C<DeleteFiles> option to L<DBI::ProfileData> which causes the files to be deleted after reading. See L<DBI::ProfileData> for more details. =item --dumpnodes Print the list of nodes in the form of a perl data structure. Use the C<-sort> option if you want the list sorted. =item --version Print the dbiprof version number and exit. =back =head1 AUTHOR Sam Tregar <sam@tregar.com> =head1 COPYRIGHT AND LICENSE Copyright (C) 2002 Sam Tregar This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself. =head1 SEE ALSO L<DBI::ProfileDumper|DBI::ProfileDumper>, L<DBI::Profile|DBI::Profile>, L<DBI|DBI>. =cut
[+]
..
[-] crontab.cagefs
[edit]
[-] passwd
[edit]
[-] ping
[edit]
[-] atq
[edit]
[-] uapi
[edit]
[-] atrm
[edit]
[-] crontab
[edit]
[-] at
[edit]
[-] cagefs_enter.proxied
[edit]
[-] batch
[edit]
[-] arch
[edit]
[-] awk
[edit]
[-] gawk
[edit]
[-] basename
[edit]
[-] cat
[edit]
[-] chgrp
[edit]
[-] chmod
[edit]
[-] chown
[edit]
[-] cp
[edit]
[-] cut
[edit]
[-] date
[edit]
[-] dd
[edit]
[-] df
[edit]
[-] echo
[edit]
[-] egrep
[edit]
[-] env
[edit]
[-] false
[edit]
[-] fgrep
[edit]
[-] grep
[edit]
[-] igawk
[edit]
[-] kill
[edit]
[-] link
[edit]
[-] ln
[edit]
[-] logger
[edit]
[-] login
[edit]
[-] ls
[edit]
[-] mkdir
[edit]
[-] mknod
[edit]
[-] more
[edit]
[-] mv
[edit]
[-] nice
[edit]
[-] pgawk
[edit]
[-] pwd
[edit]
[-] raw
[edit]
[-] rm
[edit]
[-] rmdir
[edit]
[-] sed
[edit]
[-] sleep
[edit]
[-] sort
[edit]
[-] stty
[edit]
[-] php
[edit]
[-] sync
[edit]
[-] taskset
[edit]
[-] touch
[edit]
[-] true
[edit]
[-] uname
[edit]
[-] unlink
[edit]
[-] [
[edit]
[-] addr2line
[edit]
[-] ar
[edit]
[-] as
[edit]
[-] base64
[edit]
[-] cal
[edit]
[-] c++filt
[edit]
[-] chcon
[edit]
[-] chrt
[edit]
[-] cksum
[edit]
[-] cmp
[edit]
[-] col
[edit]
[-] colcrt
[edit]
[-] colrm
[edit]
[-] column
[edit]
[-] comm
[edit]
[-] csplit
[edit]
[-] curl
[edit]
[-] diff
[edit]
[-] diff3
[edit]
[-] dir
[edit]
[-] dircolors
[edit]
[-] dirname
[edit]
[-] du
[edit]
[-] eqn
[edit]
[-] expand
[edit]
[-] expr
[edit]
[-] factor
[edit]
[-] file
[edit]
[-] find
[edit]
[-] flock
[edit]
[-] fmt
[edit]
[-] fold
[edit]
[-] geqn
[edit]
[-] getopt
[edit]
[-] gneqn
[edit]
[-] neqn
[edit]
[-] gnroff
[edit]
[-] nroff
[edit]
[-] gpic
[edit]
[-] pic
[edit]
[-] gprof
[edit]
[-] groff
[edit]
[-] grops
[edit]
[-] grotty
[edit]
[-] groups
[edit]
[-] gsoelim
[edit]
[-] soelim
[edit]
[-] gtbl
[edit]
[-] tbl
[edit]
[-] gtroff
[edit]
[-] troff
[edit]
[-] head
[edit]
[-] hexdump
[edit]
[-] hostid
[edit]
[-] id
[edit]
[-] install
[edit]
[-] ionice
[edit]
[-] ipcrm
[edit]
[-] ipcs
[edit]
[-] isosize
[edit]
[-] join
[edit]
[-] ld
[edit]
[-] ld.bfd
[edit]
[-] less
[edit]
[-] lessecho
[edit]
[-] lesskey
[edit]
[-] lesspipe.sh
[edit]
[-] logname
[edit]
[-] look
[edit]
[-] mcookie
[edit]
[-] md5sum
[edit]
[-] mkfifo
[edit]
[-] namei
[edit]
[-] nl
[edit]
[-] nm
[edit]
[-] nohup
[edit]
[-] objcopy
[edit]
[-] objdump
[edit]
[-] od
[edit]
[-] paste
[edit]
[-] pathchk
[edit]
[-] pinky
[edit]
[-] post-grohtml
[edit]
[-] pr
[edit]
[-] pre-grohtml
[edit]
[-] printenv
[edit]
[-] printf
[edit]
[-] ptx
[edit]
[-] ranlib
[edit]
[-] readelf
[edit]
[-] readlink
[edit]
[-] rename
[edit]
[-] renice
[edit]
[-] rev
[edit]
[-] runcon
[edit]
[-] script
[edit]
[-] sdiff
[edit]
[-] seq
[edit]
[-] setsid
[edit]
[-] setterm
[edit]
[-] sha1sum
[edit]
[-] sha224sum
[edit]
[-] sha256sum
[edit]
[-] sha384sum
[edit]
[-] sha512sum
[edit]
[-] shred
[edit]
[-] size
[edit]
[-] split
[edit]
[-] stat
[edit]
[-] strings
[edit]
[-] strip
[edit]
[-] sum
[edit]
[-] tac
[edit]
[-] tail
[edit]
[-] tailf
[edit]
[-] tee
[edit]
[-] test
[edit]
[-] tr
[edit]
[-] tsort
[edit]
[-] tty
[edit]
[-] ul
[edit]
[-] unexpand
[edit]
[-] uniq
[edit]
[-] users
[edit]
[-] vdir
[edit]
[-] wc
[edit]
[-] wget
[edit]
[-] whereis
[edit]
[-] which
[edit]
[-] whoami
[edit]
[-] xargs
[edit]
[-] yes
[edit]
[-] zsoelim
[edit]
[-] lynx
[edit]
[-] GET
[edit]
[-] mesg
[edit]
[-] gtar
[edit]
[-] tar
[edit]
[-] gunzip
[edit]
[-] gzip
[edit]
[-] zcat
[edit]
[-] bunzip2
[edit]
[-] bzip2
[edit]
[-] bzcat
[edit]
[-] bzcmp
[edit]
[-] bzdiff
[edit]
[-] bzgrep
[edit]
[-] bzip2recover
[edit]
[-] bzless
[edit]
[-] bzmore
[edit]
[-] zipinfo
[edit]
[-] gzexe
[edit]
[-] unzipsfx
[edit]
[-] c++
[edit]
[-] zcmp
[edit]
[-] zdiff
[edit]
[-] zegrep
[edit]
[-] zfgrep
[edit]
[-] zforce
[edit]
[-] zgrep
[edit]
[-] zip
[edit]
[-] zipcloak
[edit]
[-] zipgrep
[edit]
[-] gcc
[edit]
[-] zipnote
[edit]
[-] zipsplit
[edit]
[-] zless
[edit]
[-] zmore
[edit]
[-] znew
[edit]
[-] aclocal
[edit]
[-] autoconf
[edit]
[-] autoheader
[edit]
[-] autom4te
[edit]
[-] automake
[edit]
[-] autoreconf
[edit]
[-] autoscan
[edit]
[-] autoupdate
[edit]
[-] bison
[edit]
[-] c89
[edit]
[-] c99
[edit]
[-] vim
[edit]
[-] cc
[edit]
[-] xxd
[edit]
[-] flex
[edit]
[-] flex++
[edit]
[-] gcov
[edit]
[-] ldd
[edit]
[-] gmake
[edit]
[-] make
[edit]
[-] ifnames
[edit]
[-] lex
[edit]
[-] libtool
[edit]
[-] libtoolize
[edit]
[-] x86_64-redhat-linux-c++
[edit]
[-] x86_64-redhat-linux-g++
[edit]
[-] x86_64-redhat-linux-gcc
[edit]
[-] ex
[edit]
[-] a2p
[edit]
[-] rvi
[edit]
[-] rview
[edit]
[-] view
[edit]
[-] nano
[edit]
[-] rnano
[edit]
[-] rvim
[edit]
[-] h2ph
[edit]
[-] vimdiff
[edit]
[-] vimtutor
[edit]
[-] perl
[edit]
[-] gpg
[edit]
[-] gpg2
[edit]
[-] gpgsplit
[edit]
[-] gpgv
[edit]
[-] gpgv2
[edit]
[-] gpg-zip
[edit]
[-] catchsegv
[edit]
[-] gencat
[edit]
[-] getconf
[edit]
[-] getent
[edit]
[-] iconv
[edit]
[-] locale
[edit]
[-] localedef
[edit]
[-] rpcgen
[edit]
[-] sprof
[edit]
[-] tzselect
[edit]
[-] mogrify
[edit]
[-] convert
[edit]
[-] identify
[edit]
[-] composite
[edit]
[-] psed
[edit]
[-] mail
[edit]
[-] mailx
[edit]
[-] Mail
[edit]
[-] g++
[edit]
[-] my_print_defaults
[edit]
[-] mysql
[edit]
[-] vi
[edit]
[-] mysqladmin
[edit]
[-] mysqlbinlog
[edit]
[-] mysqlcheck
[edit]
[-] mysql_config
[edit]
[-] mysqldump
[edit]
[-] funzip
[edit]
[-] mysqlimport
[edit]
[-] mysqlshow
[edit]
[-] unzip
[edit]
[-] captoinfo
[edit]
[-] tic
[edit]
[-] clear
[edit]
[-] infocmp
[edit]
[-] infotocap
[edit]
[-] reset
[edit]
[-] tset
[edit]
[-] toe
[edit]
[-] tput
[edit]
[-] hostname
[edit]
[-] scp
[edit]
[-] sftp
[edit]
[-] slogin
[edit]
[-] ssh
[edit]
[-] ssh-add
[edit]
[-] ssh-agent
[edit]
[-] ssh-copy-id
[edit]
[-] ssh-keyscan
[edit]
[-] ssh-keygen
[edit]
[-] openssl
[edit]
[-] c2ph
[edit]
[-] cpan
[edit]
[-] bash
[edit]
[-] dbiprof
[edit]
[-] dbiproxy
[edit]
[-] find2perl
[edit]
[-] h2xs
[edit]
[-] cpp
[edit]
[-] instmodsh
[edit]
[-] libnetcfg
[edit]
[-] gs
[edit]
[-] perldoc
[edit]
[-] perl5.16.3
[edit]
[-] perlbug
[edit]
[-] perlthanks
[edit]
[-] perlivp
[edit]
[-] perlml
[edit]
[-] piconv
[edit]
[-] pl2pm
[edit]
[-] pod2html
[edit]
[-] pod2latex
[edit]
[-] pod2man
[edit]
[-] pod2text
[edit]
[-] pod2usage
[edit]
[-] podchecker
[edit]
[-] podselect
[edit]
[-] prove
[edit]
[-] pstruct
[edit]
[-] s2p
[edit]
[-] splain
[edit]
[-] gsbj
[edit]
[-] xsubpp
[edit]
[-] ps
[edit]
[-] free
[edit]
[-] pgrep
[edit]
[-] pkill
[edit]
[-] pmap
[edit]
[-] pwdx
[edit]
[-] skill
[edit]
[-] slabtop
[edit]
[-] snice
[edit]
[-] tload
[edit]
[-] top
[edit]
[-] uptime
[edit]
[-] vmstat
[edit]
[-] watch
[edit]
[-] pydoc
[edit]
[-] gsdj
[edit]
[-] python
[edit]
[-] python2
[edit]
[-] python2.7
[edit]
[-] screen
[edit]
[-] gslj
[edit]
[-] sh
[edit]
[-] bashbug-64
[edit]
[-] import
[edit]
[-] sqlite3
[edit]
[-] display
[edit]
[-] cldetect
[edit]
[-] realpath
[edit]
[-] pango-querymodules-64
[edit]
[-] tclsh
[edit]
[-] tclsh8.5
[edit]
[-] scl
[edit]
[-] Magick-config
[edit]
[-] aclocal-1.13
[edit]
[-] automake-1.13
[edit]
[-] m4
[edit]
[-] MagickCore-config
[edit]
[-] fc-pattern
[edit]
[-] fc-scan
[edit]
[-] pango-list
[edit]
[-] pango-view
[edit]
[-] freetype-config
[edit]
[-] icu-config
[edit]
[-] git-upload-archive
[edit]
[-] isql
[edit]
[-] odbc_config
[edit]
[-] MagickWand-config
[edit]
[-] gm
[edit]
[-] Wand-config
[edit]
[-] utmpdump
[edit]
[-] gsnd
[edit]
[-] truncate
[edit]
[-] icu-config-64
[edit]
[-] strace
[edit]
[-] mdig
[edit]
[-] nsupdate
[edit]
[-] gslp
[edit]
[-] hunspell
[edit]
[-] shuf
[edit]
[-] git-upload-pack
[edit]
[-] scl_enabled
[edit]
[-] git-receive-pack
[edit]
[-] compare
[edit]
[-] mktemp
[edit]
[-] clwpos-user
[edit]
[-] xsltproc
[edit]
[-] icuinfo
[edit]
[-] delv
[edit]
[-] tmpwatch
[edit]
[-] gpg-error
[edit]
[-] tabs
[edit]
[-] idn
[edit]
[-] who
[edit]
[-] scl_source
[edit]
[-] xmlcatalog
[edit]
[-] xmllint
[edit]
[-] aspell
[edit]
[-] ispell
[edit]
[-] precat
[edit]
[-] preunzip
[edit]
[-] prezip
[edit]
[-] prezip-bin
[edit]
[-] run-with-aspell
[edit]
[-] spell
[edit]
[-] word-list-compress
[edit]
[-] recode
[edit]
[-] stdbuf
[edit]
[-] cloudlinux-backup-helper-uid
[edit]
[-] xmlwf
[edit]
[-] enchant
[edit]
[-] enchant-lsmod
[edit]
[-] gpg-agent
[edit]
[-] pinentry
[edit]
[-] pinentry-curses
[edit]
[-] animate
[edit]
[-] pkg-config
[edit]
[-] montage
[edit]
[-] stream
[edit]
[-] gcc-ar
[edit]
[-] gcc-nm
[edit]
[-] gcc-ranlib
[edit]
[-] replace
[edit]
[-] dvipdf
[edit]
[-] eps2eps
[edit]
[-] gsdj500
[edit]
[-] timeout
[edit]
[-] ghostscript
[edit]
[-] git-shell
[edit]
[-] lprsetup.sh
[edit]
[-] pdf2dsc
[edit]
[-] pdf2ps
[edit]
[-] pf2afm
[edit]
[-] pfbtopfa
[edit]
[-] pphs
[edit]
[-] printafm
[edit]
[-] ps2ascii
[edit]
[-] ps2epsi
[edit]
[-] ps2pdf
[edit]
[-] ps2pdf12
[edit]
[-] ps2pdf13
[edit]
[-] ps2pdf14
[edit]
[-] ps2pdfwr
[edit]
[-] ps2ps
[edit]
[-] ps2ps2
[edit]
[-] unix-lpr.sh
[edit]
[-] nproc
[edit]
[-] cloudlinux-awp-user
[edit]
[-] fc-cache
[edit]
[-] fc-cache-64
[edit]
[-] fc-cat
[edit]
[-] fc-conflist
[edit]
[-] fc-list
[edit]
[-] fc-match
[edit]
[-] fc-query
[edit]
[-] fc-validate
[edit]
[-] selectorctl
[edit]
[-] git
[edit]
[-] mysql_config-64
[edit]
[-] geoiplookup
[edit]
[-] geoiplookup6
[edit]
[-] dltest
[edit]
[-] iusql
[edit]
[-] odbcinst
[edit]
[-] conjure
[edit]
[-] patch
[edit]
[-] numfmt
[edit]
[-] dig
[edit]
[-] host
[edit]
[-] nslookup
[edit]