From: Gurusamy Sarathy Date: Tue, 20 Jul 1999 07:36:36 +0000 (+0000) Subject: move DProf things around to where they are supposed to be X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=95667ae449650939b6e6a521264f3846244da96a;p=p5sagit%2Fp5-mst-13.2.git move DProf things around to where they are supposed to be p4raw-id: //depot/perl@3710 --- diff --git a/INSTALL b/INSTALL index c5120d6..cfed299 100644 --- a/INSTALL +++ b/INSTALL @@ -1449,6 +1449,7 @@ make install will install the following: pod2man, and pod2text splain Describe Perl warnings and errors + dprofpp Perl code profile post-processor library files in $privlib and $archlib specified to Configure, usually under /usr/local/lib/perl5/. diff --git a/MANIFEST b/MANIFEST index 2c6ba5c..9adb74c 100644 --- a/MANIFEST +++ b/MANIFEST @@ -222,21 +222,6 @@ ext/Devel/DProf/DProf.pm Perl code profiler ext/Devel/DProf/DProf.xs Perl code profiler ext/Devel/DProf/Makefile.PL Perl code profiler makefile writer ext/Devel/DProf/Todo Perl code profiler todo list -ext/Devel/DProf/dprofpp.PL Perl code profile post-processor -ext/Devel/DProf/t/test1.pl Perl code profiler tests -ext/Devel/DProf/t/test1.t Perl code profiler tests -ext/Devel/DProf/t/test1.v Perl code profiler tests -ext/Devel/DProf/t/test2.t Perl code profiler tests -ext/Devel/DProf/t/test2.v Perl code profiler tests -ext/Devel/DProf/t/test3.t Perl code profiler tests -ext/Devel/DProf/t/test3.v Perl code profiler tests -ext/Devel/DProf/t/test4.t Perl code profiler tests -ext/Devel/DProf/t/test4.v Perl code profiler tests -ext/Devel/DProf/t/test5.t Perl code profiler tests -ext/Devel/DProf/t/test5.v Perl code profiler tests -ext/Devel/DProf/t/test6.t Perl code profiler tests -ext/Devel/DProf/t/test6.v Perl code profiler tests -ext/Devel/DProf/test.pl Perl code profiler testsuite driver ext/Devel/Peek/Changes Data debugging tool, changelog ext/Devel/Peek/Makefile.PL Data debugging tool, makefile writer ext/Devel/Peek/Peek.pm Data debugging tool, module and pod @@ -1134,6 +1119,19 @@ t/lib/db-hash.t See if DB_File works t/lib/db-recno.t See if DB_File works t/lib/dirhand.t See if DirHandle works t/lib/dosglob.t See if File::DosGlob works +t/lib/dprof.t Perl code profiler testsuite driver +t/lib/dprof/test1_t Perl code profiler tests +t/lib/dprof/test1_v Perl code profiler tests +t/lib/dprof/test2_t Perl code profiler tests +t/lib/dprof/test2_v Perl code profiler tests +t/lib/dprof/test3_t Perl code profiler tests +t/lib/dprof/test3_v Perl code profiler tests +t/lib/dprof/test4_t Perl code profiler tests +t/lib/dprof/test4_v Perl code profiler tests +t/lib/dprof/test5_t Perl code profiler tests +t/lib/dprof/test5_v Perl code profiler tests +t/lib/dprof/test6_t Perl code profiler tests +t/lib/dprof/test6_v Perl code profiler tests t/lib/dumper-ovl.t See if Data::Dumper works for overloaded data t/lib/dumper.t See if Data::Dumper works t/lib/english.t See if English works @@ -1366,6 +1364,7 @@ util.c Utility routines util.h Dummy header utils/Makefile Extract the utility scripts utils/c2ph.PL program to translate dbx stabs to perl +utils/dprofpp.PL Perl code profile post-processor utils/h2ph.PL A thing to turn C .h files into perl .ph files utils/h2xs.PL Program to make .xs files from C header files utils/perlbug.PL A simple tool to submit a bug report diff --git a/ext/Devel/DProf/Makefile.PL b/ext/Devel/DProf/Makefile.PL index 6de38f7..667cc52 100644 --- a/ext/Devel/DProf/Makefile.PL +++ b/ext/Devel/DProf/Makefile.PL @@ -4,9 +4,7 @@ WriteMakefile( NAME => 'Devel::DProf', DISTNAME => 'DProf', VERSION_FROM => 'DProf.pm', - clean => { 'FILES' => 'tmon.out t/tmon.out t/err dprofpp T/tmon.out'}, - EXE_FILES => ['dprofpp'], - PL_FILES => {'dprofpp.PL' => 'dprofpp'}, + clean => { 'FILES' => 'tmon.out t/tmon.out t/err'}, XSPROTOARG => '-noprototypes', DEFINE => '-DPERLDBf_NONAME=0x40 -DPERLDBf_GOTO=0x80 ' .'-DG_NODEBUG=32 -DPL_NEEDED', @@ -17,26 +15,3 @@ WriteMakefile( }, MAN3PODS => {}, ); - -sub MY::test_via_harness { "" } -#sub MY::test_via_harness { -# my( $self, $perl, $tests ) = @_; -# my $t = quotemeta( $tests ); -# my $res; -# -# $res = $self->MM::test_via_harness( $perl, $tests ); -# $res =~ s/^(\s+)/$1-/; -# $res =~ s/(&runtests)/\$\$switches $1/; -# $res =~ s/(; runtests)/; \$\$switches=q{-d:DProf}$1/; -# $res =~ s,$t,t/bug.t,; -# $res; -#} - -sub MY::test_via_script { - my( $self, $perl, $script ) = @_; - my $res; - - $res = $self->MM::test_via_script( $perl, $script ); - $res =~ s/(test.pl)/$1 -p $perl/; - $res; -} diff --git a/ext/Devel/DProf/t/test1.pl b/ext/Devel/DProf/t/test1.pl deleted file mode 100644 index af792ed..0000000 --- a/ext/Devel/DProf/t/test1.pl +++ /dev/null @@ -1,32 +0,0 @@ -END { print "main:: the end\n" } -sub FOO::END { print "foo:: the end\n" } - - -sub foo { - my $x; - my $y; - print "in sub foo\n"; - for( $x = 1; $x < 100; ++$x ){ - bar(); - for( $y = 1; $y < 100; ++$y ){ - } - } -} - -sub bar { - my $x; - print "in sub bar\n"; - for( $x = 1; $x < 100; ++$x ){ - } -} - -sub baz { - print "in sub baz\n"; - bar(); - foo(); -} - -bar(); -baz(); -foo(); - diff --git a/installman b/installman index ccb007c..04ef578 100755 --- a/installman +++ b/installman @@ -70,6 +70,7 @@ runpod2man('utils', $man1dir, $man1ext, 'perldoc'); runpod2man('utils', $man1dir, $man1ext, 'perlbug'); runpod2man('utils', $man1dir, $man1ext, 'pl2pm'); runpod2man('utils', $man1dir, $man1ext, 'splain'); +runpod2man('utils', $man1dir, $man1ext, 'dprofpp'); runpod2man('x2p', $man1dir, $man1ext, 's2p'); runpod2man('x2p', $man1dir, $man1ext, 'a2p.pod'); runpod2man('pod', $man1dir, $man1ext, 'pod2man'); diff --git a/installperl b/installperl index 3aa5285..39dafa8 100755 --- a/installperl +++ b/installperl @@ -57,7 +57,7 @@ while (@ARGV) { umask 022 unless $Is_VMS; my @scripts = qw(utils/c2ph utils/h2ph utils/h2xs utils/perlbug utils/perldoc - utils/pl2pm utils/splain utils/perlcc + utils/pl2pm utils/splain utils/perlcc utils/dprofpp x2p/s2p x2p/find2perl pod/pod2man pod/pod2html pod/pod2latex pod/pod2text pod/pod2usage pod/podchecker pod/podselect); diff --git a/pod/roffitall b/pod/roffitall index 1bafa8d..afb4432 100644 --- a/pod/roffitall +++ b/pod/roffitall @@ -86,6 +86,7 @@ toroff=` \ $mandir/a2p.1 \ $mandir/c2ph.1 \ + $mandir/dprofpp.1 \ $mandir/h2ph.1 \ $mandir/h2xs.1 \ $mandir/perlbug.1 \ diff --git a/ext/Devel/DProf/test.pl b/t/lib/dprof.t old mode 100644 new mode 100755 similarity index 65% rename from ext/Devel/DProf/test.pl rename to t/lib/dprof.t index a889fec..97e42bf --- a/ext/Devel/DProf/test.pl +++ b/t/lib/dprof.t @@ -1,6 +1,9 @@ -# perl +#!perl -require 5.003; +BEGIN { + chdir( 't' ) if -d 't'; + unshift @INC, '../lib'; +} use Benchmark qw( timediff timestr ); use Getopt::Std 'getopts'; @@ -11,19 +14,9 @@ getopts('vI:p:'); # -I Add to @INC # -p Name of perl binary -unless (-r 'dprofpp' and -M 'dprofpp' <= -M 'dprofpp.PL') { - print STDERR "dprofpp out of date, extracting...\n"; - system 'perl', 'dprofpp.PL' and die 'perl dprofpp.PL: exit code $?, $!'; -} -die "Need dprofpp, could not make it" unless -r 'dprofpp'; - -chdir( 't' ) if -d 't'; -@tests = @ARGV ? @ARGV : sort <*.t *.v>; # glob-sort, for OS/2 +@tests = @ARGV ? @ARGV : sort ; # glob-sort, for OS/2 $path_sep = $Config{path_sep} || ':'; -if( -d '../blib' ){ - unshift @INC, '../blib/arch', '../blib/lib'; -} $perl5lib = $opt_I || join( $path_sep, @INC ); $perl = $opt_p || $^X; @@ -62,15 +55,17 @@ sub profile { sub verify { my $test = shift; - system $perl, '-I.', $test, $opt_v?'-v':'', '-p', $perl; + system $perl, '-I../lib', '-I./lib/dprof', $test, + $opt_v?'-v':'', '-p', $perl; } $| = 1; +print "1..18\n"; while( @tests ){ $test = shift @tests; - print $test . '.' x (20 - length $test); - if( $test =~ /t$/ ){ + if( $test =~ /_t$/i ){ + print "# $test" . '.' x (20 - length $test); profile $test; } else{ diff --git a/ext/Devel/DProf/t/V.pm b/t/lib/dprof/V.pm similarity index 72% rename from ext/Devel/DProf/t/V.pm rename to t/lib/dprof/V.pm index e8d59a8..7e34da5 100644 --- a/ext/Devel/DProf/t/V.pm +++ b/t/lib/dprof/V.pm @@ -1,7 +1,7 @@ package V; use Getopt::Std 'getopts'; -getopts('vp:'); +getopts('vp:d:'); require Exporter; @ISA = 'Exporter'; @@ -9,18 +9,19 @@ require Exporter; @EXPORT = qw( dprofpp $opt_v $results $expected report @results ); @EXPORT_OK = qw( notok ok $num ); -my $out = 0; $num = 0; $results = $expected = ''; $perl = $opt_p || $^X; +$dpp = $opt_d || '../utils/dprofpp'; print "\nperl: $perl\n" if $opt_v; if( ! -f $perl ){ die "Where's Perl?" } +if( ! -f $dpp ){ die "Where's dprofpp?" } sub dprofpp { my $switches = shift; - open( D, "$perl ../dprofpp $switches 2> err |" ) || warn "$0: Can't run. $!\n"; + open( D, "$perl -I../lib $dpp $switches 2> err |" ) || warn "$0: Can't run. $!\n"; @results = ; close D; @@ -46,20 +47,13 @@ sub report { } sub ok { - ++$out; - print "ok $num, "; + print "ok $num\n"; } sub notok { - ++$out; - print "not ok $num, "; - if( $opt_v ){ - print "\nResult\n{$results}\n"; - print "Expected\n{$expected}\n"; - } + print "not ok $num\n"; + print "\nResult\n{$results}\n"; + print "Expected\n{$expected}\n"; } -END { print "\n" if $out } - - 1; diff --git a/ext/Devel/DProf/t/test1.t b/t/lib/dprof/test1_t similarity index 100% rename from ext/Devel/DProf/t/test1.t rename to t/lib/dprof/test1_t diff --git a/ext/Devel/DProf/t/test1.v b/t/lib/dprof/test1_v similarity index 100% rename from ext/Devel/DProf/t/test1.v rename to t/lib/dprof/test1_v diff --git a/ext/Devel/DProf/t/test2.t b/t/lib/dprof/test2_t similarity index 100% rename from ext/Devel/DProf/t/test2.t rename to t/lib/dprof/test2_t diff --git a/ext/Devel/DProf/t/test2.v b/t/lib/dprof/test2_v similarity index 67% rename from ext/Devel/DProf/t/test2.v rename to t/lib/dprof/test2_v index 3e9b183..8b775b3 100644 --- a/ext/Devel/DProf/t/test2.v +++ b/t/lib/dprof/test2_v @@ -15,10 +15,10 @@ main::baz main::foo main::bar }; -report 1, sub { $expected eq $results }; +report 5, sub { $expected eq $results }; dprofpp('-TF'); -report 2, sub { $expected eq $results }; +report 6, sub { $expected eq $results }; dprofpp( '-t' ); $expected = @@ -30,7 +30,7 @@ main::baz main::foo main::bar }; -report 3, sub { $expected eq $results }; +report 7, sub { $expected eq $results }; dprofpp('-tF'); -report 4, sub { $expected eq $results }; +report 8, sub { $expected eq $results }; diff --git a/ext/Devel/DProf/t/test3.t b/t/lib/dprof/test3_t similarity index 100% rename from ext/Devel/DProf/t/test3.t rename to t/lib/dprof/test3_t diff --git a/ext/Devel/DProf/t/test3.v b/t/lib/dprof/test3_v similarity index 63% rename from ext/Devel/DProf/t/test3.v rename to t/lib/dprof/test3_v index 31211c1..df7543e 100644 --- a/ext/Devel/DProf/t/test3.v +++ b/t/lib/dprof/test3_v @@ -9,7 +9,7 @@ main::baz main::bar main::foo }; -report 1, sub { $expected eq $results }; +report 9, sub { $expected eq $results }; dprofpp('-TF'); $e2 = $expected = @@ -18,12 +18,12 @@ main::baz main::bar main::foo }; -report 2, sub { $expected eq $results }; +report 10, sub { $expected eq $results }; dprofpp( '-t' ); $expected = $e1; -report 3, sub { 1 }; +report 11, sub { 1 }; dprofpp('-tF'); $expected = $e2; -report 4, sub { $expected eq $results }; +report 12, sub { $expected eq $results }; diff --git a/ext/Devel/DProf/t/test4.t b/t/lib/dprof/test4_t similarity index 92% rename from ext/Devel/DProf/t/test4.t rename to t/lib/dprof/test4_t index 7d5a356..7299682 100644 --- a/ext/Devel/DProf/t/test4.t +++ b/t/lib/dprof/test4_t @@ -17,7 +17,7 @@ sub baz { bar(); -fork; +eval { fork }; bar(); baz(); diff --git a/ext/Devel/DProf/t/test4.v b/t/lib/dprof/test4_v similarity index 66% rename from ext/Devel/DProf/t/test4.v rename to t/lib/dprof/test4_v index 3e9b183..d9677ff 100644 --- a/ext/Devel/DProf/t/test4.v +++ b/t/lib/dprof/test4_v @@ -15,10 +15,10 @@ main::baz main::foo main::bar }; -report 1, sub { $expected eq $results }; +report 13, sub { $expected eq $results }; dprofpp('-TF'); -report 2, sub { $expected eq $results }; +report 14, sub { $expected eq $results }; dprofpp( '-t' ); $expected = @@ -30,7 +30,7 @@ main::baz main::foo main::bar }; -report 3, sub { $expected eq $results }; +report 15, sub { $expected eq $results }; dprofpp('-tF'); -report 4, sub { $expected eq $results }; +report 16, sub { $expected eq $results }; diff --git a/ext/Devel/DProf/t/test5.t b/t/lib/dprof/test5_t similarity index 100% rename from ext/Devel/DProf/t/test5.t rename to t/lib/dprof/test5_t diff --git a/ext/Devel/DProf/t/test5.v b/t/lib/dprof/test5_v similarity index 76% rename from ext/Devel/DProf/t/test5.v rename to t/lib/dprof/test5_v index 8f90252..9e9298c 100644 --- a/ext/Devel/DProf/t/test5.v +++ b/t/lib/dprof/test5_v @@ -11,5 +11,5 @@ main::foo2 main::bar main::yeppers }; -report 1, sub { $expected eq $results }; +report 17, sub { $expected eq $results }; diff --git a/ext/Devel/DProf/t/test6.t b/t/lib/dprof/test6_t similarity index 100% rename from ext/Devel/DProf/t/test6.t rename to t/lib/dprof/test6_t diff --git a/ext/Devel/DProf/t/test6.v b/t/lib/dprof/test6_v similarity index 76% rename from ext/Devel/DProf/t/test6.v rename to t/lib/dprof/test6_v index 1236285..2f651ea 100644 --- a/ext/Devel/DProf/t/test6.v +++ b/t/lib/dprof/test6_v @@ -12,5 +12,5 @@ main::baz main::foo main::bar }; -report 1, sub { $expected eq $results }; +report 18, sub { $expected eq $results }; diff --git a/utils/Makefile b/utils/Makefile index 8051d28..f3a0663 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -5,9 +5,9 @@ REALPERL = ../perl # Files to be built with variable substitution after miniperl is # available. Dependencies handled manually below (for now). -pl = c2ph.PL h2ph.PL h2xs.PL perlbug.PL perldoc.PL pl2pm.PL splain.PL perlcc.PL -plextract = c2ph h2ph h2xs perlbug perldoc pl2pm splain perlcc -plextractexe = c2ph.exe h2ph.exe h2xs.exe perlbug.exe perldoc.exe pl2pm.exe splain.exe perlcc.exe +pl = c2ph.PL h2ph.PL h2xs.PL perlbug.PL perldoc.PL pl2pm.PL splain.PL perlcc.PL dprofpp.PL +plextract = c2ph h2ph h2xs perlbug perldoc pl2pm splain perlcc dprofpp +plextractexe = c2ph.exe h2ph.exe h2xs.exe perlbug.exe perldoc.exe pl2pm.exe splain.exe perlcc.exe dprofpp.exe all: $(plextract) @@ -33,6 +33,8 @@ splain: splain.PL ../config.sh ../lib/diagnostics.pm perlcc: perlcc.PL ../config.sh +dprofpp: dprofpp.PL ../config.sh + clean: realclean: diff --git a/ext/Devel/DProf/dprofpp.PL b/utils/dprofpp.PL similarity index 100% rename from ext/Devel/DProf/dprofpp.PL rename to utils/dprofpp.PL diff --git a/vms/descrip_mms.template b/vms/descrip_mms.template index 0bd08de..84f8d04 100644 --- a/vms/descrip_mms.template +++ b/vms/descrip_mms.template @@ -341,7 +341,7 @@ CRTLOPTS =,$(CRTL)/Options # Modules which must be installed before we can build extensions LIBPREREQ = $(ARCHDIR)Config.pm [.lib]DynaLoader.pm [.lib]vmsish.pm [.lib.VMS]Filespec.pm [.lib.ExtUtils]XSSymSet.pm -utils1 = [.lib.pod]perldoc.com [.lib.ExtUtils]Miniperl.pm [.utils]c2ph.com [.utils]h2ph.com [.utils]h2xs.com [.lib]perlbug.com [.lib]perlcc.com +utils1 = [.lib.pod]perldoc.com [.lib.ExtUtils]Miniperl.pm [.utils]c2ph.com [.utils]h2ph.com [.utils]h2xs.com [.lib]perlbug.com [.lib]perlcc.com [.utils]dprofpp.com utils2 = [.lib]splain.com [.utils]pl2pm.com .ifdef NOX2P @@ -496,6 +496,9 @@ dynext : $(LIBPREREQ) $(DBG)perlshr$(E) [.utils]c2ph.com : [.utils]c2ph.PL $(ARCHDIR)Config.pm $(MINIPERL) $(MMS$SOURCE) +[.utils]dprofpp.com : [.utils]dprofpp.PL $(ARCHDIR)Config.pm + $(MINIPERL) $(MMS$SOURCE) + [.utils]h2ph.com : [.utils]h2ph.PL $(ARCHDIR)Config.pm $(MINIPERL) $(MMS$SOURCE) diff --git a/win32/Makefile b/win32/Makefile index b852a1e..9dd5576 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -362,6 +362,7 @@ GLOBBAT = bin\perlglob.bat UTILS = \ ..\utils\h2ph \ ..\utils\splain \ + ..\utils\dprofpp \ ..\utils\perlbug \ ..\utils\pl2pm \ ..\utils\c2ph \ @@ -929,7 +930,7 @@ distclean: clean -del /f $(PODDIR)\*.html -del /f $(PODDIR)\*.bat cd ..\utils - -del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc pstruct + -del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc pstruct dprofpp -del /f *.bat cd ..\win32 cd ..\x2p diff --git a/win32/makefile.mk b/win32/makefile.mk index 0b74406..98c5c02 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -453,6 +453,7 @@ GLOBBAT = bin\perlglob.bat UTILS = \ ..\utils\h2ph \ ..\utils\splain \ + ..\utils\dprofpp \ ..\utils\perlbug \ ..\utils\pl2pm \ ..\utils\c2ph \ @@ -1073,7 +1074,7 @@ distclean: clean -del /f $(PODDIR)\*.html -del /f $(PODDIR)\*.bat -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc \ - pstruct *.bat + dprofpp pstruct *.bat -cd ..\x2p && del /f find2perl s2p *.bat -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new -del /f $(CONFIGPM)